From 83fb7fd78e10841b4ae7a4e9b0603fc3e1ce8c72 Mon Sep 17 00:00:00 2001 From: Jeff Tung <100387939+jtung-apple@users.noreply.github.com> Date: Tue, 2 Aug 2022 19:29:07 -0700 Subject: [PATCH] Issue 18505 - Darwin: synchronous API part 1: basic structure and serial read (#20519) --- .restyled.yaml | 1 + .../CHIP/MTRAsyncCallbackWorkQueue.h | 61 + .../CHIP/MTRAsyncCallbackWorkQueue.mm | 197 + .../CHIP/MTRAsyncCallbackWorkQueue_Internal.h | 34 + .../CHIP/MTRAttributeCacheContainer.mm | 2 +- src/darwin/Framework/CHIP/MTRBaseDevice.h | 14 +- src/darwin/Framework/CHIP/MTRBaseDevice.mm | 149 +- .../Framework/CHIP/MTRBaseDevice_Internal.h | 19 +- src/darwin/Framework/CHIP/MTRCluster.h | 4 + src/darwin/Framework/CHIP/MTRDevice.h | 152 + src/darwin/Framework/CHIP/MTRDevice.mm | 823 + .../Framework/CHIP/MTRDeviceController.mm | 32 + .../CHIP/MTRDeviceController_Internal.h | 11 + .../Framework/CHIP/MTRDevice_Internal.h | 46 + src/darwin/Framework/CHIP/Matter.h | 3 + .../CHIP/templates/MTRBaseClusters-src.zapt | 8 +- .../CHIP/templates/MTRBaseClusters.zapt | 4 - .../CHIP/templates/MTRClusters-src.zapt | 140 + .../Framework/CHIP/templates/MTRClusters.zapt | 50 + .../CHIP/templates/MTRClusters_internal.zapt | 19 + .../Framework/CHIP/templates/templates.json | 21 +- .../CHIP/zap-generated/MTRBaseClusters.h | 4 - .../CHIP/zap-generated/MTRBaseClusters.mm | 3010 +-- .../CHIP/zap-generated/MTRClusters.h | 5281 ++++ .../CHIP/zap-generated/MTRClusters.mm | 22424 ++++++++++++++++ .../CHIP/zap-generated/MTRClusters_internal.h | 352 + .../CHIPTests/MTRAsyncCallbackQueueTests.m | 149 + .../Framework/CHIPTests/MTRDeviceTests.m | 20 +- .../Framework/CHIPTests/MTRXPCProtocolTests.m | 48 +- .../Matter.xcodeproj/project.pbxproj | 44 + 30 files changed, 31495 insertions(+), 1627 deletions(-) create mode 100644 src/darwin/Framework/CHIP/MTRAsyncCallbackWorkQueue.h create mode 100644 src/darwin/Framework/CHIP/MTRAsyncCallbackWorkQueue.mm create mode 100644 src/darwin/Framework/CHIP/MTRAsyncCallbackWorkQueue_Internal.h create mode 100644 src/darwin/Framework/CHIP/MTRDevice.h create mode 100644 src/darwin/Framework/CHIP/MTRDevice.mm create mode 100644 src/darwin/Framework/CHIP/MTRDevice_Internal.h create mode 100644 src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt create mode 100644 src/darwin/Framework/CHIP/templates/MTRClusters.zapt create mode 100644 src/darwin/Framework/CHIP/templates/MTRClusters_internal.zapt create mode 100644 src/darwin/Framework/CHIP/zap-generated/MTRClusters.h create mode 100644 src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm create mode 100644 src/darwin/Framework/CHIP/zap-generated/MTRClusters_internal.h create mode 100644 src/darwin/Framework/CHIPTests/MTRAsyncCallbackQueueTests.m diff --git a/.restyled.yaml b/.restyled.yaml index c45fe98588b7ec..77e24305402490 100644 --- a/.restyled.yaml +++ b/.restyled.yaml @@ -73,6 +73,7 @@ exclude: - "examples/chef/sample_app_util/test_files/*.yaml" - "examples/chef/zzz_generated/**/*" - "src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm" # https://github.com/project-chip/connectedhomeip/issues/20236 + - "src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm" changed_paths: diff --git a/src/darwin/Framework/CHIP/MTRAsyncCallbackWorkQueue.h b/src/darwin/Framework/CHIP/MTRAsyncCallbackWorkQueue.h new file mode 100644 index 00000000000000..8793a688934ff3 --- /dev/null +++ b/src/darwin/Framework/CHIP/MTRAsyncCallbackWorkQueue.h @@ -0,0 +1,61 @@ +/** + * + * 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. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class MTRAsyncCallbackQueueWorkItem; + +typedef void (^MTRAsyncCallbackReadyHandler)(id context, NSUInteger retryCount); + +// How to queue a new work item: +// - Create MTRAsyncCallbackQueueWorkItem object +// - Create ready handler block (MTRAsyncCallbackReadyHandler) +// - block is called when it's the work item's turn to do work +// - its body is to do work with the device +// - at the end of work, call on the work item object: +// - endWork for success or failure +// - retryWork for temporary failures +// - Set the work handler block to the Item object +// - Call enqueueWorkItem on the MTRDevice's work queue property + +// A serial one-at-a-time queue for performing work items +@interface MTRAsyncCallbackWorkQueue : NSObject +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +- (void)enqueueWorkItem:(MTRAsyncCallbackQueueWorkItem *)item; + +// TODO: Add a "set concurrency width" method to allow for more than 1 work item at a time +@end + +// An item in the work queue +@interface MTRAsyncCallbackQueueWorkItem : NSObject +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +- (instancetype)initWithQueue:(dispatch_queue_t)queue; +@property (nonatomic, strong) MTRAsyncCallbackReadyHandler readyHandler; +@property (nonatomic, strong) dispatch_block_t cancelHandler; + +// Called by Cluster object's after async work is done +- (void)endWork; +- (void)retryWork; +@end + +NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTRAsyncCallbackWorkQueue.mm b/src/darwin/Framework/CHIP/MTRAsyncCallbackWorkQueue.mm new file mode 100644 index 00000000000000..7e09b55890ac81 --- /dev/null +++ b/src/darwin/Framework/CHIP/MTRAsyncCallbackWorkQueue.mm @@ -0,0 +1,197 @@ +/** + * + * 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. + */ + +#import +#import + +#import "MTRAsyncCallbackWorkQueue_Internal.h" +#import "MTRLogging.h" + +#pragma mark - Class extensions + +@interface MTRAsyncCallbackWorkQueue () +@property (nonatomic, readonly) os_unfair_lock lock; +@property (nonatomic, strong, readonly) id context; +@property (nonatomic, strong, readonly) dispatch_queue_t queue; +@property (nonatomic, strong, readonly) NSMutableArray * items; +@property (nonatomic, readwrite) NSUInteger runningWorkItemCount; + +// For WorkItem's use only - the parameter is for sanity check +- (void)endWork:(MTRAsyncCallbackQueueWorkItem *)workItem; +- (void)retryWork:(MTRAsyncCallbackQueueWorkItem *)workItem; +@end + +@interface MTRAsyncCallbackQueueWorkItem () +@property (nonatomic, strong, readonly) dispatch_queue_t queue; +@property (nonatomic, readwrite) NSUInteger retryCount; +@property (nonatomic, strong) MTRAsyncCallbackWorkQueue * workQueue; +// Called by the queue +- (void)callReadyHandlerWithContext:(id)context; +- (void)cancel; +@end + +#pragma mark - Class implementations + +@implementation MTRAsyncCallbackWorkQueue +- (instancetype)initWithContext:(id)context queue:(dispatch_queue_t)queue +{ + if (self = [super init]) { + _lock = OS_UNFAIR_LOCK_INIT; + _context = context; + _queue = queue; + _items = [NSMutableArray array]; + } + return self; +} + +- (void)enqueueWorkItem:(MTRAsyncCallbackQueueWorkItem *)item +{ + os_unfair_lock_lock(&_lock); + item.workQueue = self; + [self.items addObject:item]; + + [self _callNextReadyWorkItem]; + os_unfair_lock_unlock(&_lock); +} + +- (void)invalidate +{ + os_unfair_lock_lock(&_lock); + NSMutableArray * invalidateItems = _items; + _items = nil; + os_unfair_lock_unlock(&_lock); + + for (MTRAsyncCallbackQueueWorkItem * item in invalidateItems) { + [item cancel]; + } + [invalidateItems removeAllObjects]; +} + +- (void)endWork:(MTRAsyncCallbackQueueWorkItem *)workItem +{ + os_unfair_lock_lock(&_lock); + // sanity check if running + if (!self.runningWorkItemCount) { + // something is wrong with state - nothing is currently running + os_unfair_lock_unlock(&_lock); + MTR_LOG_ERROR("endWork: no work is running on work queue"); + return; + } + + // sanity check the same work item is running + // when "concurrency width" is implemented need to check first N items + MTRAsyncCallbackQueueWorkItem * firstWorkItem = self.items.firstObject; + if (firstWorkItem != workItem) { + // something is wrong with this work item - should not be currently running + os_unfair_lock_unlock(&_lock); + MTR_LOG_ERROR("endWork: work item is not first on work queue"); + return; + } + + // since work is done, remove from queue and call ready on the next item + [self.items removeObjectAtIndex:0]; + + // when "concurrency width" is implemented this will be decremented instead + self.runningWorkItemCount = 0; + [self _callNextReadyWorkItem]; + os_unfair_lock_unlock(&_lock); +} + +- (void)retryWork:(MTRAsyncCallbackQueueWorkItem *)workItem +{ + // reset BOOL and call again + os_unfair_lock_lock(&_lock); + // sanity check if running + if (!self.runningWorkItemCount) { + // something is wrong with state - nothing is currently running + os_unfair_lock_unlock(&_lock); + MTR_LOG_ERROR("retryWork: no work is running on work queue"); + return; + } + + // sanity check the same work item is running + // when "concurrency width" is implemented need to check first N items + MTRAsyncCallbackQueueWorkItem * firstWorkItem = self.items.firstObject; + if (firstWorkItem != workItem) { + // something is wrong with this work item - should not be currently running + os_unfair_lock_unlock(&_lock); + MTR_LOG_ERROR("retryWork: work item is not first on work queue"); + return; + } + + // when "concurrency width" is implemented this will be decremented instead + self.runningWorkItemCount = 0; + [self _callNextReadyWorkItem]; + os_unfair_lock_unlock(&_lock); +} + +// assume lock is held while calling this +- (void)_callNextReadyWorkItem +{ + // when "concurrency width" is implemented this will be checked against the width + if (self.runningWorkItemCount) { + // can't run next work item until the current one is done + return; + } + + // when "concurrency width" is implemented this will be incremented instead + self.runningWorkItemCount = 1; + + MTRAsyncCallbackQueueWorkItem * workItem = self.items.firstObject; + [workItem callReadyHandlerWithContext:self.context]; +} +@end + +@implementation MTRAsyncCallbackQueueWorkItem + +- (instancetype)initWithQueue:(dispatch_queue_t)queue +{ + if (self = [super init]) { + _queue = queue; + } + return self; +} + +// Called by Cluster object's after async work is done +- (void)endWork +{ + [self.workQueue endWork:self]; +} + +// Called by Cluster object's after async work is done +- (void)retryWork +{ + [self.workQueue retryWork:self]; +} + +// Called by the work queue +- (void)callReadyHandlerWithContext:(id)context +{ + dispatch_async(self.queue, ^{ + self.readyHandler(context, self.retryCount); + self.retryCount++; + }); +} + +// Called by the work queue +- (void)cancel +{ + dispatch_async(self.queue, ^{ + self.cancelHandler(); + }); +} +@end diff --git a/src/darwin/Framework/CHIP/MTRAsyncCallbackWorkQueue_Internal.h b/src/darwin/Framework/CHIP/MTRAsyncCallbackWorkQueue_Internal.h new file mode 100644 index 00000000000000..35eb765c3914ce --- /dev/null +++ b/src/darwin/Framework/CHIP/MTRAsyncCallbackWorkQueue_Internal.h @@ -0,0 +1,34 @@ +/** + * + * 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. + */ + +#import + +#import "MTRAsyncCallbackWorkQueue.h" + +NS_ASSUME_NONNULL_BEGIN + +@class MTRDevice; + +@interface MTRAsyncCallbackWorkQueue () +// The MTRDevice object is only held and passed back as a reference and is opaque to the queue +- (instancetype)initWithContext:(id _Nullable)context queue:(dispatch_queue_t)queue; + +// Called by DeviceController at device clean up time +- (void)invalidate; +@end + +NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTRAttributeCacheContainer.mm b/src/darwin/Framework/CHIP/MTRAttributeCacheContainer.mm index e0ee3e77e43a4b..2ec0d10d4eac38 100644 --- a/src/darwin/Framework/CHIP/MTRAttributeCacheContainer.mm +++ b/src/darwin/Framework/CHIP/MTRAttributeCacheContainer.mm @@ -58,7 +58,7 @@ static CHIP_ERROR AppendAttibuteValueToArray( chip::TLV::TLVReader reader; CHIP_ERROR err = cache->Get(path, reader); if (err == CHIP_NO_ERROR) { - id obj = NSObjectFromCHIPTLV(&reader); + id obj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); if (obj) { [array addObject:@ { MTRAttributePathKey : [[MTRAttributePath alloc] initWithPath:path], MTRDataKey : obj }]; return CHIP_NO_ERROR; diff --git a/src/darwin/Framework/CHIP/MTRBaseDevice.h b/src/darwin/Framework/CHIP/MTRBaseDevice.h index 815e37c3c7d655..8d0b89406abbd2 100644 --- a/src/darwin/Framework/CHIP/MTRBaseDevice.h +++ b/src/darwin/Framework/CHIP/MTRBaseDevice.h @@ -67,6 +67,8 @@ NS_ASSUME_NONNULL_BEGIN * MTRDataKey : Data-value NSDictionary object. */ typedef void (^MTRDeviceResponseHandler)(NSArray *> * _Nullable values, NSError * _Nullable error); +typedef void (^MTRDeviceReportHandler)(NSArray * values); +typedef void (^MTRDeviceErrorHandler)(NSError * error); extern NSString * const MTRAttributePathKey; extern NSString * const MTRCommandPathKey; @@ -129,12 +131,12 @@ extern NSString * const MTRArrayValueType; - (void)subscribeWithQueue:(dispatch_queue_t)queue minInterval:(uint16_t)minInterval maxInterval:(uint16_t)maxInterval - params:(nullable MTRSubscribeParams *)params + params:(MTRSubscribeParams * _Nullable)params cacheContainer:(MTRAttributeCacheContainer * _Nullable)attributeCacheContainer - attributeReportHandler:(nullable void (^)(NSArray * value))attributeReportHandler - eventReportHandler:(nullable void (^)(NSArray * value))eventReportHandler - errorHandler:(void (^)(NSError * error))errorHandler - subscriptionEstablished:(nullable void (^)(void))subscriptionEstablishedHandler; + attributeReportHandler:(MTRDeviceReportHandler _Nullable)attributeReportHandler + eventReportHandler:(MTRDeviceReportHandler _Nullable)eventReportHandler + errorHandler:(MTRDeviceErrorHandler)errorHandler + subscriptionEstablished:(dispatch_block_t _Nullable)subscriptionEstablishedHandler; /** * Read attribute in a designated attribute path @@ -211,7 +213,7 @@ extern NSString * const MTRArrayValueType; @end -@interface MTRAttributePath : NSObject +@interface MTRAttributePath : NSObject @property (nonatomic, readonly, strong, nonnull) NSNumber * endpoint; @property (nonatomic, readonly, strong, nonnull) NSNumber * cluster; @property (nonatomic, readonly, strong, nonnull) NSNumber * attribute; diff --git a/src/darwin/Framework/CHIP/MTRBaseDevice.mm b/src/darwin/Framework/CHIP/MTRBaseDevice.mm index b3e909470b9161..9b3f10521ae465 100644 --- a/src/darwin/Framework/CHIP/MTRBaseDevice.mm +++ b/src/darwin/Framework/CHIP/MTRBaseDevice.mm @@ -66,7 +66,7 @@ NSString * const MTRStructureValueType = @"Structure"; NSString * const MTRArrayValueType = @"Array"; -class NSObjectDataValueCallbackBridge; +class MTRDataValueDictionaryCallbackBridge; @interface MTRBaseDevice () @@ -76,19 +76,6 @@ @interface MTRBaseDevice () - (chip::NodeId)deviceID; @end -@interface MTRAttributeReport () -- (instancetype)initWithPath:(const ConcreteDataAttributePath &)path value:(nullable id)value error:(nullable NSError *)error; -@end - -@interface MTREventReport () -- (instancetype)initWithPath:(const ConcreteEventPath &)path - eventNumber:(NSNumber *)eventNumber - priority:(NSNumber *)priority - timestamp:(NSNumber *)timestamp - value:(nullable id)value - error:(nullable NSError *)error; -@end - @interface MTRReadClientContainer : NSObject @property (nonatomic, readwrite) app::ReadClient * readClientPtr; @property (nonatomic, readwrite) app::AttributePathParams * pathParams; @@ -391,7 +378,7 @@ - (void)subscribeWithQueue:(dispatch_queue_t)queue } // Copy params before going async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; [self.deviceController getSessionForNode:self.nodeID completionHandler:^(ExchangeManager * _Nullable exchangeManager, const Optional & session, @@ -413,8 +400,7 @@ - (void)subscribeWithQueue:(dispatch_queue_t)queue readParams.mAttributePathParamsListSize = 1; readParams.mpEventPathParamsList = eventPath.get(); readParams.mEventPathParamsListSize = 1; - readParams.mKeepSubscriptions = (params != nil) && (params.keepPreviousSubscriptions != nil) && - [params.keepPreviousSubscriptions boolValue]; + readParams.mKeepSubscriptions = [params.keepPreviousSubscriptions boolValue]; std::unique_ptr callback; std::unique_ptr readClient; @@ -468,8 +454,8 @@ - (void)subscribeWithQueue:(dispatch_queue_t)queue }]; } -// Convert TLV data into NSObject -id _Nullable NSObjectFromCHIPTLV(chip::TLV::TLVReader * data) +// Convert TLV data into data-value dictionary as described in MTRDeviceResponseHandler +id _Nullable MTRDecodeDataValueDictionaryFromCHIPTLV(chip::TLV::TLVReader * data) { chip::TLV::TLVType dataTLVType = data->GetType(); switch (dataTLVType) { @@ -567,7 +553,7 @@ id _Nullable NSObjectFromCHIPTLV(chip::TLV::TLVReader * data) NSMutableArray * array = [[NSMutableArray alloc] init]; while ((err = data->Next()) == CHIP_NO_ERROR) { chip::TLV::Tag tag = data->GetTag(); - id value = NSObjectFromCHIPTLV(data); + id value = MTRDecodeDataValueDictionaryFromCHIPTLV(data); if (value == nullptr) { MTR_LOG_ERROR("Error when decoding TLV container"); return nil; @@ -596,7 +582,7 @@ id _Nullable NSObjectFromCHIPTLV(chip::TLV::TLVReader * data) } } -static CHIP_ERROR EncodeTLVFromObject(id object, chip::TLV::TLVWriter & writer, chip::TLV::Tag tag) +static CHIP_ERROR MTREncodeTLVFromDataValueDictionary(id object, chip::TLV::TLVWriter & writer, chip::TLV::Tag tag) { if (![object isKindOfClass:[NSDictionary class]]) { MTR_LOG_ERROR("Error: Unsupported object to encode: %@", [object class]); @@ -678,7 +664,8 @@ static CHIP_ERROR EncodeTLVFromObject(id object, chip::TLV::TLVWriter & writer, MTR_LOG_ERROR("Error: Structure element to encode has corrupt value: %@", element); return CHIP_ERROR_INVALID_ARGUMENT; } - ReturnErrorOnFailure(EncodeTLVFromObject(elementValue, writer, chip::TLV::ContextTag([elementTag unsignedCharValue]))); + ReturnErrorOnFailure( + MTREncodeTLVFromDataValueDictionary(elementValue, writer, chip::TLV::ContextTag([elementTag unsignedCharValue]))); } ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; @@ -700,7 +687,7 @@ static CHIP_ERROR EncodeTLVFromObject(id object, chip::TLV::TLVWriter & writer, MTR_LOG_ERROR("Error: Array element to encode has corrupt value: %@", element); return CHIP_ERROR_INVALID_ARGUMENT; } - ReturnErrorOnFailure(EncodeTLVFromObject(elementValue, writer, chip::TLV::AnonymousTag())); + ReturnErrorOnFailure(MTREncodeTLVFromDataValueDictionary(elementValue, writer, chip::TLV::AnonymousTag())); } ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; @@ -710,24 +697,24 @@ static CHIP_ERROR EncodeTLVFromObject(id object, chip::TLV::TLVWriter & writer, } // Callback type to pass data value as an NSObject -typedef void (*NSObjectDataValueCallback)(void * context, id value); +typedef void (*MTRDataValueDictionaryCallback)(void * context, id value); typedef void (*MTRErrorCallback)(void * context, CHIP_ERROR error); // Rename to be generic for decode and encode -class NSObjectData { +class MTRDataValueDictionaryDecodableType { public: - NSObjectData() + MTRDataValueDictionaryDecodableType() : decodedObj(nil) { } - NSObjectData(id obj) + MTRDataValueDictionaryDecodableType(id obj) : decodedObj(obj) { } CHIP_ERROR Decode(chip::TLV::TLVReader & data) { - decodedObj = NSObjectFromCHIPTLV(&data); + decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&data); if (decodedObj == nil) { MTR_LOG_ERROR("Error: Failed to get value from TLV data for attribute reading response"); } @@ -736,7 +723,7 @@ CHIP_ERROR Decode(chip::TLV::TLVReader & data) CHIP_ERROR Encode(chip::TLV::TLVWriter & writer, chip::TLV::Tag tag) const { - return EncodeTLVFromObject(decodedObj, writer, tag); + return MTREncodeTLVFromDataValueDictionary(decodedObj, writer, tag); } static constexpr bool kIsFabricScoped = false; @@ -749,12 +736,12 @@ CHIP_ERROR Encode(chip::TLV::TLVWriter & writer, chip::TLV::Tag tag) const id _Nullable decodedObj; }; -// Callback bridge for NSObjectDataValueCallback -class NSObjectDataValueCallbackBridge : public MTRCallbackBridge { +// Callback bridge for MTRDataValueDictionaryCallback +class MTRDataValueDictionaryCallbackBridge : public MTRCallbackBridge { public: - NSObjectDataValueCallbackBridge(dispatch_queue_t queue, MTRBaseDevice * device, MTRDeviceResponseHandler handler, + MTRDataValueDictionaryCallbackBridge(dispatch_queue_t queue, MTRBaseDevice * device, MTRDeviceResponseHandler handler, MTRActionBlock action, bool keepAlive = false) - : MTRCallbackBridge(queue, device, handler, action, OnSuccessFn, keepAlive) {}; + : MTRCallbackBridge(queue, device, handler, action, OnSuccessFn, keepAlive) {}; static void OnSuccessFn(void * context, id value) { DispatchSuccess(context, value); } }; @@ -847,10 +834,10 @@ - (void)readAttributeWithEndpointId:(NSNumber *)endpointId clusterId = (clusterId == nil) ? nil : [clusterId copy]; attributeId = (attributeId == nil) ? nil : [attributeId copy]; params = (params == nil) ? nil : [params copy]; - new NSObjectDataValueCallbackBridge(clientQueue, self, completion, + new MTRDataValueDictionaryCallbackBridge(clientQueue, self, completion, ^(ExchangeManager & exchangeManager, const SessionHandle & session, chip::Callback::Cancelable * success, chip::Callback::Cancelable * failure) { - auto successFn = chip::Callback::Callback::FromCancelable(success); + auto successFn = chip::Callback::Callback::FromCancelable(success); auto failureFn = chip::Callback::Callback::FromCancelable(failure); auto context = successFn->mContext; auto successCb = successFn->mCall; @@ -858,16 +845,16 @@ new NSObjectDataValueCallbackBridge(clientQueue, self, completion, auto resultArray = [[NSMutableArray alloc] init]; auto resultSuccess = [[NSMutableArray alloc] init]; auto resultFailure = [[NSMutableArray alloc] init]; - auto onSuccessCb - = [resultArray, resultSuccess](const app::ConcreteAttributePath & attribPath, const NSObjectData & aData) { - [resultArray addObject:@ { - MTRAttributePathKey : [[MTRAttributePath alloc] initWithPath:attribPath], - MTRDataKey : aData.GetDecodedObject() - }]; - if ([resultSuccess count] == 0) { - [resultSuccess addObject:[NSNumber numberWithBool:YES]]; - } - }; + auto onSuccessCb = [resultArray, resultSuccess](const app::ConcreteAttributePath & attribPath, + const MTRDataValueDictionaryDecodableType & aData) { + [resultArray addObject:@ { + MTRAttributePathKey : [[MTRAttributePath alloc] initWithPath:attribPath], + MTRDataKey : aData.GetDecodedObject() + }]; + if ([resultSuccess count] == 0) { + [resultSuccess addObject:[NSNumber numberWithBool:YES]]; + } + }; auto onFailureCb = [resultArray, resultFailure](const app::ConcreteAttributePath * attribPath, CHIP_ERROR aError) { if (attribPath) { @@ -899,7 +886,7 @@ new NSObjectDataValueCallbackBridge(clientQueue, self, completion, readParams.mIsFabricFiltered = params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue]; auto onDone = [resultArray, resultSuccess, resultFailure, context, successCb, failureCb]( - BufferedReadAttributeCallback * callback) { + BufferedReadAttributeCallback * callback) { if ([resultFailure count] > 0 || [resultSuccess count] == 0) { // Failure if (failureCb) { @@ -920,7 +907,7 @@ new NSObjectDataValueCallbackBridge(clientQueue, self, completion, chip::Platform::Delete(callback); }; - auto callback = chip::Platform::MakeUnique>( + auto callback = chip::Platform::MakeUnique>( attributePath.mClusterId, attributePath.mAttributeId, onSuccessCb, onFailureCb, onDone, nullptr); VerifyOrReturnError(callback != nullptr, CHIP_ERROR_NO_MEMORY); @@ -953,10 +940,10 @@ - (void)writeAttributeWithEndpointId:(NSNumber *)endpointId clientQueue:(dispatch_queue_t)clientQueue completion:(MTRDeviceResponseHandler)completion { - new NSObjectDataValueCallbackBridge(clientQueue, self, completion, + new MTRDataValueDictionaryCallbackBridge(clientQueue, self, completion, ^(ExchangeManager & exchangeManager, const SessionHandle & session, chip::Callback::Cancelable * success, chip::Callback::Cancelable * failure) { - auto successFn = chip::Callback::Callback::FromCancelable(success); + auto successFn = chip::Callback::Callback::FromCancelable(success); auto failureFn = chip::Callback::Callback::FromCancelable(failure); auto context = successFn->mContext; auto successCb = successFn->mCall; @@ -1005,18 +992,19 @@ new NSObjectDataValueCallbackBridge(clientQueue, self, completion, } }; - return chip::Controller::WriteAttribute(session, + return chip::Controller::WriteAttribute(session, static_cast([endpointId unsignedShortValue]), static_cast([clusterId unsignedLongValue]), - static_cast([attributeId unsignedLongValue]), NSObjectData(value), onSuccessCb, onFailureCb, - (timeoutMs == nil) ? NullOptional : Optional([timeoutMs unsignedShortValue]), onDoneCb, NullOptional); + static_cast([attributeId unsignedLongValue]), MTRDataValueDictionaryDecodableType(value), + onSuccessCb, onFailureCb, (timeoutMs == nil) ? NullOptional : Optional([timeoutMs unsignedShortValue]), + onDoneCb, NullOptional); }); } class NSObjectCommandCallback final : public app::CommandSender::Callback { public: using OnSuccessCallbackType - = std::function; + = std::function; using OnErrorCallbackType = std::function; using OnDoneCallbackType = std::function; @@ -1057,7 +1045,7 @@ void OnResponse(app::CommandSender * apCommandSender, const app::ConcreteCommand void NSObjectCommandCallback::OnResponse(app::CommandSender * apCommandSender, const app::ConcreteCommandPath & aCommandPath, const app::StatusIB & aStatus, TLV::TLVReader * aReader) { - NSObjectData response; + MTRDataValueDictionaryDecodableType response; CHIP_ERROR err = CHIP_NO_ERROR; // @@ -1094,10 +1082,10 @@ - (void)invokeCommandWithEndpointId:(NSNumber *)endpointId commandFields = (commandFields == nil) ? nil : [commandFields copy]; timeoutMs = (timeoutMs == nil) ? nil : [timeoutMs copy]; - new NSObjectDataValueCallbackBridge(clientQueue, self, completion, + new MTRDataValueDictionaryCallbackBridge(clientQueue, self, completion, ^(ExchangeManager & exchangeManager, const SessionHandle & session, chip::Callback::Cancelable * success, chip::Callback::Cancelable * failure) { - auto successFn = chip::Callback::Callback::FromCancelable(success); + auto successFn = chip::Callback::Callback::FromCancelable(success); auto failureFn = chip::Callback::Callback::FromCancelable(failure); auto context = successFn->mContext; auto successCb = successFn->mCall; @@ -1106,7 +1094,7 @@ new NSObjectDataValueCallbackBridge(clientQueue, self, completion, auto resultSuccess = [[NSMutableArray alloc] init]; auto resultFailure = [[NSMutableArray alloc] init]; auto onSuccessCb = [resultArray, resultSuccess](const app::ConcreteCommandPath & commandPath, - const app::StatusIB & status, const NSObjectData & responseData) { + const app::StatusIB & status, const MTRDataValueDictionaryDecodableType & responseData) { if (responseData.GetDecodedObject()) { [resultArray addObject:@ { MTRCommandPathKey : [[MTRCommandPath alloc] initWithPath:commandPath], @@ -1161,7 +1149,7 @@ new NSObjectDataValueCallbackBridge(clientQueue, self, completion, auto commandSender = chip::Platform::MakeUnique(decoder.get(), &exchangeManager, false); VerifyOrReturnError(commandSender != nullptr, CHIP_ERROR_NO_MEMORY); - ReturnErrorOnFailure(commandSender->AddRequestData(commandPath, NSObjectData(commandFields), + ReturnErrorOnFailure(commandSender->AddRequestData(commandPath, MTRDataValueDictionaryDecodableType(commandFields), (timeoutMs == nil) ? NullOptional : Optional([timeoutMs unsignedShortValue]))); ReturnErrorOnFailure(commandSender->SendCommandRequest(session)); @@ -1211,7 +1199,7 @@ - (void)subscribeAttributeWithEndpointId:(NSNumber * _Nullable)endpointId } auto onReportCb = [clientQueue, reportHandler]( - const app::ConcreteAttributePath & attribPath, const NSObjectData & data) { + const app::ConcreteAttributePath & attribPath, const MTRDataValueDictionaryDecodableType & data) { id valueObject = data.GetDecodedObject(); app::ConcreteAttributePath pathCopy = attribPath; dispatch_async(clientQueue, ^{ @@ -1272,14 +1260,14 @@ - (void)subscribeAttributeWithEndpointId:(NSNumber * _Nullable)endpointId readParams.mKeepSubscriptions = (params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); - auto onDone = [container](BufferedReadAttributeCallback * callback) { + auto onDone = [container](BufferedReadAttributeCallback * callback) { chip::Platform::Delete(callback); [container onDone]; }; - auto callback - = chip::Platform::MakeUnique>(container.pathParams->mClusterId, - container.pathParams->mAttributeId, onReportCb, onFailureCb, onDone, onEstablishedCb); + auto callback = chip::Platform::MakeUnique>( + container.pathParams->mClusterId, container.pathParams->mAttributeId, onReportCb, onFailureCb, onDone, + onEstablishedCb); auto readClient = Platform::New( engine, exchangeManager, callback->GetBufferedCallback(), chip::app::ReadClient::InteractionType::Subscribe); @@ -1322,7 +1310,7 @@ - (void)failSubscribers:(dispatch_queue_t)clientQueue completion:(void (^)(void) // The following method is for unit testing purpose only + (id)CHIPEncodeAndDecodeNSObject:(id)object { - NSObjectData originalData(object); + MTRDataValueDictionaryDecodableType originalData(object); chip::TLV::TLVWriter writer; uint8_t buffer[1024]; writer.Init(buffer, sizeof(buffer)); @@ -1350,7 +1338,7 @@ + (id)CHIPEncodeAndDecodeNSObject:(id)object MTR_LOG_ERROR("Error: TLV reader did not read the tag correctly: %llu", tag.mVal); return nil; } - NSObjectData decodedData; + MTRDataValueDictionaryDecodableType decodedData; error = decodedData.Decode(reader); if (error != CHIP_NO_ERROR) { MTR_LOG_ERROR("Error: Data decoding failed: %s", error.AsString()); @@ -1372,6 +1360,13 @@ - (instancetype)initWithPath:(const ConcreteDataAttributePath &)path return self; } +- (NSString *)description +{ + return [NSString stringWithFormat:@" endpoint %u cluster %u attribute %u", + (uint16_t) _endpoint.unsignedShortValue, (uint32_t) _cluster.unsignedLongValue, + (uint32_t) _attribute.unsignedLongValue]; +} + + (instancetype)attributePathWithEndpointId:(NSNumber *)endpoint clusterId:(NSNumber *)clusterId attributeId:(NSNumber *)attributeId { ConcreteDataAttributePath path(static_cast([endpoint unsignedShortValue]), @@ -1380,6 +1375,30 @@ ConcreteDataAttributePath path(static_cast([endpoint unsignedS return [[MTRAttributePath alloc] initWithPath:path]; } + +- (BOOL)isEqualToAttributePath:(MTRAttributePath *)attributePath +{ + return [_endpoint isEqualToNumber:attributePath.endpoint] && [_cluster isEqualToNumber:attributePath.cluster] && + [_attribute isEqualToNumber:attributePath.attribute]; +} + +- (BOOL)isEqual:(id)object +{ + if (![object isKindOfClass:[self class]]) { + return NO; + } + return [self isEqualToAttributePath:object]; +} + +- (NSUInteger)hash +{ + return _endpoint.unsignedShortValue ^ _cluster.unsignedLongValue ^ _attribute.unsignedLongValue; +} + +- (id)copyWithZone:(NSZone *)zone +{ + return [MTRAttributePath attributePathWithEndpointId:_endpoint clusterId:_cluster attributeId:_attribute]; +} @end @implementation MTREventPath diff --git a/src/darwin/Framework/CHIP/MTRBaseDevice_Internal.h b/src/darwin/Framework/CHIP/MTRBaseDevice_Internal.h index 48e187c8785764..ca0050574471c4 100644 --- a/src/darwin/Framework/CHIP/MTRBaseDevice_Internal.h +++ b/src/darwin/Framework/CHIP/MTRBaseDevice_Internal.h @@ -20,6 +20,7 @@ #include #include +#include #include @class MTRDeviceController; @@ -71,7 +72,23 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)initWithPath:(const chip::app::ConcreteCommandPath &)path; @end +@interface MTRAttributeReport () +- (instancetype)initWithPath:(const chip::app::ConcreteDataAttributePath &)path + value:(nullable id)value + error:(nullable NSError *)error; +@end + +@interface MTREventReport () +- (instancetype)initWithPath:(const chip::app::ConcreteEventPath &)path + eventNumber:(NSNumber *)eventNumber + priority:(NSNumber *)priority + timestamp:(NSNumber *)timestamp + value:(nullable id)value + error:(nullable NSError *)error; +@end + // Exported utility function -id _Nullable NSObjectFromCHIPTLV(chip::TLV::TLVReader * data); +// Convert TLV data into data-value dictionary as described in MTRDeviceResponseHandler +id _Nullable MTRDecodeDataValueDictionaryFromCHIPTLV(chip::TLV::TLVReader * data); NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTRCluster.h b/src/darwin/Framework/CHIP/MTRCluster.h index 88e408d05b2654..ce6dc57683c4c0 100644 --- a/src/darwin/Framework/CHIP/MTRCluster.h +++ b/src/darwin/Framework/CHIP/MTRCluster.h @@ -17,6 +17,10 @@ #import +typedef void (^ResponseHandler)(id _Nullable value, NSError * _Nullable error); +typedef void (^StatusCompletion)(NSError * _Nullable error); +typedef void (^SubscriptionEstablishedHandler)(void); + @class MTRBaseDevice; NS_ASSUME_NONNULL_BEGIN diff --git a/src/darwin/Framework/CHIP/MTRDevice.h b/src/darwin/Framework/CHIP/MTRDevice.h new file mode 100644 index 00000000000000..5b4bcc9224005e --- /dev/null +++ b/src/darwin/Framework/CHIP/MTRDevice.h @@ -0,0 +1,152 @@ +/** + * + * 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. + */ + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@class MTRDeviceController; +@class MTRAsyncCallbackWorkQueue; + +@protocol MTRDeviceSubscriptionDelegate; + +@interface MTRDevice : NSObject +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +/** + * Directly instantiate a MTRDevice with a MTRDeviceController as a shim. + * + * All device-specific information would be stored on the device controller, and + * retrieved when performing actions using a combination of MTRBaseDevice + * and MTRAsyncCallbackQueue. + */ ++ (instancetype)deviceWithDeviceID:(uint64_t)deviceID deviceController:(MTRDeviceController *)deviceController; + +/** + * Subscribe to receive attribute reports for everything (all endpoints, all + * clusters, all attributes, all events) on the device. + * + * The subscriber provides a delegate object conforming to MTRDeviceSubscriptionDelegate + */ +- (void)subscribeWithDelegate:(id)delegate + queue:(dispatch_queue_t)queue + minInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + params:(MTRSubscribeParams * _Nullable)params; + +/** + * Read attribute in a designated attribute path + * + * @return a data-value dictionary of the attribute as described in MTRDeviceResponseHandler + */ +- (NSDictionary *)readAttributeWithEndpointId:(NSNumber * _Nullable)endpointId + clusterId:(NSNumber * _Nullable)clusterId + attributeId:(NSNumber * _Nullable)attributeId + params:(MTRReadParams * _Nullable)params; + +/** + * Write to attribute in a designated attribute path + * + * @param value A data-value NSDictionary object as described in + * MTRDeviceResponseHandler. + * + * @param expectedValueIntervalMs interval that the write value is assumed to hold true before actual interaction happens. This + * value will be clamped to timeoutMs. + * + * @param timeoutMs timeout in milliseconds for timed write, or nil. + * + * Received values are an NSArray object with response-value element as described in + * readAttributeWithEndpointId:clusterId:attributeId:clientQueue:completion:. + */ +- (void)writeAttributeWithEndpointId:(NSNumber *)endpointId + clusterId:(NSNumber *)clusterId + attributeId:(NSNumber *)attributeId + value:(id)value + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + timedWriteTimeout:(NSNumber * _Nullable)timeoutMs; + +/** + * Invoke a command with a designated command path + * + * @param commandFields command fields object. The object must be a data-value NSDictionary object + * as described in the MTRDeviceResponseHandler. + * The attribute must be a Structure, i.e., + * the NSDictionary MTRTypeKey key must have the value MTRStructureValueType. + * + * @param expectedValues array of dictionaries containing the expected values in the same format as + * attribute read completion handler. Requires MTRAttributePathKey values. + * See MTRDeviceResponseHandler definition for dictionary details. + * + * @param expectedValueIntervalMs interval that the write value is assumed to hold true before actual interaction happens. This + * value will be clamped to timeoutMs. + * + * @param timeoutMs timeout in milliseconds for timed invoke, or nil. + * + * @param completion response handler will receive either values or error. + */ +- (void)invokeCommandWithEndpointId:(NSNumber *)endpointId + clusterId:(NSNumber *)clusterId + commandId:(NSNumber *)commandId + commandFields:(id)commandFields + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + timedInvokeTimeout:(NSNumber * _Nullable)timeoutMs + clientQueue:(dispatch_queue_t)clientQueue + completion:(MTRDeviceResponseHandler)completion; + +@end + +@protocol MTRDeviceSubscriptionDelegate +@required +/** + * subscriptionEstablished + * + * Called once the subscription is established. This will + * be _after_ the first (priming) call to both report callbacks. + */ +- (void)subscriptionEstablished; + +/** + * subscriptionReceivedAttributeReport: + * + * Notifies delegate of attribute reports from the MTRDevice + * + * @param attributeReport An array of response-value objects as described in MTRDeviceResponseHandler + */ +- (void)subscriptionReceivedAttributeReport:(NSArray *)attributeReport; + +/** + * subscriptionReceivedEventReport: + * + * Notifies delegate of event reports from the MTRDevice + * + * @param eventReport An array of MTREventReport objects + */ +- (void)subscriptionReceivedEventReport:(NSArray *)eventReport; + +/** + * subscriptionEndedWithError: + * + * Called any time there is an error for the + * entire subscription (with a non-nil "error"), and terminate the subscription + */ +- (void)subscriptionEndedWithError:(NSError *)error; +@end + +NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm new file mode 100644 index 00000000000000..bfa1d55a910af7 --- /dev/null +++ b/src/darwin/Framework/CHIP/MTRDevice.mm @@ -0,0 +1,823 @@ +/** + * + * 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. + */ + +#import + +#import "MTRAsyncCallbackWorkQueue_Internal.h" +#import "MTRBaseDevice_Internal.h" +#import "MTRCluster.h" +#import "MTRDeviceController_Internal.h" +#import "MTRDevice_Internal.h" +#import "MTRError_Internal.h" +#import "MTREventTLVValueDecoder_Internal.h" +#import "MTRLogging.h" + +#include "lib/core/CHIPError.h" +#include "lib/core/DataModelTypes.h" +#include + +#include +#include +#include +#include +#include + +typedef void (^MTRDeviceAttributeReportHandler)(NSArray * _Nonnull); + +// Consider moving utility classes to their own file +#pragma mark - Utility Classes +@interface MTRPair : NSObject ++ (instancetype)pairWithFirst:(FirstObjectType)first second:(SecondObjectType)second; +@property (nonatomic, readonly) FirstObjectType first; +@property (nonatomic, readonly) SecondObjectType second; +@end + +@implementation MTRPair +- (instancetype)initWithFirst:(id)first second:(id)second +{ + if (self = [super init]) { + _first = first; + _second = second; + } + return self; +} ++ (instancetype)pairWithFirst:(id)first second:(id)second +{ + return [[MTRPair alloc] initWithFirst:first second:second]; +} +@end + +@interface MTRWeakReference : NSObject ++ (instancetype)weakReferenceWithObject:(ObjectType)object; +- (instancetype)initWithObject:(ObjectType)object; +- (ObjectType)strongObject; // returns strong object or NULL +@end + +@interface MTRWeakReference () { +@private + __weak id _object; +} +@end + +@implementation MTRWeakReference +- (instancetype)initWithObject:(id)object +{ + if (self = [super init]) { + _object = object; + } + return self; +} ++ (instancetype)weakReferenceWithObject:(id)object +{ + return [[MTRWeakReference alloc] initWithObject:object]; +} +- (id)strongObject +{ + return _object; +} +@end + +#pragma mark - SubscriptionCallback class declaration +using namespace chip; +using namespace chip::app; +using namespace chip::Protocols::InteractionModel; + +typedef void (^DataReportCallback)(NSArray * value); +typedef void (^ErrorCallback)(NSError * error); + +namespace { + +class SubscriptionCallback final : public ClusterStateCache::Callback { +public: + SubscriptionCallback(dispatch_queue_t queue, DataReportCallback attributeReportCallback, DataReportCallback eventReportCallback, + ErrorCallback errorCallback, SubscriptionEstablishedHandler _Nullable subscriptionEstablishedHandler) + : mQueue(queue) + , mAttributeReportCallback(attributeReportCallback) + , mEventReportCallback(eventReportCallback) + , mErrorCallback(errorCallback) + , mSubscriptionEstablishedHandler(subscriptionEstablishedHandler) + , mBufferedReadAdapter(*this) + { + } + + SubscriptionCallback(dispatch_queue_t queue, DataReportCallback attributeReportCallback, DataReportCallback eventReportCallback, + ErrorCallback errorCallback, SubscriptionEstablishedHandler _Nullable subscriptionEstablishedHandler, + void (^onDoneHandler)(void)) + : mQueue(queue) + , mAttributeReportCallback(attributeReportCallback) + , mEventReportCallback(eventReportCallback) + , mErrorCallback(errorCallback) + , mSubscriptionEstablishedHandler(subscriptionEstablishedHandler) + , mBufferedReadAdapter(*this) + , mOnDoneHandler(onDoneHandler) + { + } + + BufferedReadCallback & GetBufferedCallback() { return mBufferedReadAdapter; } + + // We need to exist to get a ReadClient, so can't take this as a constructor argument. + void AdoptReadClient(std::unique_ptr aReadClient) { mReadClient = std::move(aReadClient); } + void AdoptAttributeCache(std::unique_ptr aAttributeCache) { mAttributeCache = std::move(aAttributeCache); } + +private: + void OnReportBegin() override; + + void OnReportEnd() override; + + void OnEventData(const EventHeader & aEventHeader, TLV::TLVReader * apData, const StatusIB * apStatus) override; + + void OnAttributeData(const ConcreteDataAttributePath & aPath, TLV::TLVReader * apData, const StatusIB & aStatus) override; + + void OnError(CHIP_ERROR aError) override; + + void OnDone(ReadClient * aReadClient) override; + + void OnDeallocatePaths(ReadPrepareParams && aReadPrepareParams) override; + + void OnSubscriptionEstablished(SubscriptionId aSubscriptionId) override; + + void ReportData(); + void ReportError(CHIP_ERROR err); + void ReportError(const StatusIB & status); + void ReportError(NSError * _Nullable err); + +private: + dispatch_queue_t mQueue; + DataReportCallback _Nullable mAttributeReportCallback = nil; + DataReportCallback _Nullable mEventReportCallback = nil; + // We set mErrorCallback to nil when queueing error reports, so we + // make sure to only report one error. + ErrorCallback _Nullable mErrorCallback = nil; + SubscriptionEstablishedHandler _Nullable mSubscriptionEstablishedHandler; + BufferedReadCallback mBufferedReadAdapter; + NSMutableArray * _Nullable mAttributeReports = nil; + NSMutableArray * _Nullable mEventReports = nil; + + // Our lifetime management is a little complicated. On error we + // attempt to delete the ReadClient, but asynchronously. While + // that's pending, someone else (e.g. an error it runs into) could + // delete it too. And if someone else does attempt to delete it, we want to + // make sure we delete ourselves as well. + // + // To handle this, enforce the following rules: + // + // 1) We guarantee that mErrorCallback is only invoked with an error once. + // 2) We ensure that we delete ourselves and the passed in ReadClient only from OnDone or a queued-up + // error callback, but not both, by tracking whether we have a queued-up + // deletion. + std::unique_ptr mReadClient; + std::unique_ptr mAttributeCache; + bool mHaveQueuedDeletion = false; + void (^mOnDoneHandler)(void) = nil; +}; + +} // anonymous namespace + +#pragma mark - MTRDevice +@interface MTRDevice () +@property (nonatomic, copy) MTRDevice * blahhey; +@property (nonatomic, copy) id blah; +@property (nonatomic, readonly) os_unfair_lock lock; +@property (nonatomic) dispatch_queue_t queue; +@property (nonatomic) NSMutableSet> *> * subscribers; + +@property (nonatomic) BOOL subscriptionActive; + +// Read cache is attributePath => NSDictionary of value. +// See MTRDeviceResponseHandler definition for value dictionary details. +@property (nonatomic) NSMutableDictionary * readCache; + +// Expected value cache is attributePath => MTRPair of [NSDate of expiration time, NSDictionary of value] +// See MTRDeviceResponseHandler definition for value dictionary details. +@property (nonatomic) NSMutableDictionary *> * expectedValueCache; + +@property (nonatomic) MTRAsyncCallbackWorkQueue * asyncCallbackWorkQueue; +@end + +@implementation MTRDevice + +- (instancetype)initWithDeviceID:(uint64_t)deviceID + deviceController:(MTRDeviceController *)deviceController + queue:(dispatch_queue_t)queue +{ + if (self = [super init]) { + _lock = OS_UNFAIR_LOCK_INIT; + _deviceID = deviceID; + _deviceController = deviceController; + _queue = queue; + _readCache = [NSMutableDictionary dictionary]; + _expectedValueCache = [NSMutableDictionary dictionary]; + _asyncCallbackWorkQueue = [[MTRAsyncCallbackWorkQueue alloc] initWithContext:self queue:queue]; + } + return self; +} + ++ (instancetype)deviceWithDeviceID:(uint64_t)deviceID deviceController:(MTRDeviceController *)deviceController +{ + return [deviceController deviceForDeviceID:deviceID]; +} + +- (void)connectAndPerformAsync:(MTRDevicePerformAsyncBlock)asyncBlock +{ + [_deviceController getBaseDevice:_deviceID + queue:_queue + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + asyncBlock(device); + }]; +} + +#pragma mark Subscription +- (void)performBlockForDelegates:(void (^)(id))block +{ + os_unfair_lock_lock(&self->_lock); + NSSet * delegatesToCall = [_subscribers copy]; + os_unfair_lock_unlock(&self->_lock); + + NSMutableSet * lostDelegates = [NSMutableSet set]; + for (MTRWeakReference> * delegateWeakReference in delegatesToCall) { + id delegate = delegateWeakReference.strongObject; + if (!delegate) { + [lostDelegates addObject:delegateWeakReference]; + } + + block(delegate); + } + + os_unfair_lock_lock(&self->_lock); + [_subscribers minusSet:lostDelegates]; + os_unfair_lock_unlock(&self->_lock); + + // Options to consider when no more subscribers are alive: + // A) tear down subscription + // B) keep subscription until error, and wait for client to resubscribe + // C) keep subscription / resubscribe on error, until EOL MTRDevice +} + +- (void)_handleSubscriptionEstablished +{ + [self performBlockForDelegates:^(id delegate) { + [delegate subscriptionEstablished]; + }]; +} + +- (void)_handleSubscriptionError:(NSError *)error +{ + _subscriptionActive = NO; + + [self performBlockForDelegates:^(id delegate) { + [delegate subscriptionEndedWithError:error]; + }]; + [_subscribers removeAllObjects]; +} + +- (void)_reportAttributes:(NSArray *> *)attributes +{ + if (attributes.count) { + [self performBlockForDelegates:^(id delegate) { + [delegate subscriptionReceivedAttributeReport:attributes]; + }]; + } +} + +- (void)_handleAttributeReport:(NSArray *> *)attributeReport +{ + NSArray * attributesToReport = [self _getAttributesToReportWithReportedValues:attributeReport]; + + [self _reportAttributes:attributesToReport]; +} + +- (void)_handleEventReport:(NSArray *)eventReport +{ + [self performBlockForDelegates:^(id delegate) { + [delegate subscriptionReceivedEventReport:eventReport]; + }]; +} + +- (void)subscribeWithMinInterval:(uint16_t)minInterval maxInterval:(uint16_t)maxInterval params:(MTRSubscribeParams *)params +{ + // for now just subscribe once + if (_subscriptionActive) { + return; + } + + _subscriptionActive = YES; + + // Copy params before going async. + params = [params copy]; + + [_deviceController getSessionForNode:_deviceID + completionHandler:^(chip::Messaging::ExchangeManager * _Nullable exchangeManager, + const chip::Optional & session, NSError * _Nullable error) { + if (error != nil) { + dispatch_async(self.queue, ^{ + [self _handleSubscriptionError:error]; + }); + return; + } + + // Wildcard endpoint, cluster, attribute, event. + auto attributePath = std::make_unique(); + auto eventPath = std::make_unique(); + ReadPrepareParams readParams(session.Value()); + readParams.mMinIntervalFloorSeconds = minInterval; + readParams.mMaxIntervalCeilingSeconds = maxInterval; + readParams.mpAttributePathParamsList = attributePath.get(); + readParams.mAttributePathParamsListSize = 1; + readParams.mpEventPathParamsList = eventPath.get(); + readParams.mEventPathParamsListSize = 1; + readParams.mKeepSubscriptions = [params.keepPreviousSubscriptions boolValue]; + + std::unique_ptr callback; + std::unique_ptr readClient; + std::unique_ptr attributeCache; + callback = std::make_unique( + self.queue, + ^(NSArray * value) { + [self _handleAttributeReport:value]; + }, + ^(NSArray * value) { + [self _handleEventReport:value]; + }, + ^(NSError * error) { + [self _handleSubscriptionError:error]; + }, + ^(void) { + [self _handleSubscriptionEstablished]; + }); + readClient = std::make_unique(InteractionModelEngine::GetInstance(), exchangeManager, + callback->GetBufferedCallback(), ReadClient::InteractionType::Subscribe); + + CHIP_ERROR err; + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + err = readClient->SendRequest(readParams); + } else { + // SendAutoResubscribeRequest cleans up the params, even on failure. + attributePath.release(); + eventPath.release(); + err = readClient->SendAutoResubscribeRequest(std::move(readParams)); + } + + if (err != CHIP_NO_ERROR) { + dispatch_async(self.queue, ^{ + [self _handleSubscriptionError:[MTRError errorForCHIPErrorCode:err]]; + }); + + return; + } + + // Callback and ReadClient will be deleted when OnDone is called or an error is + // encountered. + callback->AdoptReadClient(std::move(readClient)); + callback.release(); + }]; +} + +// TODO: support more than one subscriber / subscription delegate +// * reconcile second+ subscriptions with different min and max intervals +// (save min/max intervals for each subscriber and resubscribe when they change) +// * events should be cached and replayed for second+ subscribers +- (void)subscribeWithDelegate:(id)delegate + queue:(dispatch_queue_t)queue + minInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + params:(MTRSubscribeParams *)params +{ + // Save a weak reference to delegate, so if/when the object goes away, they are automatically unsubscribed + MTRWeakReference> * weakDelegate = [MTRWeakReference weakReferenceWithObject:delegate]; + [_subscribers addObject:weakDelegate]; + + // perform the actual subscription + [self subscribeWithMinInterval:minInterval maxInterval:maxInterval params:params]; +} + +#pragma mark Device Interactions +- (NSDictionary *)readAttributeWithEndpointId:(NSNumber * _Nullable)endpointId + clusterId:(NSNumber * _Nullable)clusterId + attributeId:(NSNumber * _Nullable)attributeId + params:(MTRReadParams * _Nullable)params +{ + // Create work item, set ready handler to perform task, then enqueue the work + MTRAsyncCallbackQueueWorkItem * workItem = [[MTRAsyncCallbackQueueWorkItem alloc] initWithQueue:_queue]; + MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { + [self connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + [baseDevice readAttributeWithEndpointId:endpointId + clusterId:clusterId + attributeId:attributeId + params:params + clientQueue:self.queue + completion:^(NSArray *> * _Nullable values, + NSError * _Nullable error) { + if (values) { + // Since the format is the same data-value dictionary, this looks like an attribute + // report + [self _handleAttributeReport:values]; + } + // TODO: retry on error + [workItem endWork]; + }]; + }]; + }; + workItem.readyHandler = readyHandler; + [_asyncCallbackWorkQueue enqueueWorkItem:workItem]; + + // Return current known / expected value right away + MTRAttributePath * attributePath = [MTRAttributePath attributePathWithEndpointId:endpointId + clusterId:clusterId + attributeId:attributeId]; + NSDictionary * attributeValueToReturn = [self _attributeValueDictionaryForAttributePath:attributePath]; + + return attributeValueToReturn; +} + +- (void)writeAttributeWithEndpointId:(NSNumber *)endpointId + clusterId:(NSNumber *)clusterId + attributeId:(NSNumber *)attributeId + value:(id)value + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + timedWriteTimeout:(NSNumber * _Nullable)timeoutMs +{ + // Start the asynchronous operation + [self connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + [baseDevice + writeAttributeWithEndpointId:endpointId + clusterId:clusterId + attributeId:attributeId + value:value + timedWriteTimeout:timeoutMs + clientQueue:self.queue + completion:^(NSArray *> * _Nullable values, NSError * _Nullable error) { + if (values) { + [self _handleAttributeReport:values]; + } + }]; + }]; + + // Commit change into expected value cache + MTRAttributePath * attributePath = [MTRAttributePath attributePathWithEndpointId:endpointId + clusterId:clusterId + attributeId:attributeId]; + NSDictionary * newExpectedValueDictionary = @{ MTRAttributePathKey : attributePath, MTRDataKey : value }; + + [self setExpectedValues:@[ newExpectedValueDictionary ] expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)invokeCommandWithEndpointId:(NSNumber *)endpointId + clusterId:(NSNumber *)clusterId + commandId:(NSNumber *)commandId + commandFields:(id)commandFields + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + timedInvokeTimeout:(NSNumber * _Nullable)timeoutMs + clientQueue:(dispatch_queue_t)clientQueue + completion:(MTRDeviceResponseHandler)completion +{ + // Perform this operation + [self connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + [baseDevice + invokeCommandWithEndpointId:endpointId + clusterId:clusterId + commandId:commandId + commandFields:commandFields + timedInvokeTimeout:timeoutMs + clientQueue:self.queue + completion:^(NSArray *> * _Nullable values, NSError * _Nullable error) { + dispatch_async(clientQueue, ^{ + completion(values, error); + }); + }]; + }]; + + [self setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +#pragma mark - Cache management + +// (assume lock is held) +- (void)_checkExpiredExpectedValues +{ +} + +// Get attribute value dictionary for an attribute path from the right cache +- (NSDictionary *)_attributeValueDictionaryForAttributePath:(MTRAttributePath *)attributePath +{ + os_unfair_lock_lock(&self->_lock); + // First check expected value cache + MTRPair * expectedValue = _expectedValueCache[attributePath]; + if (expectedValue) { + NSDate * now = [NSDate date]; + if ([now compare:expectedValue.first] == NSOrderedDescending) { + // expired - purge and fall through + _expectedValueCache[attributePath] = nil; + } else { + // not yet expired - return result + return expectedValue.second; + } + } + + // Then check read cache + NSDictionary * cachedAttributeValue = _readCache[attributePath]; + if (cachedAttributeValue) { + return cachedAttributeValue; + } else { + // TODO: when not found in cache, generated default values should be used + MTR_LOG_INFO( + "_attributeValueDictionaryForAttributePath: could not find cached attribute values for attribute %@", attributePath); + } + + return nil; +} + +- (BOOL)_attributeDataValue:(NSDictionary *)one isEqualToDataValue:(NSDictionary *)theOther +{ + // Attribute data-value dictionary should be all standard containers which + // means isEqual: comparisons all the way down, making a deep comparison. + return [one isEqualToDictionary:theOther]; +} + +- (NSArray *)_getAttributesToReportWithReportedValues:(NSArray *> *)reportedAttributeValues +{ + NSMutableArray * attributesToReport = [NSMutableArray array]; + + os_unfair_lock_lock(&self->_lock); + for (NSDictionary * attributeReponseValue in reportedAttributeValues) { + MTRAttributePath * attributePath = attributeReponseValue[MTRAttributePathKey]; + NSDictionary * attributeDataValue = attributeReponseValue[MTRDataKey]; + NSError * attributeError = attributeReponseValue[MTRErrorKey]; + + // sanity check either data value or error must exist + if (!attributeDataValue && attributeError) { + continue; + } + + // check if value is different than cache, and report if needed + BOOL shouldReportAttribute = NO; + + // if this is an error, report and purge cache + if (attributeError) { + shouldReportAttribute = YES; + _expectedValueCache[attributePath] = nil; + _readCache[attributePath] = nil; + } else { + // check write cache and purge if needed + MTRPair * expectedValue = _expectedValueCache[attributePath]; + if (expectedValue) { + if (![self _attributeDataValue:attributeDataValue isEqualToDataValue:expectedValue.second]) { + shouldReportAttribute = YES; + } + _expectedValueCache[attributePath] = nil; + } + + // then compare and update read cache + if (![self _attributeDataValue:attributeDataValue isEqualToDataValue:_readCache[attributePath]]) { + _readCache[attributePath] = attributeDataValue; + shouldReportAttribute = YES; + } + } + + if (shouldReportAttribute) { + [attributesToReport addObject:attributeReponseValue]; + } + } + os_unfair_lock_unlock(&self->_lock); + + return attributesToReport; +} + +- (NSArray *)_getAttributesToReportWithNewExpectedValues:(NSArray *> *)expectedAttributeValues + expirationTime:(NSDate *)expirationTime +{ + NSMutableArray * attributesToReport = [NSMutableArray array]; + + // First update cache + os_unfair_lock_lock(&self->_lock); + for (NSDictionary * attributeReponseValue in expectedAttributeValues) { + MTRAttributePath * attributePath = attributeReponseValue[MTRAttributePathKey]; + NSDictionary * attributeDataValue = attributeReponseValue[MTRDataKey]; + + // check if value is different than cache, and report if needed + BOOL shouldReportAttribute = NO; + + MTRPair * expectedValue = _expectedValueCache[attributePath]; + if (expectedValue) { + // first check write cache and purge / update + if (![self _attributeDataValue:attributeDataValue isEqualToDataValue:expectedValue.second]) { + shouldReportAttribute = YES; + } + _expectedValueCache[attributePath] = [MTRPair pairWithFirst:expirationTime second:expectedValue]; + } else { + // if new expected value then compare with read cache and report if needed + if (![self _attributeDataValue:attributeDataValue isEqualToDataValue:_readCache[attributePath]]) { + shouldReportAttribute = YES; + } + } + + if (shouldReportAttribute) { + [attributesToReport addObject:attributeReponseValue]; + } + } + os_unfair_lock_unlock(&self->_lock); + + return attributesToReport; +} + +- (void)setExpectedValues:(NSArray *> *)values + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + // since NSTimeInterval is in seconds, convert ms into seconds in double + NSTimeInterval expectedValueInterval = expectedValueIntervalMs.doubleValue / 1000; + NSDate * expirationTime = [NSDate dateWithTimeIntervalSinceNow:expectedValueInterval]; + + NSArray * attributesToReport = [self _getAttributesToReportWithNewExpectedValues:values expirationTime:expirationTime]; + + [self _reportAttributes:attributesToReport]; +} + +@end + +#pragma mark - SubscriptionCallback +namespace { +void SubscriptionCallback::OnReportBegin() +{ + mAttributeReports = [NSMutableArray new]; + mEventReports = [NSMutableArray new]; +} + +// Reports attribute and event data if any exists +void SubscriptionCallback::ReportData() +{ + __block NSArray * attributeReports = mAttributeReports; + mAttributeReports = nil; + __block NSArray * eventReports = mEventReports; + mEventReports = nil; + if (mAttributeReportCallback && attributeReports.count) { + dispatch_async(mQueue, ^{ + mAttributeReportCallback(attributeReports); + }); + } + if (mEventReportCallback && eventReports.count) { + dispatch_async(mQueue, ^{ + mEventReportCallback(eventReports); + }); + } +} + +void SubscriptionCallback::OnReportEnd() { ReportData(); } + +void SubscriptionCallback::OnEventData(const EventHeader & aEventHeader, TLV::TLVReader * apData, const StatusIB * apStatus) +{ + id _Nullable value = nil; + NSError * _Nullable error = nil; + if (apStatus != nullptr) { + error = [MTRError errorForIMStatus:*apStatus]; + } else if (apData == nullptr) { + error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INVALID_ARGUMENT]; + } else { + CHIP_ERROR err; + value = MTRDecodeEventPayload(aEventHeader.mPath, *apData, &err); + if (err == CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB) { + // We don't know this event; just skip it. + return; + } + + if (err != CHIP_NO_ERROR) { + value = nil; + error = [MTRError errorForCHIPErrorCode:err]; + } + } + + if (mEventReports == nil) { + // Never got a OnReportBegin? Not much to do other than tear things down. + ReportError(CHIP_ERROR_INCORRECT_STATE); + return; + } + + [mEventReports addObject:[[MTREventReport alloc] initWithPath:aEventHeader.mPath + eventNumber:@(aEventHeader.mEventNumber) + priority:@((uint8_t) aEventHeader.mPriorityLevel) + timestamp:@(aEventHeader.mTimestamp.mValue) + value:value + error:error]]; +} + +void SubscriptionCallback::OnAttributeData( + const ConcreteDataAttributePath & aPath, TLV::TLVReader * apData, const StatusIB & aStatus) +{ + if (aPath.IsListItemOperation()) { + ReportError(CHIP_ERROR_INCORRECT_STATE); + return; + } + + if (mAttributeReports == nil) { + // Never got a OnReportBegin? Not much to do other than tear things down. + ReportError(CHIP_ERROR_INCORRECT_STATE); + return; + } + + id _Nullable value = MTRDecodeDataValueDictionaryFromCHIPTLV(apData); + + if (value) { + [mAttributeReports addObject:@ { MTRAttributePathKey : [[MTRAttributePath alloc] initWithPath:aPath], MTRDataKey : value }]; + } +} + +void SubscriptionCallback::OnError(CHIP_ERROR aError) +{ + // If OnError is called after OnReportBegin, we should report the collected data + ReportData(); + ReportError([MTRError errorForCHIPErrorCode:aError]); +} + +void SubscriptionCallback::OnDone(ReadClient *) +{ + if (mOnDoneHandler) { + mOnDoneHandler(); + mOnDoneHandler = nil; + } + if (!mHaveQueuedDeletion) { + delete this; + return; // Make sure we touch nothing else. + } +} + +void SubscriptionCallback::OnDeallocatePaths(ReadPrepareParams && aReadPrepareParams) +{ + VerifyOrDie((aReadPrepareParams.mAttributePathParamsListSize == 0 && aReadPrepareParams.mpAttributePathParamsList == nullptr) + || (aReadPrepareParams.mAttributePathParamsListSize == 1 && aReadPrepareParams.mpAttributePathParamsList != nullptr)); + if (aReadPrepareParams.mpAttributePathParamsList) { + delete aReadPrepareParams.mpAttributePathParamsList; + } + + VerifyOrDie((aReadPrepareParams.mDataVersionFilterListSize == 0 && aReadPrepareParams.mpDataVersionFilterList == nullptr) + || (aReadPrepareParams.mDataVersionFilterListSize == 1 && aReadPrepareParams.mpDataVersionFilterList != nullptr)); + if (aReadPrepareParams.mpDataVersionFilterList != nullptr) { + delete aReadPrepareParams.mpDataVersionFilterList; + } + + VerifyOrDie((aReadPrepareParams.mEventPathParamsListSize == 0 && aReadPrepareParams.mpEventPathParamsList == nullptr) + || (aReadPrepareParams.mEventPathParamsListSize == 1 && aReadPrepareParams.mpEventPathParamsList != nullptr)); + if (aReadPrepareParams.mpEventPathParamsList) { + delete aReadPrepareParams.mpEventPathParamsList; + } +} + +void SubscriptionCallback::OnSubscriptionEstablished(SubscriptionId aSubscriptionId) +{ + if (mSubscriptionEstablishedHandler) { + dispatch_async(mQueue, mSubscriptionEstablishedHandler); + } +} + +void SubscriptionCallback::ReportError(CHIP_ERROR err) { ReportError([MTRError errorForCHIPErrorCode:err]); } + +void SubscriptionCallback::ReportError(const StatusIB & status) { ReportError([MTRError errorForIMStatus:status]); } + +void SubscriptionCallback::ReportError(NSError * _Nullable err) +{ + if (!err) { + // Very strange... Someone tried to create a MTRError for a success status? + return; + } + + if (mHaveQueuedDeletion) { + // Already have an error report pending which will delete us. + return; + } + + __block ErrorCallback callback = mErrorCallback; + __block auto * myself = this; + mErrorCallback = nil; + mAttributeReportCallback = nil; + mEventReportCallback = nil; + __auto_type onDoneHandler = mOnDoneHandler; + mOnDoneHandler = nil; + dispatch_async(mQueue, ^{ + callback(err); + if (onDoneHandler) { + onDoneHandler(); + } + + // Deletion of our ReadClient (and hence of ourselves, since the + // ReadClient has a pointer to us) needs to happen on the Matter work + // queue. + dispatch_async(DeviceLayer::PlatformMgrImpl().GetWorkQueue(), ^{ + delete myself; + }); + }); + + mHaveQueuedDeletion = true; +} +} // anonymous namespace diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index 0e5ca2c3f70293..0b7c0c36a92db2 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -14,6 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#import + #import "MTRDeviceController.h" #import "MTRBaseDevice_Internal.h" @@ -22,6 +24,7 @@ #import "MTRDeviceControllerStartupParams.h" #import "MTRDeviceControllerStartupParams_Internal.h" #import "MTRDevicePairingDelegateBridge.h" +#import "MTRDevice_Internal.h" #import "MTRError_Internal.h" #import "MTRKeypair.h" #import "MTRLogging.h" @@ -80,6 +83,8 @@ @interface MTRDeviceController () @property (readonly) MTRP256KeypairBridge operationalKeypairBridge; @property (readonly) MTRDeviceAttestationDelegateBridge * deviceAttestationDelegateBridge; @property (readonly) MTRControllerFactory * factory; +@property (readonly) NSMutableDictionary * deviceIDToDeviceMap; +@property (readonly) os_unfair_lock deviceMapLock; @end @implementation MTRDeviceController @@ -89,6 +94,8 @@ - (instancetype)initWithFactory:(MTRControllerFactory *)factory queue:(dispatch_ if (self = [super init]) { _chipWorkQueue = queue; _factory = factory; + _deviceMapLock = OS_UNFAIR_LOCK_INIT; + _deviceIDToDeviceMap = [NSMutableDictionary dictionary]; _pairingDelegateBridge = new MTRDevicePairingDelegateBridge(); if ([self checkForInitError:(_pairingDelegateBridge != nullptr) logMsg:kErrorPairingInit]) { @@ -531,6 +538,31 @@ - (BOOL)getBaseDevice:(uint64_t)deviceID }]; } +- (MTRDevice *)deviceForDeviceID:(uint64_t)deviceID +{ + os_unfair_lock_lock(&_deviceMapLock); + MTRDevice * deviceToReturn = self.deviceIDToDeviceMap[@(deviceID)]; + if (deviceToReturn) { + deviceToReturn = [[MTRDevice alloc] initWithDeviceID:deviceID deviceController:self queue:self.chipWorkQueue]; + self.deviceIDToDeviceMap[@(deviceID)] = deviceToReturn; + } + os_unfair_lock_unlock(&_deviceMapLock); + + return deviceToReturn; +} + +- (void)removeDevice:(MTRDevice *)device +{ + os_unfair_lock_lock(&_deviceMapLock); + MTRDevice * deviceToRemove = self.deviceIDToDeviceMap[@(device.deviceID)]; + if (deviceToRemove == device) { + self.deviceIDToDeviceMap[@(device.deviceID)] = nil; + } else { + MTR_LOG_ERROR("Error: Cannot remove device %p with deviceID %llu", device, device.deviceID); + } + os_unfair_lock_unlock(&_deviceMapLock); +} + - (BOOL)openPairingWindow:(uint64_t)deviceID duration:(NSUInteger)duration error:(NSError * __autoreleasing *)error { VerifyOrReturnValue([self checkIsRunning:error], NO); diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h index 9a2067c345372d..d19923bc97864d 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h @@ -27,8 +27,12 @@ #include #include +#import "MTRBaseDevice.h" +#import "MTRDeviceController.h" + @class MTRDeviceControllerStartupParamsInternal; @class MTRControllerFactory; +@class MTRDevice; namespace chip { class FabricTable; @@ -38,6 +42,8 @@ NS_ASSUME_NONNULL_BEGIN @interface MTRDeviceController (InternalMethods) +#pragma mark - MTRControllerFactory methods + /** * Start a new controller. Returns whether startup succeeded. If this fails, * it guarantees that it has called controllerShuttingDown on the @@ -108,6 +114,11 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)invalidateCASESessionForNode:(chip::NodeId)nodeID; +#pragma mark - Device-specific data and SDK access +// DeviceController will act as a central repository for this opaque dictionary that MTRDevice manages +- (MTRDevice *)deviceForDeviceID:(uint64_t)deviceID; +- (void)removeDevice:(MTRDevice *)device; + @end NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTRDevice_Internal.h b/src/darwin/Framework/CHIP/MTRDevice_Internal.h new file mode 100644 index 00000000000000..5eab8157dbe428 --- /dev/null +++ b/src/darwin/Framework/CHIP/MTRDevice_Internal.h @@ -0,0 +1,46 @@ +/** + * + * 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. + */ + +#import + +#import "MTRBaseDevice.h" +#import "MTRDevice.h" + +#include + +NS_ASSUME_NONNULL_BEGIN + +typedef void (^MTRDevicePerformAsyncBlock)(MTRBaseDevice * baseDevice); + +@interface MTRDevice () +- (instancetype)initWithDeviceID:(uint64_t)deviceID + deviceController:(MTRDeviceController *)deviceController + queue:(dispatch_queue_t)queue; + +// Called to run commands with a live underlying connection +- (void)connectAndPerformAsync:(MTRDevicePerformAsyncBlock)asyncBlock; + +// Called from MTRClusters for writes and commands +- (void)setExpectedValues:(NSArray *> *)values + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; + +@property (nonatomic, readonly, strong, nonnull) MTRDeviceController * deviceController; +@property (nonatomic, readonly) uint64_t deviceID; + +@end + +NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/Matter.h b/src/darwin/Framework/CHIP/Matter.h index cabba655deaa11..9c5af0634a904f 100644 --- a/src/darwin/Framework/CHIP/Matter.h +++ b/src/darwin/Framework/CHIP/Matter.h @@ -17,15 +17,18 @@ #import +#import #import #import #import #import #import #import +#import #import #import #import +#import #import #import #import diff --git a/src/darwin/Framework/CHIP/templates/MTRBaseClusters-src.zapt b/src/darwin/Framework/CHIP/templates/MTRBaseClusters-src.zapt index ac5eb9d6ad333e..ee76625b6b4271 100644 --- a/src/darwin/Framework/CHIP/templates/MTRBaseClusters-src.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRBaseClusters-src.zapt @@ -49,7 +49,7 @@ using chip::SessionHandle; - (void){{asLowerCamelCase name}}WithParams: (MTR{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Params * {{#unless (commandHasRequiredField .)}}_Nullable{{/unless}})params completionHandler:({{>command_completion_type command=.}})completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTR{{>callbackName}}CallbackBridge(self.callbackQueue, self.device, {{#if hasSpecificResponse}} @@ -112,7 +112,7 @@ using chip::SessionHandle; { {{~#if_is_fabric_scoped_struct type}} // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; {{/if_is_fabric_scoped_struct~}} new MTR{{>attribute_data_callback_name}}CallbackBridge(self.callbackQueue, self.device, @@ -141,7 +141,7 @@ using chip::SessionHandle; - (void)write{{>attribute}}WithValue:({{asObjectiveCType type parent.name}})value params:(MTRWriteParams * _Nullable)params completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTR{{>callbackName}}CallbackBridge(self.callbackQueue, @@ -187,7 +187,7 @@ subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEs // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTR{{>attribute_data_callback_name}}CallbackSubscriptionBridge(self.callbackQueue, self.device, {{! This treats reportHandler as taking an id for the data. This is diff --git a/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt b/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt index 98adfc639f4bf0..335cb2c1c4b14d 100644 --- a/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt @@ -7,10 +7,6 @@ #import #import -typedef void (^ResponseHandler)(id _Nullable value, NSError * _Nullable error); -typedef void (^StatusCompletion)(NSError * _Nullable error); -typedef void (^SubscriptionEstablishedHandler)(void); - NS_ASSUME_NONNULL_BEGIN {{#chip_client_clusters includeAll=true}} diff --git a/src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt b/src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt new file mode 100644 index 00000000000000..ac7a789ac6441e --- /dev/null +++ b/src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt @@ -0,0 +1,140 @@ +{{> header}} + +#import + +#import "MTRAttributeCacheContainer_Internal.h" +#import "MTRBaseDevice_internal.h" +#import "MTRClusterConstants.h" +#import "MTRClusters_internal.h" +#import "MTRDevice.h" +#import "MTRDevice_Internal.h" +#import "MTRCallbackBridge_internal.h" +#import "MTRCluster_internal.h" +#import "MTRStructsObjc.h" +#import "MTRCommandPayloadsObjc.h" + +#include +#include +#include + +using chip::Callback::Callback; +using chip::Callback::Cancelable; +using namespace chip::app::Clusters; +using chip::Messaging::ExchangeManager; +using chip::SessionHandle; + +// NOLINTBEGIN(clang-analyzer-cplusplus.NewDeleteLeaks): Linter is unable to locate the delete on these objects. +{{#chip_client_clusters includeAll=true}} +@implementation MTRCluster{{asUpperCamelCase name}} + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +{{#chip_cluster_commands}} +{{#*inline "callbackName"}}{{#if hasSpecificResponse}}{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase responseName}}{{else}}CommandSuccess{{/if}}{{/inline}} +{{#unless (hasArguments)}} +- (void){{asLowerCamelCase name}}WithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completionHandler:({{>command_completion_type command=.}})completionHandler +{ + [self {{asLowerCamelCase name}}WithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completionHandler:completionHandler]; +} +{{/unless}} +- (void){{asLowerCamelCase name}}WithParams: (MTR{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Params * {{#unless (commandHasRequiredField .)}}_Nullable{{/unless}})params expectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completionHandler:({{>command_completion_type command=.}})completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTR{{>callbackName}}CallbackBridge(self.callbackQueue, + baseDevice, + {{#if hasSpecificResponse}} + {{! This treats completionHandler as taking an id for the data. This is + not great from a type-safety perspective, of course. }} + completionHandler, + {{else}} + {{! For now, don't change the bridge API; instead just use an adapter + to invoke our completion handler. This is not great from a + type-safety perspective, of course. }} + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + {{/if}} + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + {{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + {{#if mustUseTimedInvoke}} + if (!timedInvokeTimeoutMs.HasValue()) { + timedInvokeTimeoutMs.SetValue(10000); + } + {{/if}} + {{#chip_cluster_command_arguments}} + {{#first}} + {{#unless (commandHasRequiredField parent)}} + if (params != nil) { + {{/unless}} + {{/first}} + {{>encode_value target=(concat "request." (asLowerCamelCase label)) source=(concat "params." (asStructPropertyName label)) cluster=parent.parent.name errorCode="return CHIP_ERROR_INVALID_ARGUMENT;" depth=0}} + {{#last}} + {{#unless (commandHasRequiredField parent)}} + } + {{/unless}} + {{/last}} + {{/chip_cluster_command_arguments}} + + auto successFn = Callback<{{>callbackName}}CallbackType>::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::{{asUpperCamelCase parent.name}}Cluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} +{{/chip_cluster_commands}} + +{{#chip_server_cluster_attributes}} +{{#*inline "attribute"}}Attribute{{asUpperCamelCase name}}{{/inline}} +- (NSDictionary *)read{{>attribute}}WithParams:(MTRReadParams * _Nullable)params { + return [self.device readAttributeWithEndpointId:@(_endpoint) clusterId:@(MTRCluster{{asUpperCamelCase parent.name}}ID) attributeId:@(MTRCluster{{asUpperCamelCase parent.name}}Attribute{{asUpperCamelCase name}}ID) params:params]; +} + +{{#if isWritableAttribute}} +{{#*inline "callbackName"}}DefaultSuccess{{/inline}} +- (void)write{{>attribute}}WithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self write{{>attribute}}WithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)write{{>attribute}}WithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber *waitTimeInMs = params.timedWriteTimeout; + {{#if mustUseTimedInvoke}} + if (!waitTimeInMs) { + waitTimeInMs = @(10000); + } + {{/if}} + + [self.device writeAttributeWithEndpointId:@(_endpoint) clusterId:@(MTRCluster{{asUpperCamelCase parent.name}}ID) attributeId:@(MTRCluster{{asUpperCamelCase parent.name}}Attribute{{asUpperCamelCase name}}ID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:waitTimeInMs]; +} + +{{/if}} + +{{/chip_server_cluster_attributes}} + +@end + +{{/chip_client_clusters}} +// NOLINTEND(clang-analyzer-cplusplus.NewDeleteLeaks) diff --git a/src/darwin/Framework/CHIP/templates/MTRClusters.zapt b/src/darwin/Framework/CHIP/templates/MTRClusters.zapt new file mode 100644 index 00000000000000..9bd1fad459ae2d --- /dev/null +++ b/src/darwin/Framework/CHIP/templates/MTRClusters.zapt @@ -0,0 +1,50 @@ +{{> header}} + +#import + +#import + +#import +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +{{#chip_client_clusters includeAll=true}} + + +/** + * Cluster {{name}} + * {{description}} + */ +@interface MTRCluster{{asUpperCamelCase name}} : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +{{#chip_cluster_commands}} +- (void){{asLowerCamelCase name}}WithParams:(MTR{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Params * {{#unless (commandHasRequiredField .)}}_Nullable{{/unless}})params expectedValues:(NSArray *> *)expectedDataValueDictionaries expectedValueInterval:(NSNumber *)expectedValueIntervalMs completionHandler:({{>command_completion_type command=.}})completionHandler; +{{#unless (hasArguments)}} +- (void){{asLowerCamelCase name}}WithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completionHandler:({{>command_completion_type command=.}})completionHandler; +{{/unless}} +{{/chip_cluster_commands}} + +{{#chip_server_cluster_attributes}} +{{#*inline "attribute"}}Attribute{{asUpperCamelCase name}}{{/inline}} +- (NSDictionary *)read{{>attribute}}WithParams:(MTRReadParams * _Nullable)params; +{{#if isWritableAttribute}} +- (void)write{{>attribute}}WithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)write{{>attribute}}WithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params; +{{/if}} +{{/chip_server_cluster_attributes}} + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +{{/chip_client_clusters}} + +NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/templates/MTRClusters_internal.zapt b/src/darwin/Framework/CHIP/templates/MTRClusters_internal.zapt new file mode 100644 index 00000000000000..9ab103ba73c690 --- /dev/null +++ b/src/darwin/Framework/CHIP/templates/MTRClusters_internal.zapt @@ -0,0 +1,19 @@ +{{> header}} + +#import +#import + +#import "MTRClusters.h" +#import "MTRDevice.h" +#import "MTRDevice_Internal.h" + +#include + +{{#chip_client_clusters includeAll=true}} + +@interface MTRCluster{{asUpperCamelCase name}} () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice *device; +@end + +{{/chip_client_clusters}} diff --git a/src/darwin/Framework/CHIP/templates/templates.json b/src/darwin/Framework/CHIP/templates/templates.json index 3939322c5601b3..f91c8c3815bca8 100644 --- a/src/darwin/Framework/CHIP/templates/templates.json +++ b/src/darwin/Framework/CHIP/templates/templates.json @@ -54,19 +54,34 @@ }, { "path": "MTRBaseClusters_internal.zapt", - "name": "Objc ZCL API Internal Header", + "name": "Objc ZCL asynchronous API Internal Header", "output": "src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_internal.h" }, { "path": "MTRBaseClusters.zapt", - "name": "Objc ZCL API Header", + "name": "Objc ZCL asynchronous API Header", "output": "src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h" }, { "path": "MTRBaseClusters-src.zapt", - "name": "Objc ZCL API", + "name": "Objc ZCL asynchronous API", "output": "src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm" }, + { + "path": "MTRClusters_internal.zapt", + "name": "Objc ZCL synchronous API Internal Header", + "output": "src/darwin/Framework/CHIP/zap-generated/MTRClusters_internal.h" + }, + { + "path": "MTRClusters.zapt", + "name": "Objc ZCL synchronous API Header", + "output": "src/darwin/Framework/CHIP/zap-generated/MTRClusters.h" + }, + { + "path": "MTRClusters-src.zapt", + "name": "Objc ZCL synchronous API", + "output": "src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm" + }, { "path": "MTRStructsObjc.zapt", "name": "Objc reflections of MTR spec structs header", diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index ed0d190d771cbc..710eaa153baa60 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -24,10 +24,6 @@ #import #import -typedef void (^ResponseHandler)(id _Nullable value, NSError * _Nullable error); -typedef void (^StatusCompletion)(NSError * _Nullable error); -typedef void (^SubscriptionEstablishedHandler)(void); - NS_ASSUME_NONNULL_BEGIN /** diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index ae40e6755a0348..fc64b9b99876e9 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -57,7 +57,7 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoi - (void)identifyWithParams:(MTRIdentifyClusterIdentifyParams *)params completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -85,7 +85,7 @@ - (void)triggerEffectWithParams:(MTRIdentifyClusterTriggerEffectParams *)params completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -134,7 +134,7 @@ - (void)writeAttributeIdentifyTimeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -172,7 +172,7 @@ - (void)subscribeAttributeIdentifyTimeWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -241,7 +241,7 @@ - (void)subscribeAttributeIdentifyTypeWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -312,7 +312,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRIdentifyGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -384,7 +384,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRIdentifyAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -454,7 +454,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRIdentifyAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -524,7 +524,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -593,7 +593,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -662,7 +662,7 @@ - (void)addGroupWithParams:(MTRGroupsClusterAddGroupParams *)params (void (^)(MTRGroupsClusterAddGroupResponseParams * _Nullable data, NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRGroupsClusterAddGroupResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -688,7 +688,7 @@ - (void)viewGroupWithParams:(MTRGroupsClusterViewGroupParams *)params (void (^)(MTRGroupsClusterViewGroupResponseParams * _Nullable data, NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRGroupsClusterViewGroupResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -713,7 +713,7 @@ - (void)getGroupMembershipWithParams:(MTRGroupsClusterGetGroupMembershipParams * NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRGroupsClusterGetGroupMembershipResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -759,7 +759,7 @@ - (void)removeGroupWithParams:(MTRGroupsClusterRemoveGroupParams *)params (void (^)(MTRGroupsClusterRemoveGroupResponseParams * _Nullable data, NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRGroupsClusterRemoveGroupResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -787,7 +787,7 @@ - (void)removeAllGroupsWithParams:(MTRGroupsClusterRemoveAllGroupsParams * _Null completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -814,7 +814,7 @@ - (void)addGroupIfIdentifyingWithParams:(MTRGroupsClusterAddGroupIfIdentifyingPa completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -861,7 +861,7 @@ - (void)subscribeAttributeNameSupportWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -932,7 +932,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRGroupsGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -1004,7 +1004,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRGroupsAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -1074,7 +1074,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRGroupsAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -1143,7 +1143,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -1212,7 +1212,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -1281,7 +1281,7 @@ - (void)addSceneWithParams:(MTRScenesClusterAddSceneParams *)params (void (^)(MTRScenesClusterAddSceneResponseParams * _Nullable data, NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRScenesClusterAddSceneResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -1382,7 +1382,7 @@ - (void)viewSceneWithParams:(MTRScenesClusterViewSceneParams *)params (void (^)(MTRScenesClusterViewSceneResponseParams * _Nullable data, NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRScenesClusterViewSceneResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -1408,7 +1408,7 @@ - (void)removeSceneWithParams:(MTRScenesClusterRemoveSceneParams *)params (void (^)(MTRScenesClusterRemoveSceneResponseParams * _Nullable data, NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRScenesClusterRemoveSceneResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -1434,7 +1434,7 @@ - (void)removeAllScenesWithParams:(MTRScenesClusterRemoveAllScenesParams *)param NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRScenesClusterRemoveAllScenesResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -1459,7 +1459,7 @@ - (void)storeSceneWithParams:(MTRScenesClusterStoreSceneParams *)params (void (^)(MTRScenesClusterStoreSceneResponseParams * _Nullable data, NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRScenesClusterStoreSceneResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -1483,7 +1483,7 @@ new MTRScenesClusterStoreSceneResponseCallbackBridge(self.callbackQueue, self.de - (void)recallSceneWithParams:(MTRScenesClusterRecallSceneParams *)params completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -1522,7 +1522,7 @@ - (void)getSceneMembershipWithParams:(MTRScenesClusterGetSceneMembershipParams * NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRScenesClusterGetSceneMembershipResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -1547,7 +1547,7 @@ - (void)enhancedAddSceneWithParams:(MTRScenesClusterEnhancedAddSceneParams *)par NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRScenesClusterEnhancedAddSceneResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -1648,7 +1648,7 @@ - (void)enhancedViewSceneWithParams:(MTRScenesClusterEnhancedViewSceneParams *)p NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRScenesClusterEnhancedViewSceneResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -1674,7 +1674,7 @@ - (void)copySceneWithParams:(MTRScenesClusterCopySceneParams *)params (void (^)(MTRScenesClusterCopySceneResponseParams * _Nullable data, NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRScenesClusterCopySceneResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -1720,7 +1720,7 @@ - (void)subscribeAttributeSceneCountWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -1788,7 +1788,7 @@ - (void)subscribeAttributeCurrentSceneWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -1857,7 +1857,7 @@ - (void)subscribeAttributeCurrentGroupWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -1926,7 +1926,7 @@ - (void)subscribeAttributeSceneValidWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBooleanAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -1994,7 +1994,7 @@ - (void)subscribeAttributeNameSupportWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -2064,7 +2064,7 @@ - (void)subscribeAttributeLastConfiguredByWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt64uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -2135,7 +2135,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRScenesGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -2207,7 +2207,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRScenesAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -2277,7 +2277,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRScenesAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -2346,7 +2346,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -2415,7 +2415,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -2486,7 +2486,7 @@ - (void)offWithCompletionHandler:(StatusCompletion)completionHandler - (void)offWithParams:(MTROnOffClusterOffParams * _Nullable)params completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -2516,7 +2516,7 @@ - (void)onWithCompletionHandler:(StatusCompletion)completionHandler - (void)onWithParams:(MTROnOffClusterOnParams * _Nullable)params completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -2546,7 +2546,7 @@ - (void)toggleWithCompletionHandler:(StatusCompletion)completionHandler - (void)toggleWithParams:(MTROnOffClusterToggleParams * _Nullable)params completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -2572,7 +2572,7 @@ new MTRCommandSuccessCallbackBridge( - (void)offWithEffectWithParams:(MTROnOffClusterOffWithEffectParams *)params completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -2606,7 +2606,7 @@ - (void)onWithRecallGlobalSceneWithParams:(MTROnOffClusterOnWithRecallGlobalScen completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -2632,7 +2632,7 @@ new MTRCommandSuccessCallbackBridge( - (void)onWithTimedOffWithParams:(MTROnOffClusterOnWithTimedOffParams *)params completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -2680,7 +2680,7 @@ - (void)subscribeAttributeOnOffWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBooleanAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -2749,7 +2749,7 @@ - (void)subscribeAttributeGlobalSceneControlWithMinInterval:(NSNumber * _Nonnull // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBooleanAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -2817,7 +2817,7 @@ - (void)writeAttributeOnTimeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -2855,7 +2855,7 @@ - (void)subscribeAttributeOnTimeWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -2923,7 +2923,7 @@ - (void)writeAttributeOffWaitTimeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -2961,7 +2961,7 @@ - (void)subscribeAttributeOffWaitTimeWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -3030,7 +3030,7 @@ - (void)writeAttributeStartUpOnOffWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -3073,7 +3073,7 @@ - (void)subscribeAttributeStartUpOnOffWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableOnOffClusterOnOffStartUpOnOffAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -3145,7 +3145,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROnOffGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -3217,7 +3217,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROnOffAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -3287,7 +3287,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROnOffAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -3356,7 +3356,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -3425,7 +3425,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -3511,7 +3511,7 @@ - (void)subscribeAttributeSwitchTypeWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -3579,7 +3579,7 @@ - (void)writeAttributeSwitchActionsWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -3618,7 +3618,7 @@ - (void)subscribeAttributeSwitchActionsWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -3690,7 +3690,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROnOffSwitchConfigurationGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -3764,7 +3764,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROnOffSwitchConfigurationAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -3835,7 +3835,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROnOffSwitchConfigurationAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -3905,7 +3905,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -3974,7 +3974,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -4042,7 +4042,7 @@ - (void)moveToLevelWithParams:(MTRLevelControlClusterMoveToLevelParams *)params completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -4072,7 +4072,7 @@ new MTRCommandSuccessCallbackBridge( - (void)moveWithParams:(MTRLevelControlClusterMoveParams *)params completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -4102,7 +4102,7 @@ new MTRCommandSuccessCallbackBridge( - (void)stepWithParams:(MTRLevelControlClusterStepParams *)params completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -4133,7 +4133,7 @@ new MTRCommandSuccessCallbackBridge( - (void)stopWithParams:(MTRLevelControlClusterStopParams *)params completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -4162,7 +4162,7 @@ - (void)moveToLevelWithOnOffWithParams:(MTRLevelControlClusterMoveToLevelWithOnO completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -4193,7 +4193,7 @@ - (void)moveWithOnOffWithParams:(MTRLevelControlClusterMoveWithOnOffParams *)par completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -4224,7 +4224,7 @@ - (void)stepWithOnOffWithParams:(MTRLevelControlClusterStepWithOnOffParams *)par completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -4256,7 +4256,7 @@ - (void)stopWithOnOffWithParams:(MTRLevelControlClusterStopWithOnOffParams *)par completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -4285,7 +4285,7 @@ - (void)moveToClosestFrequencyWithParams:(MTRLevelControlClusterMoveToClosestFre completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -4331,7 +4331,7 @@ - (void)subscribeAttributeCurrentLevelWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -4401,7 +4401,7 @@ - (void)subscribeAttributeRemainingTimeWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -4470,7 +4470,7 @@ - (void)subscribeAttributeMinLevelWithMinInterval:(NSNumber * _Nonnull)minInterv // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -4538,7 +4538,7 @@ - (void)subscribeAttributeMaxLevelWithMinInterval:(NSNumber * _Nonnull)minInterv // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -4607,7 +4607,7 @@ - (void)subscribeAttributeCurrentFrequencyWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -4676,7 +4676,7 @@ - (void)subscribeAttributeMinFrequencyWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -4745,7 +4745,7 @@ - (void)subscribeAttributeMaxFrequencyWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -4813,7 +4813,7 @@ - (void)writeAttributeOptionsWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -4851,7 +4851,7 @@ - (void)subscribeAttributeOptionsWithMinInterval:(NSNumber * _Nonnull)minInterva // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -4919,7 +4919,7 @@ - (void)writeAttributeOnOffTransitionTimeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -4959,7 +4959,7 @@ - (void)subscribeAttributeOnOffTransitionTimeWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -5027,7 +5027,7 @@ - (void)writeAttributeOnLevelWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -5070,7 +5070,7 @@ - (void)subscribeAttributeOnLevelWithMinInterval:(NSNumber * _Nonnull)minInterva // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -5138,7 +5138,7 @@ - (void)writeAttributeOnTransitionTimeWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -5182,7 +5182,7 @@ - (void)subscribeAttributeOnTransitionTimeWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -5251,7 +5251,7 @@ - (void)writeAttributeOffTransitionTimeWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -5295,7 +5295,7 @@ - (void)subscribeAttributeOffTransitionTimeWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -5364,7 +5364,7 @@ - (void)writeAttributeDefaultMoveRateWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -5408,7 +5408,7 @@ - (void)subscribeAttributeDefaultMoveRateWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -5477,7 +5477,7 @@ - (void)writeAttributeStartUpCurrentLevelWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -5522,7 +5522,7 @@ - (void)subscribeAttributeStartUpCurrentLevelWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -5593,7 +5593,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRLevelControlGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -5665,7 +5665,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRLevelControlAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -5735,7 +5735,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRLevelControlAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -5805,7 +5805,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -5874,7 +5874,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -5960,7 +5960,7 @@ - (void)writeAttributeActiveTextWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -5998,7 +5998,7 @@ - (void)subscribeAttributeActiveTextWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -6066,7 +6066,7 @@ - (void)writeAttributeDescriptionWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -6104,7 +6104,7 @@ - (void)subscribeAttributeDescriptionWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -6173,7 +6173,7 @@ - (void)writeAttributeInactiveTextWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -6211,7 +6211,7 @@ - (void)subscribeAttributeInactiveTextWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -6280,7 +6280,7 @@ - (void)writeAttributeOutOfServiceWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -6318,7 +6318,7 @@ - (void)subscribeAttributeOutOfServiceWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBooleanAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -6387,7 +6387,7 @@ - (void)subscribeAttributePolarityWithMinInterval:(NSNumber * _Nonnull)minInterv // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -6455,7 +6455,7 @@ - (void)writeAttributePresentValueWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -6493,7 +6493,7 @@ - (void)subscribeAttributePresentValueWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBooleanAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -6562,7 +6562,7 @@ - (void)writeAttributeReliabilityWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -6600,7 +6600,7 @@ - (void)subscribeAttributeReliabilityWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -6669,7 +6669,7 @@ - (void)subscribeAttributeStatusFlagsWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -6739,7 +6739,7 @@ - (void)subscribeAttributeApplicationTypeWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -6810,7 +6810,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBinaryInputBasicGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -6882,7 +6882,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBinaryInputBasicAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -6952,7 +6952,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBinaryInputBasicAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -7022,7 +7022,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -7091,7 +7091,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -7177,7 +7177,7 @@ - (void)subscribeAttributeDeviceListWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRDescriptorDeviceListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -7245,7 +7245,7 @@ - (void)subscribeAttributeServerListWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRDescriptorServerListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -7313,7 +7313,7 @@ - (void)subscribeAttributeClientListWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRDescriptorClientListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -7381,7 +7381,7 @@ - (void)subscribeAttributePartsListWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRDescriptorPartsListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -7451,7 +7451,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRDescriptorGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -7523,7 +7523,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRDescriptorAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -7593,7 +7593,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRDescriptorAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -7663,7 +7663,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -7732,7 +7732,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -7799,7 +7799,7 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoi - (void)readAttributeBindingWithParams:(MTRReadParams * _Nullable)params completionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBindingBindingListAttributeCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { using TypeInfo = Binding::Attributes::Binding::TypeInfo; @@ -7820,7 +7820,7 @@ - (void)writeAttributeBindingWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -7895,7 +7895,7 @@ - (void)subscribeAttributeBindingWithMinInterval:(NSNumber * _Nonnull)minInterva // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBindingBindingListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -7965,7 +7965,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBindingGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -8037,7 +8037,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBindingAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -8107,7 +8107,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBindingAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -8176,7 +8176,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -8245,7 +8245,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -8312,7 +8312,7 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoi - (void)readAttributeAclWithParams:(MTRReadParams * _Nullable)params completionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRAccessControlAclListAttributeCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { using TypeInfo = AccessControl::Attributes::Acl::TypeInfo; @@ -8333,7 +8333,7 @@ - (void)writeAttributeAclWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -8469,7 +8469,7 @@ - (void)subscribeAttributeAclWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRAccessControlAclListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -8518,7 +8518,7 @@ new MTRAccessControlAclListAttributeCallbackBridge(queue, completionHandler, ^(C - (void)readAttributeExtensionWithParams:(MTRReadParams * _Nullable)params completionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRAccessControlExtensionListAttributeCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { using TypeInfo = AccessControl::Attributes::Extension::TypeInfo; @@ -8539,7 +8539,7 @@ - (void)writeAttributeExtensionWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -8599,7 +8599,7 @@ - (void)subscribeAttributeExtensionWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRAccessControlExtensionListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -8670,7 +8670,7 @@ - (void)subscribeAttributeSubjectsPerAccessControlEntryWithMinInterval:(NSNumber // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -8741,7 +8741,7 @@ - (void)subscribeAttributeTargetsPerAccessControlEntryWithMinInterval:(NSNumber // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -8812,7 +8812,7 @@ - (void)subscribeAttributeAccessControlEntriesPerFabricWithMinInterval:(NSNumber // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -8883,7 +8883,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRAccessControlGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -8955,7 +8955,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRAccessControlAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -9025,7 +9025,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRAccessControlAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -9095,7 +9095,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -9164,7 +9164,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -9232,7 +9232,7 @@ - (void)instantActionWithParams:(MTRBridgedActionsClusterInstantActionParams *)p completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -9264,7 +9264,7 @@ - (void)instantActionWithTransitionWithParams:(MTRBridgedActionsClusterInstantAc completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -9297,7 +9297,7 @@ - (void)startActionWithParams:(MTRBridgedActionsClusterStartActionParams *)param completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -9329,7 +9329,7 @@ - (void)startActionWithDurationWithParams:(MTRBridgedActionsClusterStartActionWi completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -9362,7 +9362,7 @@ - (void)stopActionWithParams:(MTRBridgedActionsClusterStopActionParams *)params completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -9394,7 +9394,7 @@ - (void)pauseActionWithParams:(MTRBridgedActionsClusterPauseActionParams *)param completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -9426,7 +9426,7 @@ - (void)pauseActionWithDurationWithParams:(MTRBridgedActionsClusterPauseActionWi completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -9459,7 +9459,7 @@ - (void)resumeActionWithParams:(MTRBridgedActionsClusterResumeActionParams *)par completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -9491,7 +9491,7 @@ - (void)enableActionWithParams:(MTRBridgedActionsClusterEnableActionParams *)par completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -9523,7 +9523,7 @@ - (void)enableActionWithDurationWithParams:(MTRBridgedActionsClusterEnableAction completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -9556,7 +9556,7 @@ - (void)disableActionWithParams:(MTRBridgedActionsClusterDisableActionParams *)p completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -9588,7 +9588,7 @@ - (void)disableActionWithDurationWithParams:(MTRBridgedActionsClusterDisableActi completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -9639,7 +9639,7 @@ - (void)subscribeAttributeActionListWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBridgedActionsActionListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -9708,7 +9708,7 @@ - (void)subscribeAttributeEndpointListWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBridgedActionsEndpointListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -9778,7 +9778,7 @@ - (void)subscribeAttributeSetupUrlWithMinInterval:(NSNumber * _Nonnull)minInterv // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -9848,7 +9848,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBridgedActionsGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -9920,7 +9920,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBridgedActionsAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -9990,7 +9990,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBridgedActionsAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -10060,7 +10060,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -10129,7 +10129,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -10201,7 +10201,7 @@ - (void)mfgSpecificPingWithParams:(MTRBasicClusterMfgSpecificPingParams * _Nulla completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -10247,7 +10247,7 @@ - (void)subscribeAttributeDataModelRevisionWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -10316,7 +10316,7 @@ - (void)subscribeAttributeVendorNameWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -10384,7 +10384,7 @@ - (void)subscribeAttributeVendorIDWithMinInterval:(NSNumber * _Nonnull)minInterv // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRVendorIdAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -10452,7 +10452,7 @@ - (void)subscribeAttributeProductNameWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -10521,7 +10521,7 @@ - (void)subscribeAttributeProductIDWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -10589,7 +10589,7 @@ - (void)writeAttributeNodeLabelWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -10627,7 +10627,7 @@ - (void)subscribeAttributeNodeLabelWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -10695,7 +10695,7 @@ - (void)writeAttributeLocationWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -10733,7 +10733,7 @@ - (void)subscribeAttributeLocationWithMinInterval:(NSNumber * _Nonnull)minInterv // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -10802,7 +10802,7 @@ - (void)subscribeAttributeHardwareVersionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -10873,7 +10873,7 @@ - (void)subscribeAttributeHardwareVersionStringWithMinInterval:(NSNumber * _Nonn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -10943,7 +10943,7 @@ - (void)subscribeAttributeSoftwareVersionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -11014,7 +11014,7 @@ - (void)subscribeAttributeSoftwareVersionStringWithMinInterval:(NSNumber * _Nonn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -11084,7 +11084,7 @@ - (void)subscribeAttributeManufacturingDateWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -11153,7 +11153,7 @@ - (void)subscribeAttributePartNumberWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -11221,7 +11221,7 @@ - (void)subscribeAttributeProductURLWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -11289,7 +11289,7 @@ - (void)subscribeAttributeProductLabelWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -11358,7 +11358,7 @@ - (void)subscribeAttributeSerialNumberWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -11427,7 +11427,7 @@ - (void)writeAttributeLocalConfigDisabledWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -11467,7 +11467,7 @@ - (void)subscribeAttributeLocalConfigDisabledWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBooleanAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -11536,7 +11536,7 @@ - (void)subscribeAttributeReachableWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBooleanAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -11604,7 +11604,7 @@ - (void)subscribeAttributeUniqueIDWithMinInterval:(NSNumber * _Nonnull)minInterv // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -11673,7 +11673,7 @@ - (void)subscribeAttributeCapabilityMinimaWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBasicCapabilityMinimaStructAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -11745,7 +11745,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBasicGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -11817,7 +11817,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBasicAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -11887,7 +11887,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBasicAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -11956,7 +11956,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -12025,7 +12025,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -12094,7 +12094,7 @@ - (void)queryImageWithParams:(MTROtaSoftwareUpdateProviderClusterQueryImageParam NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROtaSoftwareUpdateProviderClusterQueryImageResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -12160,7 +12160,7 @@ - (void)applyUpdateRequestWithParams:(MTROtaSoftwareUpdateProviderClusterApplyUp NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROtaSoftwareUpdateProviderClusterApplyUpdateResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -12185,7 +12185,7 @@ - (void)notifyUpdateAppliedWithParams:(MTROtaSoftwareUpdateProviderClusterNotify completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -12235,7 +12235,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROtaSoftwareUpdateProviderGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -12309,7 +12309,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROtaSoftwareUpdateProviderAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -12380,7 +12380,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROtaSoftwareUpdateProviderAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -12450,7 +12450,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -12519,7 +12519,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -12587,7 +12587,7 @@ - (void)announceOtaProviderWithParams:(MTROtaSoftwareUpdateRequestorClusterAnnou completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -12622,7 +12622,7 @@ new MTRCommandSuccessCallbackBridge( - (void)readAttributeDefaultOtaProvidersWithParams:(MTRReadParams * _Nullable)params completionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROtaSoftwareUpdateRequestorDefaultOtaProvidersListAttributeCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -12644,7 +12644,7 @@ - (void)writeAttributeDefaultOtaProvidersWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -12707,7 +12707,7 @@ - (void)subscribeAttributeDefaultOtaProvidersWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROtaSoftwareUpdateRequestorDefaultOtaProvidersListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -12779,7 +12779,7 @@ - (void)subscribeAttributeUpdatePossibleWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBooleanAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -12850,7 +12850,7 @@ - (void)subscribeAttributeUpdateStateWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROtaSoftwareUpdateRequestorClusterOTAUpdateStateEnumAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -12925,7 +12925,7 @@ - (void)subscribeAttributeUpdateStateProgressWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -12997,7 +12997,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROtaSoftwareUpdateRequestorGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -13071,7 +13071,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROtaSoftwareUpdateRequestorAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -13142,7 +13142,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROtaSoftwareUpdateRequestorAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -13212,7 +13212,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -13281,7 +13281,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -13367,7 +13367,7 @@ - (void)writeAttributeActiveLocaleWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -13405,7 +13405,7 @@ - (void)subscribeAttributeActiveLocaleWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -13475,7 +13475,7 @@ - (void)subscribeAttributeSupportedLocalesWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRLocalizationConfigurationSupportedLocalesListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -13548,7 +13548,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRLocalizationConfigurationGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -13622,7 +13622,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRLocalizationConfigurationAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -13693,7 +13693,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRLocalizationConfigurationAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -13763,7 +13763,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -13832,7 +13832,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -13918,7 +13918,7 @@ - (void)writeAttributeHourFormatWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -13956,7 +13956,7 @@ - (void)subscribeAttributeHourFormatWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTimeFormatLocalizationClusterHourFormatAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -14025,7 +14025,7 @@ - (void)writeAttributeActiveCalendarTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -14064,7 +14064,7 @@ - (void)subscribeAttributeActiveCalendarTypeWithMinInterval:(NSNumber * _Nonnull // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTimeFormatLocalizationClusterCalendarTypeAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -14137,7 +14137,7 @@ - (void)subscribeAttributeSupportedCalendarTypesWithMinInterval:(NSNumber * _Non // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTimeFormatLocalizationSupportedCalendarTypesListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -14210,7 +14210,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTimeFormatLocalizationGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -14282,7 +14282,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTimeFormatLocalizationAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -14352,7 +14352,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTimeFormatLocalizationAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -14422,7 +14422,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -14491,7 +14491,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -14577,7 +14577,7 @@ - (void)writeAttributeTemperatureUnitWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -14616,7 +14616,7 @@ - (void)subscribeAttributeTemperatureUnitWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRUnitLocalizationClusterTempUnitAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -14688,7 +14688,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRUnitLocalizationGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -14760,7 +14760,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRUnitLocalizationAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -14830,7 +14830,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRUnitLocalizationAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -14900,7 +14900,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -14969,7 +14969,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -15054,7 +15054,7 @@ - (void)subscribeAttributeSourcesWithMinInterval:(NSNumber * _Nonnull)minInterva // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRPowerSourceConfigurationSourcesListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -15126,7 +15126,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRPowerSourceConfigurationGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -15200,7 +15200,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRPowerSourceConfigurationAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -15271,7 +15271,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRPowerSourceConfigurationAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -15341,7 +15341,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -15410,7 +15410,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -15495,7 +15495,7 @@ - (void)subscribeAttributeStatusWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRPowerSourceClusterPowerSourceStatusAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -15563,7 +15563,7 @@ - (void)subscribeAttributeOrderWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -15631,7 +15631,7 @@ - (void)subscribeAttributeDescriptionWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -15702,7 +15702,7 @@ - (void)subscribeAttributeWiredAssessedInputVoltageWithMinInterval:(NSNumber * _ // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -15773,7 +15773,7 @@ - (void)subscribeAttributeWiredAssessedInputFrequencyWithMinInterval:(NSNumber * // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -15843,7 +15843,7 @@ - (void)subscribeAttributeWiredCurrentTypeWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRPowerSourceClusterWiredCurrentTypeAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -15915,7 +15915,7 @@ - (void)subscribeAttributeWiredAssessedCurrentWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -15986,7 +15986,7 @@ - (void)subscribeAttributeWiredNominalVoltageWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -16057,7 +16057,7 @@ - (void)subscribeAttributeWiredMaximumCurrentWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -16126,7 +16126,7 @@ - (void)subscribeAttributeWiredPresentWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBooleanAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -16196,7 +16196,7 @@ - (void)subscribeAttributeActiveWiredFaultsWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRPowerSourceActiveWiredFaultsListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -16266,7 +16266,7 @@ - (void)subscribeAttributeBatVoltageWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -16336,7 +16336,7 @@ - (void)subscribeAttributeBatPercentRemainingWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -16406,7 +16406,7 @@ - (void)subscribeAttributeBatTimeRemainingWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -16476,7 +16476,7 @@ - (void)subscribeAttributeBatChargeLevelWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRPowerSourceClusterBatChargeLevelAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -16548,7 +16548,7 @@ - (void)subscribeAttributeBatReplacementNeededWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBooleanAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -16618,7 +16618,7 @@ - (void)subscribeAttributeBatReplaceabilityWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRPowerSourceClusterBatReplaceabilityAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -16688,7 +16688,7 @@ - (void)subscribeAttributeBatPresentWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBooleanAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -16757,7 +16757,7 @@ - (void)subscribeAttributeActiveBatFaultsWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRPowerSourceActiveBatFaultsListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -16829,7 +16829,7 @@ - (void)subscribeAttributeBatReplacementDescriptionWithMinInterval:(NSNumber * _ // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -16900,7 +16900,7 @@ - (void)subscribeAttributeBatCommonDesignationWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -16970,7 +16970,7 @@ - (void)subscribeAttributeBatANSIDesignationWithMinInterval:(NSNumber * _Nonnull // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -17040,7 +17040,7 @@ - (void)subscribeAttributeBatIECDesignationWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -17111,7 +17111,7 @@ - (void)subscribeAttributeBatApprovedChemistryWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -17180,7 +17180,7 @@ - (void)subscribeAttributeBatCapacityWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -17249,7 +17249,7 @@ - (void)subscribeAttributeBatQuantityWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -17319,7 +17319,7 @@ - (void)subscribeAttributeBatChargeStateWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRPowerSourceClusterBatChargeStateAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -17391,7 +17391,7 @@ - (void)subscribeAttributeBatTimeToFullChargeWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -17462,7 +17462,7 @@ - (void)subscribeAttributeBatFunctionalWhileChargingWithMinInterval:(NSNumber * // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBooleanAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -17532,7 +17532,7 @@ - (void)subscribeAttributeBatChargingCurrentWithMinInterval:(NSNumber * _Nonnull // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -17603,7 +17603,7 @@ - (void)subscribeAttributeActiveBatChargeFaultsWithMinInterval:(NSNumber * _Nonn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRPowerSourceActiveBatChargeFaultsListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -17675,7 +17675,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRPowerSourceGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -17747,7 +17747,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRPowerSourceAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -17817,7 +17817,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRPowerSourceAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -17887,7 +17887,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -17956,7 +17956,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -18025,7 +18025,7 @@ - (void)armFailSafeWithParams:(MTRGeneralCommissioningClusterArmFailSafeParams * NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRGeneralCommissioningClusterArmFailSafeResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -18051,7 +18051,7 @@ - (void)setRegulatoryConfigWithParams:(MTRGeneralCommissioningClusterSetRegulato NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRGeneralCommissioningClusterSetRegulatoryConfigResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -18086,7 +18086,7 @@ - (void)commissioningCompleteWithParams:(MTRGeneralCommissioningClusterCommissio NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -18129,7 +18129,7 @@ - (void)writeAttributeBreadcrumbWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -18167,7 +18167,7 @@ - (void)subscribeAttributeBreadcrumbWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt64uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -18239,7 +18239,7 @@ new MTRGeneralCommissioningBasicCommissioningInfoStructAttributeCallbackBridge(s // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRGeneralCommissioningBasicCommissioningInfoStructAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -18313,7 +18313,7 @@ - (void)subscribeAttributeRegulatoryConfigWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRGeneralCommissioningClusterRegulatoryLocationTypeAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -18386,7 +18386,7 @@ - (void)subscribeAttributeLocationCapabilityWithMinInterval:(NSNumber * _Nonnull // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRGeneralCommissioningClusterRegulatoryLocationTypeAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -18459,7 +18459,7 @@ - (void)subscribeAttributeSupportsConcurrentConnectionWithMinInterval:(NSNumber // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBooleanAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -18530,7 +18530,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRGeneralCommissioningGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -18602,7 +18602,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRGeneralCommissioningAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -18672,7 +18672,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRGeneralCommissioningAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -18742,7 +18742,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -18811,7 +18811,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -18880,7 +18880,7 @@ - (void)scanNetworksWithParams:(MTRNetworkCommissioningClusterScanNetworksParams NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNetworkCommissioningClusterScanNetworksResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -18919,7 +18919,7 @@ - (void)addOrUpdateWiFiNetworkWithParams:(MTRNetworkCommissioningClusterAddOrUpd NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNetworkCommissioningClusterNetworkConfigResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -18949,7 +18949,7 @@ - (void)addOrUpdateThreadNetworkWithParams:(MTRNetworkCommissioningClusterAddOrU NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNetworkCommissioningClusterNetworkConfigResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -18978,7 +18978,7 @@ - (void)removeNetworkWithParams:(MTRNetworkCommissioningClusterRemoveNetworkPara NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNetworkCommissioningClusterNetworkConfigResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -19007,7 +19007,7 @@ - (void)connectNetworkWithParams:(MTRNetworkCommissioningClusterConnectNetworkPa NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNetworkCommissioningClusterConnectNetworkResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -19036,7 +19036,7 @@ - (void)reorderNetworkWithParams:(MTRNetworkCommissioningClusterReorderNetworkPa NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNetworkCommissioningClusterNetworkConfigResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -19083,7 +19083,7 @@ - (void)subscribeAttributeMaxNetworksWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -19151,7 +19151,7 @@ - (void)subscribeAttributeNetworksWithMinInterval:(NSNumber * _Nonnull)minInterv // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNetworkCommissioningNetworksListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -19221,7 +19221,7 @@ - (void)subscribeAttributeScanMaxTimeSecondsWithMinInterval:(NSNumber * _Nonnull // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -19292,7 +19292,7 @@ - (void)subscribeAttributeConnectMaxTimeSecondsWithMinInterval:(NSNumber * _Nonn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -19361,7 +19361,7 @@ - (void)writeAttributeInterfaceEnabledWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -19400,7 +19400,7 @@ - (void)subscribeAttributeInterfaceEnabledWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBooleanAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -19473,7 +19473,7 @@ - (void)subscribeAttributeLastNetworkingStatusWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableNetworkCommissioningClusterNetworkCommissioningStatusAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -19547,7 +19547,7 @@ - (void)subscribeAttributeLastNetworkIDWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableOctetStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -19618,7 +19618,7 @@ - (void)subscribeAttributeLastConnectErrorValueWithMinInterval:(NSNumber * _Nonn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt32sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -19689,7 +19689,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNetworkCommissioningGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -19761,7 +19761,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNetworkCommissioningAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -19831,7 +19831,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNetworkCommissioningAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -19901,7 +19901,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -19970,7 +19970,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -20039,7 +20039,7 @@ - (void)retrieveLogsRequestWithParams:(MTRDiagnosticLogsClusterRetrieveLogsReque NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRDiagnosticLogsClusterRetrieveLogsResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -20086,7 +20086,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRDiagnosticLogsGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -20158,7 +20158,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRDiagnosticLogsAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -20228,7 +20228,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRDiagnosticLogsAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -20298,7 +20298,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -20367,7 +20367,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -20435,7 +20435,7 @@ - (void)testEventTriggerWithParams:(MTRGeneralDiagnosticsClusterTestEventTrigger completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -20483,7 +20483,7 @@ - (void)subscribeAttributeNetworkInterfacesWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRGeneralDiagnosticsNetworkInterfacesListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -20553,7 +20553,7 @@ - (void)subscribeAttributeRebootCountWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -20621,7 +20621,7 @@ - (void)subscribeAttributeUpTimeWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt64uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -20691,7 +20691,7 @@ - (void)subscribeAttributeTotalOperationalHoursWithMinInterval:(NSNumber * _Nonn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -20760,7 +20760,7 @@ - (void)subscribeAttributeBootReasonsWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -20831,7 +20831,7 @@ - (void)subscribeAttributeActiveHardwareFaultsWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRGeneralDiagnosticsActiveHardwareFaultsListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -20902,7 +20902,7 @@ - (void)subscribeAttributeActiveRadioFaultsWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRGeneralDiagnosticsActiveRadioFaultsListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -20974,7 +20974,7 @@ - (void)subscribeAttributeActiveNetworkFaultsWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRGeneralDiagnosticsActiveNetworkFaultsListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -21046,7 +21046,7 @@ - (void)subscribeAttributeTestEventTriggersEnabledWithMinInterval:(NSNumber * _N // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBooleanAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -21117,7 +21117,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRGeneralDiagnosticsGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -21189,7 +21189,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRGeneralDiagnosticsAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -21259,7 +21259,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRGeneralDiagnosticsAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -21329,7 +21329,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -21398,7 +21398,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -21470,7 +21470,7 @@ - (void)resetWatermarksWithParams:(MTRSoftwareDiagnosticsClusterResetWatermarksP completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -21515,7 +21515,7 @@ - (void)subscribeAttributeThreadMetricsWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRSoftwareDiagnosticsThreadMetricsListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -21586,7 +21586,7 @@ - (void)subscribeAttributeCurrentHeapFreeWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt64uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -21656,7 +21656,7 @@ - (void)subscribeAttributeCurrentHeapUsedWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt64uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -21727,7 +21727,7 @@ - (void)subscribeAttributeCurrentHeapHighWatermarkWithMinInterval:(NSNumber * _N // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt64uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -21798,7 +21798,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRSoftwareDiagnosticsGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -21870,7 +21870,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRSoftwareDiagnosticsAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -21940,7 +21940,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRSoftwareDiagnosticsAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -22010,7 +22010,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -22079,7 +22079,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -22151,7 +22151,7 @@ - (void)resetCountsWithParams:(MTRThreadNetworkDiagnosticsClusterResetCountsPara completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -22195,7 +22195,7 @@ - (void)subscribeAttributeChannelWithMinInterval:(NSNumber * _Nonnull)minInterva // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -22264,7 +22264,7 @@ - (void)subscribeAttributeRoutingRoleWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableThreadNetworkDiagnosticsClusterRoutingRoleAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -22335,7 +22335,7 @@ - (void)subscribeAttributeNetworkNameWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -22403,7 +22403,7 @@ - (void)subscribeAttributePanIdWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -22472,7 +22472,7 @@ - (void)subscribeAttributeExtendedPanIdWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt64uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -22542,7 +22542,7 @@ - (void)subscribeAttributeMeshLocalPrefixWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableOctetStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -22611,7 +22611,7 @@ - (void)subscribeAttributeOverrunCountWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt64uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -22681,7 +22681,7 @@ - (void)subscribeAttributeNeighborTableListWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRThreadNetworkDiagnosticsNeighborTableListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -22752,7 +22752,7 @@ - (void)subscribeAttributeRouteTableListWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRThreadNetworkDiagnosticsRouteTableListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -22822,7 +22822,7 @@ - (void)subscribeAttributePartitionIdWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -22891,7 +22891,7 @@ - (void)subscribeAttributeWeightingWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -22959,7 +22959,7 @@ - (void)subscribeAttributeDataVersionWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -23029,7 +23029,7 @@ - (void)subscribeAttributeStableDataVersionWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -23099,7 +23099,7 @@ - (void)subscribeAttributeLeaderRouterIdWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -23169,7 +23169,7 @@ - (void)subscribeAttributeDetachedRoleCountWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -23239,7 +23239,7 @@ - (void)subscribeAttributeChildRoleCountWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -23309,7 +23309,7 @@ - (void)subscribeAttributeRouterRoleCountWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -23379,7 +23379,7 @@ - (void)subscribeAttributeLeaderRoleCountWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -23449,7 +23449,7 @@ - (void)subscribeAttributeAttachAttemptCountWithMinInterval:(NSNumber * _Nonnull // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -23520,7 +23520,7 @@ - (void)subscribeAttributePartitionIdChangeCountWithMinInterval:(NSNumber * _Non // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -23591,7 +23591,7 @@ - (void)subscribeAttributeBetterPartitionAttachAttemptCountWithMinInterval:(NSNu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -23661,7 +23661,7 @@ - (void)subscribeAttributeParentChangeCountWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -23730,7 +23730,7 @@ - (void)subscribeAttributeTxTotalCountWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -23800,7 +23800,7 @@ - (void)subscribeAttributeTxUnicastCountWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -23870,7 +23870,7 @@ - (void)subscribeAttributeTxBroadcastCountWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -23941,7 +23941,7 @@ - (void)subscribeAttributeTxAckRequestedCountWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -24010,7 +24010,7 @@ - (void)subscribeAttributeTxAckedCountWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -24081,7 +24081,7 @@ - (void)subscribeAttributeTxNoAckRequestedCountWithMinInterval:(NSNumber * _Nonn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -24150,7 +24150,7 @@ - (void)subscribeAttributeTxDataCountWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -24220,7 +24220,7 @@ - (void)subscribeAttributeTxDataPollCountWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -24290,7 +24290,7 @@ - (void)subscribeAttributeTxBeaconCountWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -24361,7 +24361,7 @@ - (void)subscribeAttributeTxBeaconRequestCountWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -24430,7 +24430,7 @@ - (void)subscribeAttributeTxOtherCountWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -24499,7 +24499,7 @@ - (void)subscribeAttributeTxRetryCountWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -24570,7 +24570,7 @@ - (void)subscribeAttributeTxDirectMaxRetryExpiryCountWithMinInterval:(NSNumber * // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -24641,7 +24641,7 @@ - (void)subscribeAttributeTxIndirectMaxRetryExpiryCountWithMinInterval:(NSNumber // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -24711,7 +24711,7 @@ - (void)subscribeAttributeTxErrCcaCountWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -24781,7 +24781,7 @@ - (void)subscribeAttributeTxErrAbortCountWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -24852,7 +24852,7 @@ - (void)subscribeAttributeTxErrBusyChannelCountWithMinInterval:(NSNumber * _Nonn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -24921,7 +24921,7 @@ - (void)subscribeAttributeRxTotalCountWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -24991,7 +24991,7 @@ - (void)subscribeAttributeRxUnicastCountWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -25061,7 +25061,7 @@ - (void)subscribeAttributeRxBroadcastCountWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -25130,7 +25130,7 @@ - (void)subscribeAttributeRxDataCountWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -25200,7 +25200,7 @@ - (void)subscribeAttributeRxDataPollCountWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -25270,7 +25270,7 @@ - (void)subscribeAttributeRxBeaconCountWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -25341,7 +25341,7 @@ - (void)subscribeAttributeRxBeaconRequestCountWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -25410,7 +25410,7 @@ - (void)subscribeAttributeRxOtherCountWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -25481,7 +25481,7 @@ - (void)subscribeAttributeRxAddressFilteredCountWithMinInterval:(NSNumber * _Non // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -25552,7 +25552,7 @@ - (void)subscribeAttributeRxDestAddrFilteredCountWithMinInterval:(NSNumber * _No // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -25622,7 +25622,7 @@ - (void)subscribeAttributeRxDuplicatedCountWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -25692,7 +25692,7 @@ - (void)subscribeAttributeRxErrNoFrameCountWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -25763,7 +25763,7 @@ - (void)subscribeAttributeRxErrUnknownNeighborCountWithMinInterval:(NSNumber * _ // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -25834,7 +25834,7 @@ - (void)subscribeAttributeRxErrInvalidSrcAddrCountWithMinInterval:(NSNumber * _N // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -25904,7 +25904,7 @@ - (void)subscribeAttributeRxErrSecCountWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -25974,7 +25974,7 @@ - (void)subscribeAttributeRxErrFcsCountWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -26044,7 +26044,7 @@ - (void)subscribeAttributeRxErrOtherCountWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -26114,7 +26114,7 @@ - (void)subscribeAttributeActiveTimestampWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt64uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -26184,7 +26184,7 @@ - (void)subscribeAttributePendingTimestampWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt64uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -26252,7 +26252,7 @@ - (void)subscribeAttributeDelayWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -26322,7 +26322,7 @@ - (void)subscribeAttributeSecurityPolicyWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRThreadNetworkDiagnosticsSecurityPolicyStructAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -26392,7 +26392,7 @@ - (void)subscribeAttributeChannelMaskWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableOctetStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -26468,7 +26468,7 @@ new MTRThreadNetworkDiagnosticsOperationalDatasetComponentsStructAttributeCallba // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRThreadNetworkDiagnosticsOperationalDatasetComponentsStructAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -26549,7 +26549,7 @@ - (void)subscribeAttributeActiveNetworkFaultsListWithMinInterval:(NSNumber * _No // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRThreadNetworkDiagnosticsActiveNetworkFaultsListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -26625,7 +26625,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRThreadNetworkDiagnosticsGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -26699,7 +26699,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRThreadNetworkDiagnosticsAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -26770,7 +26770,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRThreadNetworkDiagnosticsAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -26840,7 +26840,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -26909,7 +26909,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -26981,7 +26981,7 @@ - (void)resetCountsWithParams:(MTRWiFiNetworkDiagnosticsClusterResetCountsParams completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -27025,7 +27025,7 @@ - (void)subscribeAttributeBssidWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableOctetStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -27094,7 +27094,7 @@ - (void)subscribeAttributeSecurityTypeWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableWiFiNetworkDiagnosticsClusterSecurityTypeAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -27167,7 +27167,7 @@ - (void)subscribeAttributeWiFiVersionWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableWiFiNetworkDiagnosticsClusterWiFiVersionTypeAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -27241,7 +27241,7 @@ - (void)subscribeAttributeChannelNumberWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -27309,7 +27309,7 @@ - (void)subscribeAttributeRssiWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -27378,7 +27378,7 @@ - (void)subscribeAttributeBeaconLostCountWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -27448,7 +27448,7 @@ - (void)subscribeAttributeBeaconRxCountWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -27519,7 +27519,7 @@ - (void)subscribeAttributePacketMulticastRxCountWithMinInterval:(NSNumber * _Non // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -27590,7 +27590,7 @@ - (void)subscribeAttributePacketMulticastTxCountWithMinInterval:(NSNumber * _Non // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -27661,7 +27661,7 @@ - (void)subscribeAttributePacketUnicastRxCountWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -27732,7 +27732,7 @@ - (void)subscribeAttributePacketUnicastTxCountWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -27802,7 +27802,7 @@ - (void)subscribeAttributeCurrentMaxRateWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt64uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -27871,7 +27871,7 @@ - (void)subscribeAttributeOverrunCountWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt64uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -27942,7 +27942,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRWiFiNetworkDiagnosticsGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -28014,7 +28014,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRWiFiNetworkDiagnosticsAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -28084,7 +28084,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRWiFiNetworkDiagnosticsAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -28154,7 +28154,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -28223,7 +28223,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -28295,7 +28295,7 @@ - (void)resetCountsWithParams:(MTREthernetNetworkDiagnosticsClusterResetCountsPa completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -28341,7 +28341,7 @@ - (void)subscribeAttributePHYRateWithMinInterval:(NSNumber * _Nonnull)minInterva // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableEthernetNetworkDiagnosticsClusterPHYRateTypeAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -28413,7 +28413,7 @@ - (void)subscribeAttributeFullDuplexWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableBooleanAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -28482,7 +28482,7 @@ - (void)subscribeAttributePacketRxCountWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt64uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -28552,7 +28552,7 @@ - (void)subscribeAttributePacketTxCountWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt64uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -28621,7 +28621,7 @@ - (void)subscribeAttributeTxErrCountWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt64uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -28690,7 +28690,7 @@ - (void)subscribeAttributeCollisionCountWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt64uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -28759,7 +28759,7 @@ - (void)subscribeAttributeOverrunCountWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt64uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -28829,7 +28829,7 @@ - (void)subscribeAttributeCarrierDetectWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableBooleanAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -28899,7 +28899,7 @@ - (void)subscribeAttributeTimeSinceResetWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt64uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -28971,7 +28971,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTREthernetNetworkDiagnosticsGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -29045,7 +29045,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTREthernetNetworkDiagnosticsAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -29116,7 +29116,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTREthernetNetworkDiagnosticsAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -29186,7 +29186,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -29255,7 +29255,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -29341,7 +29341,7 @@ - (void)subscribeAttributeVendorNameWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -29409,7 +29409,7 @@ - (void)subscribeAttributeVendorIDWithMinInterval:(NSNumber * _Nonnull)minInterv // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRVendorIdAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -29477,7 +29477,7 @@ - (void)subscribeAttributeProductNameWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -29546,7 +29546,7 @@ - (void)writeAttributeNodeLabelWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -29584,7 +29584,7 @@ - (void)subscribeAttributeNodeLabelWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -29653,7 +29653,7 @@ - (void)subscribeAttributeHardwareVersionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -29724,7 +29724,7 @@ - (void)subscribeAttributeHardwareVersionStringWithMinInterval:(NSNumber * _Nonn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -29794,7 +29794,7 @@ - (void)subscribeAttributeSoftwareVersionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -29865,7 +29865,7 @@ - (void)subscribeAttributeSoftwareVersionStringWithMinInterval:(NSNumber * _Nonn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -29935,7 +29935,7 @@ - (void)subscribeAttributeManufacturingDateWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -30004,7 +30004,7 @@ - (void)subscribeAttributePartNumberWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -30072,7 +30072,7 @@ - (void)subscribeAttributeProductURLWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -30140,7 +30140,7 @@ - (void)subscribeAttributeProductLabelWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -30209,7 +30209,7 @@ - (void)subscribeAttributeSerialNumberWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -30278,7 +30278,7 @@ - (void)subscribeAttributeReachableWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBooleanAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -30346,7 +30346,7 @@ - (void)subscribeAttributeUniqueIDWithMinInterval:(NSNumber * _Nonnull)minInterv // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -30416,7 +30416,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBridgedDeviceBasicGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -30488,7 +30488,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBridgedDeviceBasicAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -30558,7 +30558,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBridgedDeviceBasicAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -30628,7 +30628,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -30697,7 +30697,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -30784,7 +30784,7 @@ - (void)subscribeAttributeNumberOfPositionsWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -30854,7 +30854,7 @@ - (void)subscribeAttributeCurrentPositionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -30924,7 +30924,7 @@ - (void)subscribeAttributeMultiPressMaxWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -30995,7 +30995,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRSwitchGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -31067,7 +31067,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRSwitchAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -31137,7 +31137,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRSwitchAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -31206,7 +31206,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -31275,7 +31275,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -31343,7 +31343,7 @@ - (void)openCommissioningWindowWithParams:(MTRAdministratorCommissioningClusterO completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -31378,7 +31378,7 @@ - (void)openBasicCommissioningWindowWithParams:(MTRAdministratorCommissioningClu completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -31413,7 +31413,7 @@ - (void)revokeCommissioningWithParams:(MTRAdministratorCommissioningClusterRevok completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -31461,7 +31461,7 @@ - (void)subscribeAttributeWindowStatusWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -31531,7 +31531,7 @@ - (void)subscribeAttributeAdminFabricIndexWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -31601,7 +31601,7 @@ - (void)subscribeAttributeAdminVendorIdWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -31673,7 +31673,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRAdministratorCommissioningGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -31747,7 +31747,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRAdministratorCommissioningAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -31818,7 +31818,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRAdministratorCommissioningAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -31888,7 +31888,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -31957,7 +31957,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -32026,7 +32026,7 @@ - (void)attestationRequestWithParams:(MTROperationalCredentialsClusterAttestatio NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROperationalCredentialsClusterAttestationResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -32051,7 +32051,7 @@ - (void)certificateChainRequestWithParams:(MTROperationalCredentialsClusterCerti NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROperationalCredentialsClusterCertificateChainResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -32076,7 +32076,7 @@ - (void)CSRRequestWithParams:(MTROperationalCredentialsClusterCSRRequestParams * NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROperationalCredentialsClusterCSRResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -32105,7 +32105,7 @@ - (void)addNOCWithParams:(MTROperationalCredentialsClusterAddNOCParams *)params NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROperationalCredentialsClusterNOCResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -32138,7 +32138,7 @@ - (void)updateNOCWithParams:(MTROperationalCredentialsClusterUpdateNOCParams *)p NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROperationalCredentialsClusterNOCResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -32167,7 +32167,7 @@ - (void)updateFabricLabelWithParams:(MTROperationalCredentialsClusterUpdateFabri NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROperationalCredentialsClusterNOCResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -32192,7 +32192,7 @@ - (void)removeFabricWithParams:(MTROperationalCredentialsClusterRemoveFabricPara NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROperationalCredentialsClusterNOCResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -32216,7 +32216,7 @@ - (void)addTrustedRootCertificateWithParams:(MTROperationalCredentialsClusterAdd completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -32243,7 +32243,7 @@ new MTRCommandSuccessCallbackBridge( - (void)readAttributeNOCsWithParams:(MTRReadParams * _Nullable)params completionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROperationalCredentialsNOCsListAttributeCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { using TypeInfo = OperationalCredentials::Attributes::NOCs::TypeInfo; @@ -32264,7 +32264,7 @@ - (void)subscribeAttributeNOCsWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROperationalCredentialsNOCsListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -32314,7 +32314,7 @@ new MTROperationalCredentialsNOCsListAttributeCallbackBridge( - (void)readAttributeFabricsWithParams:(MTRReadParams * _Nullable)params completionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROperationalCredentialsFabricsListAttributeCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { using TypeInfo = OperationalCredentials::Attributes::Fabrics::TypeInfo; @@ -32335,7 +32335,7 @@ - (void)subscribeAttributeFabricsWithMinInterval:(NSNumber * _Nonnull)minInterva // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROperationalCredentialsFabricsListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -32405,7 +32405,7 @@ - (void)subscribeAttributeSupportedFabricsWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -32476,7 +32476,7 @@ - (void)subscribeAttributeCommissionedFabricsWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -32548,7 +32548,7 @@ - (void)subscribeAttributeTrustedRootCertificatesWithMinInterval:(NSNumber * _No // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROperationalCredentialsTrustedRootCertificatesListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -32620,7 +32620,7 @@ - (void)subscribeAttributeCurrentFabricIndexWithMinInterval:(NSNumber * _Nonnull // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -32691,7 +32691,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROperationalCredentialsGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -32763,7 +32763,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROperationalCredentialsAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -32833,7 +32833,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROperationalCredentialsAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -32903,7 +32903,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -32972,7 +32972,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -33040,7 +33040,7 @@ - (void)keySetWriteWithParams:(MTRGroupKeyManagementClusterKeySetWriteParams *)p completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -33108,7 +33108,7 @@ - (void)keySetReadWithParams:(MTRGroupKeyManagementClusterKeySetReadParams *)par NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRGroupKeyManagementClusterKeySetReadResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -33132,7 +33132,7 @@ - (void)keySetRemoveWithParams:(MTRGroupKeyManagementClusterKeySetRemoveParams * completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -33161,7 +33161,7 @@ - (void)keySetReadAllIndicesWithParams:(MTRGroupKeyManagementClusterKeySetReadAl NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRGroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -33205,7 +33205,7 @@ new MTRGroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackBridge(self. - (void)readAttributeGroupKeyMapWithParams:(MTRReadParams * _Nullable)params completionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRGroupKeyManagementGroupKeyMapListAttributeCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { using TypeInfo = GroupKeyManagement::Attributes::GroupKeyMap::TypeInfo; @@ -33226,7 +33226,7 @@ - (void)writeAttributeGroupKeyMapWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -33287,7 +33287,7 @@ - (void)subscribeAttributeGroupKeyMapWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRGroupKeyManagementGroupKeyMapListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -33337,7 +33337,7 @@ new MTRGroupKeyManagementGroupKeyMapListAttributeCallbackBridge( - (void)readAttributeGroupTableWithParams:(MTRReadParams * _Nullable)params completionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRGroupKeyManagementGroupTableListAttributeCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { using TypeInfo = GroupKeyManagement::Attributes::GroupTable::TypeInfo; @@ -33358,7 +33358,7 @@ - (void)subscribeAttributeGroupTableWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRGroupKeyManagementGroupTableListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -33428,7 +33428,7 @@ - (void)subscribeAttributeMaxGroupsPerFabricWithMinInterval:(NSNumber * _Nonnull // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -33499,7 +33499,7 @@ - (void)subscribeAttributeMaxGroupKeysPerFabricWithMinInterval:(NSNumber * _Nonn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -33570,7 +33570,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRGroupKeyManagementGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -33642,7 +33642,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRGroupKeyManagementAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -33712,7 +33712,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRGroupKeyManagementAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -33782,7 +33782,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -33851,7 +33851,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -33937,7 +33937,7 @@ - (void)subscribeAttributeLabelListWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRFixedLabelLabelListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -34007,7 +34007,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRFixedLabelGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -34079,7 +34079,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRFixedLabelAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -34149,7 +34149,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRFixedLabelAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -34219,7 +34219,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -34288,7 +34288,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -34374,7 +34374,7 @@ - (void)writeAttributeLabelListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -34434,7 +34434,7 @@ - (void)subscribeAttributeLabelListWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRUserLabelLabelListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -34504,7 +34504,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRUserLabelGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -34576,7 +34576,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRUserLabelAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -34646,7 +34646,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRUserLabelAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -34716,7 +34716,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -34785,7 +34785,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -34871,7 +34871,7 @@ - (void)subscribeAttributeStateValueWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBooleanAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -34941,7 +34941,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBooleanStateGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -35013,7 +35013,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBooleanStateAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -35083,7 +35083,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBooleanStateAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -35153,7 +35153,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -35222,7 +35222,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -35290,7 +35290,7 @@ - (void)changeToModeWithParams:(MTRModeSelectClusterChangeToModeParams *)params completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -35336,7 +35336,7 @@ - (void)subscribeAttributeDescriptionWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -35406,7 +35406,7 @@ - (void)subscribeAttributeStandardNamespaceWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -35476,7 +35476,7 @@ - (void)subscribeAttributeSupportedModesWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRModeSelectSupportedModesListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -35546,7 +35546,7 @@ - (void)subscribeAttributeCurrentModeWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -35615,7 +35615,7 @@ - (void)writeAttributeStartUpModeWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -35658,7 +35658,7 @@ - (void)subscribeAttributeStartUpModeWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -35726,7 +35726,7 @@ - (void)writeAttributeOnModeWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -35769,7 +35769,7 @@ - (void)subscribeAttributeOnModeWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -35839,7 +35839,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRModeSelectGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -35911,7 +35911,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRModeSelectAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -35981,7 +35981,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRModeSelectAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -36051,7 +36051,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -36120,7 +36120,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -36188,7 +36188,7 @@ - (void)lockDoorWithParams:(MTRDoorLockClusterLockDoorParams * _Nullable)params completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -36224,7 +36224,7 @@ - (void)unlockDoorWithParams:(MTRDoorLockClusterUnlockDoorParams * _Nullable)par completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -36260,7 +36260,7 @@ - (void)unlockWithTimeoutWithParams:(MTRDoorLockClusterUnlockWithTimeoutParams * completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -36295,7 +36295,7 @@ - (void)setWeekDayScheduleWithParams:(MTRDoorLockClusterSetWeekDayScheduleParams completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -36330,7 +36330,7 @@ - (void)getWeekDayScheduleWithParams:(MTRDoorLockClusterGetWeekDayScheduleParams NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRDoorLockClusterGetWeekDayScheduleResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -36355,7 +36355,7 @@ - (void)clearWeekDayScheduleWithParams:(MTRDoorLockClusterClearWeekDaySchedulePa completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -36384,7 +36384,7 @@ - (void)setYearDayScheduleWithParams:(MTRDoorLockClusterSetYearDayScheduleParams completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -36416,7 +36416,7 @@ - (void)getYearDayScheduleWithParams:(MTRDoorLockClusterGetYearDayScheduleParams NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRDoorLockClusterGetYearDayScheduleResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -36441,7 +36441,7 @@ - (void)clearYearDayScheduleWithParams:(MTRDoorLockClusterClearYearDaySchedulePa completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -36470,7 +36470,7 @@ - (void)setHolidayScheduleWithParams:(MTRDoorLockClusterSetHolidayScheduleParams completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -36503,7 +36503,7 @@ - (void)getHolidayScheduleWithParams:(MTRDoorLockClusterGetHolidayScheduleParams NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRDoorLockClusterGetHolidayScheduleResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -36527,7 +36527,7 @@ - (void)clearHolidayScheduleWithParams:(MTRDoorLockClusterClearHolidaySchedulePa completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -36554,7 +36554,7 @@ new MTRCommandSuccessCallbackBridge( - (void)setUserWithParams:(MTRDoorLockClusterSetUserParams *)params completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -36620,7 +36620,7 @@ - (void)getUserWithParams:(MTRDoorLockClusterGetUserParams *)params (void (^)(MTRDoorLockClusterGetUserResponseParams * _Nullable data, NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRDoorLockClusterGetUserResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -36643,7 +36643,7 @@ new MTRDoorLockClusterGetUserResponseCallbackBridge(self.callbackQueue, self.dev - (void)clearUserWithParams:(MTRDoorLockClusterClearUserParams *)params completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -36675,7 +36675,7 @@ - (void)setCredentialWithParams:(MTRDoorLockClusterSetCredentialParams *)params NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRDoorLockClusterSetCredentialResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -36727,7 +36727,7 @@ - (void)getCredentialStatusWithParams:(MTRDoorLockClusterGetCredentialStatusPara NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRDoorLockClusterGetCredentialStatusResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -36753,7 +36753,7 @@ - (void)clearCredentialWithParams:(MTRDoorLockClusterClearCredentialParams *)par completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -36809,7 +36809,7 @@ - (void)subscribeAttributeLockStateWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableDoorLockClusterDlLockStateAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -36878,7 +36878,7 @@ - (void)subscribeAttributeLockTypeWithMinInterval:(NSNumber * _Nonnull)minInterv // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRDoorLockClusterDlLockTypeAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -36948,7 +36948,7 @@ - (void)subscribeAttributeActuatorEnabledWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBooleanAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -37017,7 +37017,7 @@ - (void)subscribeAttributeDoorStateWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableDoorLockClusterDlDoorStateAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -37086,7 +37086,7 @@ - (void)writeAttributeDoorOpenEventsWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -37125,7 +37125,7 @@ - (void)subscribeAttributeDoorOpenEventsWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -37194,7 +37194,7 @@ - (void)writeAttributeDoorClosedEventsWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -37233,7 +37233,7 @@ - (void)subscribeAttributeDoorClosedEventsWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -37302,7 +37302,7 @@ - (void)writeAttributeOpenPeriodWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -37340,7 +37340,7 @@ - (void)subscribeAttributeOpenPeriodWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -37410,7 +37410,7 @@ - (void)subscribeAttributeNumberOfTotalUsersSupportedWithMinInterval:(NSNumber * // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -37481,7 +37481,7 @@ - (void)subscribeAttributeNumberOfPINUsersSupportedWithMinInterval:(NSNumber * _ // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -37552,7 +37552,7 @@ - (void)subscribeAttributeNumberOfRFIDUsersSupportedWithMinInterval:(NSNumber * // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -37623,7 +37623,7 @@ - (void)subscribeAttributeNumberOfWeekDaySchedulesSupportedPerUserWithMinInterva // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -37695,7 +37695,7 @@ - (void)subscribeAttributeNumberOfYearDaySchedulesSupportedPerUserWithMinInterva // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -37767,7 +37767,7 @@ - (void)subscribeAttributeNumberOfHolidaySchedulesSupportedWithMinInterval:(NSNu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -37837,7 +37837,7 @@ - (void)subscribeAttributeMaxPINCodeLengthWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -37907,7 +37907,7 @@ - (void)subscribeAttributeMinPINCodeLengthWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -37977,7 +37977,7 @@ - (void)subscribeAttributeMaxRFIDCodeLengthWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -38047,7 +38047,7 @@ - (void)subscribeAttributeMinRFIDCodeLengthWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -38118,7 +38118,7 @@ - (void)subscribeAttributeCredentialRulesSupportWithMinInterval:(NSNumber * _Non // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRDoorLockCredentialRulesSupportAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -38190,7 +38190,7 @@ - (void)subscribeAttributeNumberOfCredentialsSupportedPerUserWithMinInterval:(NS // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -38259,7 +38259,7 @@ - (void)writeAttributeLanguageWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -38297,7 +38297,7 @@ - (void)subscribeAttributeLanguageWithMinInterval:(NSNumber * _Nonnull)minInterv // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -38365,7 +38365,7 @@ - (void)writeAttributeLEDSettingsWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -38403,7 +38403,7 @@ - (void)subscribeAttributeLEDSettingsWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -38472,7 +38472,7 @@ - (void)writeAttributeAutoRelockTimeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -38511,7 +38511,7 @@ - (void)subscribeAttributeAutoRelockTimeWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -38580,7 +38580,7 @@ - (void)writeAttributeSoundVolumeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -38618,7 +38618,7 @@ - (void)subscribeAttributeSoundVolumeWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -38687,7 +38687,7 @@ - (void)writeAttributeOperatingModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -38726,7 +38726,7 @@ - (void)subscribeAttributeOperatingModeWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRDoorLockClusterDlOperatingModeAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -38798,7 +38798,7 @@ - (void)subscribeAttributeSupportedOperatingModesWithMinInterval:(NSNumber * _No // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRDoorLockSupportedOperatingModesAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -38870,7 +38870,7 @@ - (void)subscribeAttributeDefaultConfigurationRegisterWithMinInterval:(NSNumber // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRDoorLockDefaultConfigurationRegisterAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -38941,7 +38941,7 @@ - (void)writeAttributeEnableLocalProgrammingWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -38981,7 +38981,7 @@ - (void)subscribeAttributeEnableLocalProgrammingWithMinInterval:(NSNumber * _Non // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBooleanAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -39051,7 +39051,7 @@ - (void)writeAttributeEnableOneTouchLockingWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -39091,7 +39091,7 @@ - (void)subscribeAttributeEnableOneTouchLockingWithMinInterval:(NSNumber * _Nonn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBooleanAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -39161,7 +39161,7 @@ - (void)writeAttributeEnableInsideStatusLEDWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -39201,7 +39201,7 @@ - (void)subscribeAttributeEnableInsideStatusLEDWithMinInterval:(NSNumber * _Nonn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBooleanAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -39273,7 +39273,7 @@ - (void)writeAttributeEnablePrivacyModeButtonWithValue:(NSNumber * _Nonnull)valu completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -39313,7 +39313,7 @@ - (void)subscribeAttributeEnablePrivacyModeButtonWithMinInterval:(NSNumber * _No // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBooleanAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -39385,7 +39385,7 @@ - (void)writeAttributeLocalProgrammingFeaturesWithValue:(NSNumber * _Nonnull)val completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -39425,7 +39425,7 @@ - (void)subscribeAttributeLocalProgrammingFeaturesWithMinInterval:(NSNumber * _N // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRDoorLockLocalProgrammingFeaturesAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -39495,7 +39495,7 @@ - (void)writeAttributeWrongCodeEntryLimitWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -39535,7 +39535,7 @@ - (void)subscribeAttributeWrongCodeEntryLimitWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -39607,7 +39607,7 @@ - (void)writeAttributeUserCodeTemporaryDisableTimeWithValue:(NSNumber * _Nonnull completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -39647,7 +39647,7 @@ - (void)subscribeAttributeUserCodeTemporaryDisableTimeWithMinInterval:(NSNumber // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -39716,7 +39716,7 @@ - (void)writeAttributeSendPINOverTheAirWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -39755,7 +39755,7 @@ - (void)subscribeAttributeSendPINOverTheAirWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBooleanAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -39827,7 +39827,7 @@ - (void)writeAttributeRequirePINforRemoteOperationWithValue:(NSNumber * _Nonnull completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -39867,7 +39867,7 @@ - (void)subscribeAttributeRequirePINforRemoteOperationWithMinInterval:(NSNumber // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBooleanAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -39936,7 +39936,7 @@ - (void)writeAttributeExpiringUserTimeoutWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -39976,7 +39976,7 @@ - (void)subscribeAttributeExpiringUserTimeoutWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -40047,7 +40047,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRDoorLockGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -40119,7 +40119,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRDoorLockAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -40189,7 +40189,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRDoorLockAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -40259,7 +40259,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -40328,7 +40328,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -40400,7 +40400,7 @@ - (void)upOrOpenWithParams:(MTRWindowCoveringClusterUpOrOpenParams * _Nullable)p completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -40431,7 +40431,7 @@ - (void)downOrCloseWithParams:(MTRWindowCoveringClusterDownOrCloseParams * _Null completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -40462,7 +40462,7 @@ - (void)stopMotionWithParams:(MTRWindowCoveringClusterStopMotionParams * _Nullab completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -40489,7 +40489,7 @@ - (void)goToLiftValueWithParams:(MTRWindowCoveringClusterGoToLiftValueParams *)p completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -40517,7 +40517,7 @@ - (void)goToLiftPercentageWithParams:(MTRWindowCoveringClusterGoToLiftPercentage completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -40545,7 +40545,7 @@ - (void)goToTiltValueWithParams:(MTRWindowCoveringClusterGoToTiltValueParams *)p completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -40573,7 +40573,7 @@ - (void)goToTiltPercentageWithParams:(MTRWindowCoveringClusterGoToTiltPercentage completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -40618,7 +40618,7 @@ - (void)subscribeAttributeTypeWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRWindowCoveringClusterTypeAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -40689,7 +40689,7 @@ - (void)subscribeAttributePhysicalClosedLimitLiftWithMinInterval:(NSNumber * _No // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -40760,7 +40760,7 @@ - (void)subscribeAttributePhysicalClosedLimitTiltWithMinInterval:(NSNumber * _No // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -40831,7 +40831,7 @@ - (void)subscribeAttributeCurrentPositionLiftWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -40902,7 +40902,7 @@ - (void)subscribeAttributeCurrentPositionTiltWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -40973,7 +40973,7 @@ - (void)subscribeAttributeNumberOfActuationsLiftWithMinInterval:(NSNumber * _Non // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -41044,7 +41044,7 @@ - (void)subscribeAttributeNumberOfActuationsTiltWithMinInterval:(NSNumber * _Non // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -41113,7 +41113,7 @@ - (void)subscribeAttributeConfigStatusWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRWindowCoveringConfigStatusAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -41185,7 +41185,7 @@ - (void)subscribeAttributeCurrentPositionLiftPercentageWithMinInterval:(NSNumber // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -41256,7 +41256,7 @@ - (void)subscribeAttributeCurrentPositionTiltPercentageWithMinInterval:(NSNumber // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -41326,7 +41326,7 @@ - (void)subscribeAttributeOperationalStatusWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRWindowCoveringOperationalStatusAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -41398,7 +41398,7 @@ - (void)subscribeAttributeTargetPositionLiftPercent100thsWithMinInterval:(NSNumb // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -41469,7 +41469,7 @@ - (void)subscribeAttributeTargetPositionTiltPercent100thsWithMinInterval:(NSNumb // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -41539,7 +41539,7 @@ - (void)subscribeAttributeEndProductTypeWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRWindowCoveringClusterEndProductTypeAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -41611,7 +41611,7 @@ - (void)subscribeAttributeCurrentPositionLiftPercent100thsWithMinInterval:(NSNum // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -41682,7 +41682,7 @@ - (void)subscribeAttributeCurrentPositionTiltPercent100thsWithMinInterval:(NSNum // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -41753,7 +41753,7 @@ - (void)subscribeAttributeInstalledOpenLimitLiftWithMinInterval:(NSNumber * _Non // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -41824,7 +41824,7 @@ - (void)subscribeAttributeInstalledClosedLimitLiftWithMinInterval:(NSNumber * _N // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -41895,7 +41895,7 @@ - (void)subscribeAttributeInstalledOpenLimitTiltWithMinInterval:(NSNumber * _Non // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -41966,7 +41966,7 @@ - (void)subscribeAttributeInstalledClosedLimitTiltWithMinInterval:(NSNumber * _N // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -42034,7 +42034,7 @@ - (void)writeAttributeModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -42072,7 +42072,7 @@ - (void)subscribeAttributeModeWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRWindowCoveringModeAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -42140,7 +42140,7 @@ - (void)subscribeAttributeSafetyStatusWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRWindowCoveringSafetyStatusAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -42212,7 +42212,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRWindowCoveringGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -42284,7 +42284,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRWindowCoveringAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -42354,7 +42354,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRWindowCoveringAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -42424,7 +42424,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -42493,7 +42493,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -42561,7 +42561,7 @@ - (void)barrierControlGoToPercentWithParams:(MTRBarrierControlClusterBarrierCont completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -42593,7 +42593,7 @@ - (void)barrierControlStopWithParams:(MTRBarrierControlClusterBarrierControlStop completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -42639,7 +42639,7 @@ - (void)subscribeAttributeBarrierMovingStateWithMinInterval:(NSNumber * _Nonnull // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -42710,7 +42710,7 @@ - (void)subscribeAttributeBarrierSafetyStatusWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -42781,7 +42781,7 @@ - (void)subscribeAttributeBarrierCapabilitiesWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -42850,7 +42850,7 @@ - (void)writeAttributeBarrierOpenEventsWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -42889,7 +42889,7 @@ - (void)subscribeAttributeBarrierOpenEventsWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -42958,7 +42958,7 @@ - (void)writeAttributeBarrierCloseEventsWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -42997,7 +42997,7 @@ - (void)subscribeAttributeBarrierCloseEventsWithMinInterval:(NSNumber * _Nonnull // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -43069,7 +43069,7 @@ - (void)writeAttributeBarrierCommandOpenEventsWithValue:(NSNumber * _Nonnull)val completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -43109,7 +43109,7 @@ - (void)subscribeAttributeBarrierCommandOpenEventsWithMinInterval:(NSNumber * _N // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -43181,7 +43181,7 @@ - (void)writeAttributeBarrierCommandCloseEventsWithValue:(NSNumber * _Nonnull)va completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -43221,7 +43221,7 @@ - (void)subscribeAttributeBarrierCommandCloseEventsWithMinInterval:(NSNumber * _ // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -43290,7 +43290,7 @@ - (void)writeAttributeBarrierOpenPeriodWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -43329,7 +43329,7 @@ - (void)subscribeAttributeBarrierOpenPeriodWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -43398,7 +43398,7 @@ - (void)writeAttributeBarrierClosePeriodWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -43437,7 +43437,7 @@ - (void)subscribeAttributeBarrierClosePeriodWithMinInterval:(NSNumber * _Nonnull // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -43507,7 +43507,7 @@ - (void)subscribeAttributeBarrierPositionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -43578,7 +43578,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBarrierControlGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -43650,7 +43650,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBarrierControlAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -43720,7 +43720,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBarrierControlAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -43790,7 +43790,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -43859,7 +43859,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -43945,7 +43945,7 @@ - (void)subscribeAttributeMaxPressureWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -44014,7 +44014,7 @@ - (void)subscribeAttributeMaxSpeedWithMinInterval:(NSNumber * _Nonnull)minInterv // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -44081,7 +44081,7 @@ - (void)subscribeAttributeMaxFlowWithMinInterval:(NSNumber * _Nonnull)minInterva // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -44150,7 +44150,7 @@ - (void)subscribeAttributeMinConstPressureWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -44220,7 +44220,7 @@ - (void)subscribeAttributeMaxConstPressureWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -44290,7 +44290,7 @@ - (void)subscribeAttributeMinCompPressureWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -44360,7 +44360,7 @@ - (void)subscribeAttributeMaxCompPressureWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -44430,7 +44430,7 @@ - (void)subscribeAttributeMinConstSpeedWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -44500,7 +44500,7 @@ - (void)subscribeAttributeMaxConstSpeedWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -44569,7 +44569,7 @@ - (void)subscribeAttributeMinConstFlowWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -44638,7 +44638,7 @@ - (void)subscribeAttributeMaxConstFlowWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -44707,7 +44707,7 @@ - (void)subscribeAttributeMinConstTempWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -44776,7 +44776,7 @@ - (void)subscribeAttributeMaxConstTempWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -44845,7 +44845,7 @@ - (void)subscribeAttributePumpStatusWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRPumpConfigurationAndControlPumpStatusAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -44918,7 +44918,7 @@ - (void)subscribeAttributeEffectiveOperationModeWithMinInterval:(NSNumber * _Non // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRPumpConfigurationAndControlClusterPumpOperationModeAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -44994,7 +44994,7 @@ - (void)subscribeAttributeEffectiveControlModeWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRPumpConfigurationAndControlClusterPumpControlModeAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -45065,7 +45065,7 @@ - (void)subscribeAttributeCapacityWithMinInterval:(NSNumber * _Nonnull)minInterv // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -45132,7 +45132,7 @@ - (void)subscribeAttributeSpeedWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -45201,7 +45201,7 @@ - (void)writeAttributeLifetimeRunningHoursWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -45246,7 +45246,7 @@ - (void)subscribeAttributeLifetimeRunningHoursWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -45314,7 +45314,7 @@ - (void)subscribeAttributePowerWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -45385,7 +45385,7 @@ - (void)writeAttributeLifetimeEnergyConsumedWithValue:(NSNumber * _Nullable)valu completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -45430,7 +45430,7 @@ - (void)subscribeAttributeLifetimeEnergyConsumedWithMinInterval:(NSNumber * _Non // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -45501,7 +45501,7 @@ - (void)writeAttributeOperationModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -45540,7 +45540,7 @@ - (void)subscribeAttributeOperationModeWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRPumpConfigurationAndControlClusterPumpOperationModeAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -45614,7 +45614,7 @@ - (void)writeAttributeControlModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -45652,7 +45652,7 @@ - (void)subscribeAttributeControlModeWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRPumpConfigurationAndControlClusterPumpControlModeAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -45727,7 +45727,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRPumpConfigurationAndControlGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -45803,7 +45803,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRPumpConfigurationAndControlAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -45874,7 +45874,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRPumpConfigurationAndControlAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -45944,7 +45944,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -46013,7 +46013,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -46081,7 +46081,7 @@ - (void)setpointRaiseLowerWithParams:(MTRThermostatClusterSetpointRaiseLowerPara completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -46110,7 +46110,7 @@ - (void)setWeeklyScheduleWithParams:(MTRThermostatClusterSetWeeklyScheduleParams completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -46177,7 +46177,7 @@ - (void)getWeeklyScheduleWithParams:(MTRThermostatClusterGetWeeklyScheduleParams NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRThermostatClusterGetWeeklyScheduleResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -46208,7 +46208,7 @@ - (void)clearWeeklyScheduleWithParams:(MTRThermostatClusterClearWeeklySchedulePa completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -46254,7 +46254,7 @@ - (void)subscribeAttributeLocalTemperatureWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -46324,7 +46324,7 @@ - (void)subscribeAttributeOutdoorTemperatureWithMinInterval:(NSNumber * _Nonnull // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -46393,7 +46393,7 @@ - (void)subscribeAttributeOccupancyWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -46463,7 +46463,7 @@ - (void)subscribeAttributeAbsMinHeatSetpointLimitWithMinInterval:(NSNumber * _No // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -46534,7 +46534,7 @@ - (void)subscribeAttributeAbsMaxHeatSetpointLimitWithMinInterval:(NSNumber * _No // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -46605,7 +46605,7 @@ - (void)subscribeAttributeAbsMinCoolSetpointLimitWithMinInterval:(NSNumber * _No // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -46676,7 +46676,7 @@ - (void)subscribeAttributeAbsMaxCoolSetpointLimitWithMinInterval:(NSNumber * _No // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -46746,7 +46746,7 @@ - (void)subscribeAttributePICoolingDemandWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -46816,7 +46816,7 @@ - (void)subscribeAttributePIHeatingDemandWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -46888,7 +46888,7 @@ - (void)writeAttributeHVACSystemTypeConfigurationWithValue:(NSNumber * _Nonnull) completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -46928,7 +46928,7 @@ - (void)subscribeAttributeHVACSystemTypeConfigurationWithMinInterval:(NSNumber * // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -47000,7 +47000,7 @@ - (void)writeAttributeLocalTemperatureCalibrationWithValue:(NSNumber * _Nonnull) completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -47040,7 +47040,7 @@ - (void)subscribeAttributeLocalTemperatureCalibrationWithMinInterval:(NSNumber * // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -47112,7 +47112,7 @@ - (void)writeAttributeOccupiedCoolingSetpointWithValue:(NSNumber * _Nonnull)valu completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -47152,7 +47152,7 @@ - (void)subscribeAttributeOccupiedCoolingSetpointWithMinInterval:(NSNumber * _No // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -47224,7 +47224,7 @@ - (void)writeAttributeOccupiedHeatingSetpointWithValue:(NSNumber * _Nonnull)valu completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -47264,7 +47264,7 @@ - (void)subscribeAttributeOccupiedHeatingSetpointWithMinInterval:(NSNumber * _No // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -47336,7 +47336,7 @@ - (void)writeAttributeUnoccupiedCoolingSetpointWithValue:(NSNumber * _Nonnull)va completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -47376,7 +47376,7 @@ - (void)subscribeAttributeUnoccupiedCoolingSetpointWithMinInterval:(NSNumber * _ // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -47448,7 +47448,7 @@ - (void)writeAttributeUnoccupiedHeatingSetpointWithValue:(NSNumber * _Nonnull)va completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -47488,7 +47488,7 @@ - (void)subscribeAttributeUnoccupiedHeatingSetpointWithMinInterval:(NSNumber * _ // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -47557,7 +47557,7 @@ - (void)writeAttributeMinHeatSetpointLimitWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -47597,7 +47597,7 @@ - (void)subscribeAttributeMinHeatSetpointLimitWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -47666,7 +47666,7 @@ - (void)writeAttributeMaxHeatSetpointLimitWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -47706,7 +47706,7 @@ - (void)subscribeAttributeMaxHeatSetpointLimitWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -47775,7 +47775,7 @@ - (void)writeAttributeMinCoolSetpointLimitWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -47815,7 +47815,7 @@ - (void)subscribeAttributeMinCoolSetpointLimitWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -47884,7 +47884,7 @@ - (void)writeAttributeMaxCoolSetpointLimitWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -47924,7 +47924,7 @@ - (void)subscribeAttributeMaxCoolSetpointLimitWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -47993,7 +47993,7 @@ - (void)writeAttributeMinSetpointDeadBandWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -48033,7 +48033,7 @@ - (void)subscribeAttributeMinSetpointDeadBandWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -48102,7 +48102,7 @@ - (void)writeAttributeRemoteSensingWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -48141,7 +48141,7 @@ - (void)subscribeAttributeRemoteSensingWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -48213,7 +48213,7 @@ - (void)writeAttributeControlSequenceOfOperationWithValue:(NSNumber * _Nonnull)v completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -48253,7 +48253,7 @@ - (void)subscribeAttributeControlSequenceOfOperationWithMinInterval:(NSNumber * // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRThermostatClusterThermostatControlSequenceAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -48323,7 +48323,7 @@ - (void)writeAttributeSystemModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -48361,7 +48361,7 @@ - (void)subscribeAttributeSystemModeWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -48431,7 +48431,7 @@ - (void)subscribeAttributeThermostatRunningModeWithMinInterval:(NSNumber * _Nonn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -48500,7 +48500,7 @@ - (void)subscribeAttributeStartOfWeekWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -48571,7 +48571,7 @@ - (void)subscribeAttributeNumberOfWeeklyTransitionsWithMinInterval:(NSNumber * _ // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -48642,7 +48642,7 @@ - (void)subscribeAttributeNumberOfDailyTransitionsWithMinInterval:(NSNumber * _N // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -48714,7 +48714,7 @@ - (void)writeAttributeTemperatureSetpointHoldWithValue:(NSNumber * _Nonnull)valu completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -48754,7 +48754,7 @@ - (void)subscribeAttributeTemperatureSetpointHoldWithMinInterval:(NSNumber * _No // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -48826,7 +48826,7 @@ - (void)writeAttributeTemperatureSetpointHoldDurationWithValue:(NSNumber * _Null completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -48871,7 +48871,7 @@ - (void)subscribeAttributeTemperatureSetpointHoldDurationWithMinInterval:(NSNumb // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -48943,7 +48943,7 @@ - (void)writeAttributeThermostatProgrammingOperationModeWithValue:(NSNumber * _N completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -48983,7 +48983,7 @@ - (void)subscribeAttributeThermostatProgrammingOperationModeWithMinInterval:(NSN // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -49054,7 +49054,7 @@ - (void)subscribeAttributeThermostatRunningStateWithMinInterval:(NSNumber * _Non // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -49125,7 +49125,7 @@ - (void)subscribeAttributeSetpointChangeSourceWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -49196,7 +49196,7 @@ - (void)subscribeAttributeSetpointChangeAmountWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -49267,7 +49267,7 @@ - (void)subscribeAttributeSetpointChangeSourceTimestampWithMinInterval:(NSNumber // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -49336,7 +49336,7 @@ - (void)writeAttributeOccupiedSetbackWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -49380,7 +49380,7 @@ - (void)subscribeAttributeOccupiedSetbackWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -49450,7 +49450,7 @@ - (void)subscribeAttributeOccupiedSetbackMinWithMinInterval:(NSNumber * _Nonnull // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -49520,7 +49520,7 @@ - (void)subscribeAttributeOccupiedSetbackMaxWithMinInterval:(NSNumber * _Nonnull // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -49589,7 +49589,7 @@ - (void)writeAttributeUnoccupiedSetbackWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -49633,7 +49633,7 @@ - (void)subscribeAttributeUnoccupiedSetbackWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -49704,7 +49704,7 @@ - (void)subscribeAttributeUnoccupiedSetbackMinWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -49775,7 +49775,7 @@ - (void)subscribeAttributeUnoccupiedSetbackMaxWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -49844,7 +49844,7 @@ - (void)writeAttributeEmergencyHeatDeltaWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -49883,7 +49883,7 @@ - (void)subscribeAttributeEmergencyHeatDeltaWithMinInterval:(NSNumber * _Nonnull // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -49951,7 +49951,7 @@ - (void)writeAttributeACTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -49989,7 +49989,7 @@ - (void)subscribeAttributeACTypeWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -50057,7 +50057,7 @@ - (void)writeAttributeACCapacityWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -50095,7 +50095,7 @@ - (void)subscribeAttributeACCapacityWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -50163,7 +50163,7 @@ - (void)writeAttributeACRefrigerantTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -50202,7 +50202,7 @@ - (void)subscribeAttributeACRefrigerantTypeWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -50271,7 +50271,7 @@ - (void)writeAttributeACCompressorTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -50310,7 +50310,7 @@ - (void)subscribeAttributeACCompressorTypeWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -50379,7 +50379,7 @@ - (void)writeAttributeACErrorCodeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -50417,7 +50417,7 @@ - (void)subscribeAttributeACErrorCodeWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -50486,7 +50486,7 @@ - (void)writeAttributeACLouverPositionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -50525,7 +50525,7 @@ - (void)subscribeAttributeACLouverPositionWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -50595,7 +50595,7 @@ - (void)subscribeAttributeACCoilTemperatureWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -50664,7 +50664,7 @@ - (void)writeAttributeACCapacityformatWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -50703,7 +50703,7 @@ - (void)subscribeAttributeACCapacityformatWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -50774,7 +50774,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRThermostatGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -50846,7 +50846,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRThermostatAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -50916,7 +50916,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRThermostatAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -50986,7 +50986,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -51055,7 +51055,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -51140,7 +51140,7 @@ - (void)writeAttributeFanModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -51178,7 +51178,7 @@ - (void)subscribeAttributeFanModeWithMinInterval:(NSNumber * _Nonnull)minInterva // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRFanControlClusterFanModeTypeAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -51247,7 +51247,7 @@ - (void)writeAttributeFanModeSequenceWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -51286,7 +51286,7 @@ - (void)subscribeAttributeFanModeSequenceWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRFanControlClusterFanModeSequenceTypeAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -51356,7 +51356,7 @@ - (void)writeAttributePercentSettingWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -51400,7 +51400,7 @@ - (void)subscribeAttributePercentSettingWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -51470,7 +51470,7 @@ - (void)subscribeAttributePercentCurrentWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -51539,7 +51539,7 @@ - (void)subscribeAttributeSpeedMaxWithMinInterval:(NSNumber * _Nonnull)minInterv // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -51607,7 +51607,7 @@ - (void)writeAttributeSpeedSettingWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -51650,7 +51650,7 @@ - (void)subscribeAttributeSpeedSettingWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -51719,7 +51719,7 @@ - (void)subscribeAttributeSpeedCurrentWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -51788,7 +51788,7 @@ - (void)subscribeAttributeRockSupportWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -51857,7 +51857,7 @@ - (void)writeAttributeRockSettingWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -51895,7 +51895,7 @@ - (void)subscribeAttributeRockSettingWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -51964,7 +51964,7 @@ - (void)subscribeAttributeWindSupportWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -52033,7 +52033,7 @@ - (void)writeAttributeWindSettingWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -52071,7 +52071,7 @@ - (void)subscribeAttributeWindSettingWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -52142,7 +52142,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRFanControlGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -52214,7 +52214,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRFanControlAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -52284,7 +52284,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRFanControlAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -52354,7 +52354,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -52423,7 +52423,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -52510,7 +52510,7 @@ - (void)writeAttributeTemperatureDisplayModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -52550,7 +52550,7 @@ - (void)subscribeAttributeTemperatureDisplayModeWithMinInterval:(NSNumber * _Non // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -52619,7 +52619,7 @@ - (void)writeAttributeKeypadLockoutWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -52658,7 +52658,7 @@ - (void)subscribeAttributeKeypadLockoutWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -52730,7 +52730,7 @@ - (void)writeAttributeScheduleProgrammingVisibilityWithValue:(NSNumber * _Nonnul completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -52770,7 +52770,7 @@ - (void)subscribeAttributeScheduleProgrammingVisibilityWithMinInterval:(NSNumber // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -52843,7 +52843,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRThermostatUserInterfaceConfigurationGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -52921,7 +52921,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRThermostatUserInterfaceConfigurationAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -52997,7 +52997,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRThermostatUserInterfaceConfigurationAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -53070,7 +53070,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -53139,7 +53139,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -53206,7 +53206,7 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoi - (void)moveToHueWithParams:(MTRColorControlClusterMoveToHueParams *)params completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -53238,7 +53238,7 @@ new MTRCommandSuccessCallbackBridge( - (void)moveHueWithParams:(MTRColorControlClusterMoveHueParams *)params completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -53268,7 +53268,7 @@ new MTRCommandSuccessCallbackBridge( - (void)stepHueWithParams:(MTRColorControlClusterStepHueParams *)params completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -53300,7 +53300,7 @@ - (void)moveToSaturationWithParams:(MTRColorControlClusterMoveToSaturationParams completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -53331,7 +53331,7 @@ - (void)moveSaturationWithParams:(MTRColorControlClusterMoveSaturationParams *)p completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -53362,7 +53362,7 @@ - (void)stepSaturationWithParams:(MTRColorControlClusterStepSaturationParams *)p completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -53394,7 +53394,7 @@ - (void)moveToHueAndSaturationWithParams:(MTRColorControlClusterMoveToHueAndSatu completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -53426,7 +53426,7 @@ - (void)moveToColorWithParams:(MTRColorControlClusterMoveToColorParams *)params completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -53457,7 +53457,7 @@ new MTRCommandSuccessCallbackBridge( - (void)moveColorWithParams:(MTRColorControlClusterMoveColorParams *)params completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -53487,7 +53487,7 @@ new MTRCommandSuccessCallbackBridge( - (void)stepColorWithParams:(MTRColorControlClusterStepColorParams *)params completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -53519,7 +53519,7 @@ - (void)moveToColorTemperatureWithParams:(MTRColorControlClusterMoveToColorTempe completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -53550,7 +53550,7 @@ - (void)enhancedMoveToHueWithParams:(MTRColorControlClusterEnhancedMoveToHuePara completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -53583,7 +53583,7 @@ - (void)enhancedMoveHueWithParams:(MTRColorControlClusterEnhancedMoveHueParams * completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -53614,7 +53614,7 @@ - (void)enhancedStepHueWithParams:(MTRColorControlClusterEnhancedStepHueParams * completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -53646,7 +53646,7 @@ - (void)enhancedMoveToHueAndSaturationWithParams:(MTRColorControlClusterEnhanced completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -53678,7 +53678,7 @@ - (void)colorLoopSetWithParams:(MTRColorControlClusterColorLoopSetParams *)param completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -53714,7 +53714,7 @@ - (void)stopMoveStepWithParams:(MTRColorControlClusterStopMoveStepParams *)param completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -53743,7 +53743,7 @@ - (void)moveColorTemperatureWithParams:(MTRColorControlClusterMoveColorTemperatu completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -53776,7 +53776,7 @@ - (void)stepColorTemperatureWithParams:(MTRColorControlClusterStepColorTemperatu completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -53828,7 +53828,7 @@ - (void)subscribeAttributeCurrentHueWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -53897,7 +53897,7 @@ - (void)subscribeAttributeCurrentSaturationWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -53967,7 +53967,7 @@ - (void)subscribeAttributeRemainingTimeWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -54036,7 +54036,7 @@ - (void)subscribeAttributeCurrentXWithMinInterval:(NSNumber * _Nonnull)minInterv // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -54104,7 +54104,7 @@ - (void)subscribeAttributeCurrentYWithMinInterval:(NSNumber * _Nonnull)minInterv // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -54173,7 +54173,7 @@ - (void)subscribeAttributeDriftCompensationWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -54243,7 +54243,7 @@ - (void)subscribeAttributeCompensationTextWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -54313,7 +54313,7 @@ - (void)subscribeAttributeColorTemperatureWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -54382,7 +54382,7 @@ - (void)subscribeAttributeColorModeWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -54449,7 +54449,7 @@ - (void)writeAttributeOptionsWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -54487,7 +54487,7 @@ - (void)subscribeAttributeOptionsWithMinInterval:(NSNumber * _Nonnull)minInterva // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -54556,7 +54556,7 @@ - (void)subscribeAttributeNumberOfPrimariesWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -54625,7 +54625,7 @@ - (void)subscribeAttributePrimary1XWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -54693,7 +54693,7 @@ - (void)subscribeAttributePrimary1YWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -54762,7 +54762,7 @@ - (void)subscribeAttributePrimary1IntensityWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -54831,7 +54831,7 @@ - (void)subscribeAttributePrimary2XWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -54899,7 +54899,7 @@ - (void)subscribeAttributePrimary2YWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -54968,7 +54968,7 @@ - (void)subscribeAttributePrimary2IntensityWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -55037,7 +55037,7 @@ - (void)subscribeAttributePrimary3XWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -55105,7 +55105,7 @@ - (void)subscribeAttributePrimary3YWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -55174,7 +55174,7 @@ - (void)subscribeAttributePrimary3IntensityWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -55243,7 +55243,7 @@ - (void)subscribeAttributePrimary4XWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -55311,7 +55311,7 @@ - (void)subscribeAttributePrimary4YWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -55380,7 +55380,7 @@ - (void)subscribeAttributePrimary4IntensityWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -55449,7 +55449,7 @@ - (void)subscribeAttributePrimary5XWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -55517,7 +55517,7 @@ - (void)subscribeAttributePrimary5YWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -55586,7 +55586,7 @@ - (void)subscribeAttributePrimary5IntensityWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -55655,7 +55655,7 @@ - (void)subscribeAttributePrimary6XWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -55723,7 +55723,7 @@ - (void)subscribeAttributePrimary6YWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -55792,7 +55792,7 @@ - (void)subscribeAttributePrimary6IntensityWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -55861,7 +55861,7 @@ - (void)writeAttributeWhitePointXWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -55899,7 +55899,7 @@ - (void)subscribeAttributeWhitePointXWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -55968,7 +55968,7 @@ - (void)writeAttributeWhitePointYWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -56006,7 +56006,7 @@ - (void)subscribeAttributeWhitePointYWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -56075,7 +56075,7 @@ - (void)writeAttributeColorPointRXWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -56113,7 +56113,7 @@ - (void)subscribeAttributeColorPointRXWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -56182,7 +56182,7 @@ - (void)writeAttributeColorPointRYWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -56220,7 +56220,7 @@ - (void)subscribeAttributeColorPointRYWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -56290,7 +56290,7 @@ - (void)writeAttributeColorPointRIntensityWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -56335,7 +56335,7 @@ - (void)subscribeAttributeColorPointRIntensityWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -56404,7 +56404,7 @@ - (void)writeAttributeColorPointGXWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -56442,7 +56442,7 @@ - (void)subscribeAttributeColorPointGXWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -56511,7 +56511,7 @@ - (void)writeAttributeColorPointGYWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -56549,7 +56549,7 @@ - (void)subscribeAttributeColorPointGYWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -56619,7 +56619,7 @@ - (void)writeAttributeColorPointGIntensityWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -56664,7 +56664,7 @@ - (void)subscribeAttributeColorPointGIntensityWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -56733,7 +56733,7 @@ - (void)writeAttributeColorPointBXWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -56771,7 +56771,7 @@ - (void)subscribeAttributeColorPointBXWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -56840,7 +56840,7 @@ - (void)writeAttributeColorPointBYWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -56878,7 +56878,7 @@ - (void)subscribeAttributeColorPointBYWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -56948,7 +56948,7 @@ - (void)writeAttributeColorPointBIntensityWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -56993,7 +56993,7 @@ - (void)subscribeAttributeColorPointBIntensityWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -57063,7 +57063,7 @@ - (void)subscribeAttributeEnhancedCurrentHueWithMinInterval:(NSNumber * _Nonnull // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -57133,7 +57133,7 @@ - (void)subscribeAttributeEnhancedColorModeWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -57203,7 +57203,7 @@ - (void)subscribeAttributeColorLoopActiveWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -57273,7 +57273,7 @@ - (void)subscribeAttributeColorLoopDirectionWithMinInterval:(NSNumber * _Nonnull // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -57343,7 +57343,7 @@ - (void)subscribeAttributeColorLoopTimeWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -57414,7 +57414,7 @@ - (void)subscribeAttributeColorLoopStartEnhancedHueWithMinInterval:(NSNumber * _ // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -57485,7 +57485,7 @@ - (void)subscribeAttributeColorLoopStoredEnhancedHueWithMinInterval:(NSNumber * // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -57555,7 +57555,7 @@ - (void)subscribeAttributeColorCapabilitiesWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -57626,7 +57626,7 @@ - (void)subscribeAttributeColorTempPhysicalMinMiredsWithMinInterval:(NSNumber * // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -57697,7 +57697,7 @@ - (void)subscribeAttributeColorTempPhysicalMaxMiredsWithMinInterval:(NSNumber * // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -57768,7 +57768,7 @@ - (void)subscribeAttributeCoupleColorTempToLevelMinMiredsWithMinInterval:(NSNumb // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -57840,7 +57840,7 @@ - (void)writeAttributeStartUpColorTemperatureMiredsWithValue:(NSNumber * _Nonnul completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -57880,7 +57880,7 @@ - (void)subscribeAttributeStartUpColorTemperatureMiredsWithMinInterval:(NSNumber // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -57951,7 +57951,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRColorControlGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -58023,7 +58023,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRColorControlAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -58093,7 +58093,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRColorControlAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -58163,7 +58163,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -58232,7 +58232,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -58319,7 +58319,7 @@ - (void)subscribeAttributePhysicalMinLevelWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -58389,7 +58389,7 @@ - (void)subscribeAttributePhysicalMaxLevelWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -58459,7 +58459,7 @@ - (void)subscribeAttributeBallastStatusWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -58528,7 +58528,7 @@ - (void)writeAttributeMinLevelWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -58566,7 +58566,7 @@ - (void)subscribeAttributeMinLevelWithMinInterval:(NSNumber * _Nonnull)minInterv // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -58634,7 +58634,7 @@ - (void)writeAttributeMaxLevelWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -58672,7 +58672,7 @@ - (void)subscribeAttributeMaxLevelWithMinInterval:(NSNumber * _Nonnull)minInterv // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -58743,7 +58743,7 @@ - (void)writeAttributeIntrinsicBalanceFactorWithValue:(NSNumber * _Nullable)valu completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -58788,7 +58788,7 @@ - (void)subscribeAttributeIntrinsicBalanceFactorWithMinInterval:(NSNumber * _Non // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -58860,7 +58860,7 @@ - (void)writeAttributeBallastFactorAdjustmentWithValue:(NSNumber * _Nullable)val completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -58905,7 +58905,7 @@ - (void)subscribeAttributeBallastFactorAdjustmentWithMinInterval:(NSNumber * _No // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -58974,7 +58974,7 @@ - (void)subscribeAttributeLampQuantityWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -59043,7 +59043,7 @@ - (void)writeAttributeLampTypeWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -59081,7 +59081,7 @@ - (void)subscribeAttributeLampTypeWithMinInterval:(NSNumber * _Nonnull)minInterv // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -59149,7 +59149,7 @@ - (void)writeAttributeLampManufacturerWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -59188,7 +59188,7 @@ - (void)subscribeAttributeLampManufacturerWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -59257,7 +59257,7 @@ - (void)writeAttributeLampRatedHoursWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -59301,7 +59301,7 @@ - (void)subscribeAttributeLampRatedHoursWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -59370,7 +59370,7 @@ - (void)writeAttributeLampBurnHoursWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -59414,7 +59414,7 @@ - (void)subscribeAttributeLampBurnHoursWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -59483,7 +59483,7 @@ - (void)writeAttributeLampAlarmModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -59522,7 +59522,7 @@ - (void)subscribeAttributeLampAlarmModeWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -59594,7 +59594,7 @@ - (void)writeAttributeLampBurnHoursTripPointWithValue:(NSNumber * _Nullable)valu completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -59639,7 +59639,7 @@ - (void)subscribeAttributeLampBurnHoursTripPointWithMinInterval:(NSNumber * _Non // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -59710,7 +59710,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBallastConfigurationGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -59782,7 +59782,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBallastConfigurationAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -59852,7 +59852,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBallastConfigurationAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -59922,7 +59922,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -59991,7 +59991,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -60078,7 +60078,7 @@ - (void)subscribeAttributeMeasuredValueWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -60148,7 +60148,7 @@ - (void)subscribeAttributeMinMeasuredValueWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -60218,7 +60218,7 @@ - (void)subscribeAttributeMaxMeasuredValueWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -60287,7 +60287,7 @@ - (void)subscribeAttributeToleranceWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -60356,7 +60356,7 @@ - (void)subscribeAttributeLightSensorTypeWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -60427,7 +60427,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRIlluminanceMeasurementGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -60499,7 +60499,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRIlluminanceMeasurementAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -60569,7 +60569,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRIlluminanceMeasurementAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -60639,7 +60639,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -60708,7 +60708,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -60795,7 +60795,7 @@ - (void)subscribeAttributeMeasuredValueWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -60865,7 +60865,7 @@ - (void)subscribeAttributeMinMeasuredValueWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -60935,7 +60935,7 @@ - (void)subscribeAttributeMaxMeasuredValueWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -61004,7 +61004,7 @@ - (void)subscribeAttributeToleranceWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -61074,7 +61074,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTemperatureMeasurementGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -61146,7 +61146,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTemperatureMeasurementAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -61216,7 +61216,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTemperatureMeasurementAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -61286,7 +61286,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -61355,7 +61355,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -61442,7 +61442,7 @@ - (void)subscribeAttributeMeasuredValueWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -61512,7 +61512,7 @@ - (void)subscribeAttributeMinMeasuredValueWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -61582,7 +61582,7 @@ - (void)subscribeAttributeMaxMeasuredValueWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -61651,7 +61651,7 @@ - (void)subscribeAttributeToleranceWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -61719,7 +61719,7 @@ - (void)subscribeAttributeScaledValueWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -61789,7 +61789,7 @@ - (void)subscribeAttributeMinScaledValueWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -61859,7 +61859,7 @@ - (void)subscribeAttributeMaxScaledValueWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -61929,7 +61929,7 @@ - (void)subscribeAttributeScaledToleranceWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -61997,7 +61997,7 @@ - (void)subscribeAttributeScaleWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -62067,7 +62067,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRPressureMeasurementGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -62139,7 +62139,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRPressureMeasurementAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -62209,7 +62209,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRPressureMeasurementAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -62279,7 +62279,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -62348,7 +62348,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -62435,7 +62435,7 @@ - (void)subscribeAttributeMeasuredValueWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -62505,7 +62505,7 @@ - (void)subscribeAttributeMinMeasuredValueWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -62575,7 +62575,7 @@ - (void)subscribeAttributeMaxMeasuredValueWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -62644,7 +62644,7 @@ - (void)subscribeAttributeToleranceWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -62714,7 +62714,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRFlowMeasurementGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -62786,7 +62786,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRFlowMeasurementAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -62856,7 +62856,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRFlowMeasurementAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -62926,7 +62926,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -62995,7 +62995,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -63082,7 +63082,7 @@ - (void)subscribeAttributeMeasuredValueWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -63152,7 +63152,7 @@ - (void)subscribeAttributeMinMeasuredValueWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -63222,7 +63222,7 @@ - (void)subscribeAttributeMaxMeasuredValueWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -63291,7 +63291,7 @@ - (void)subscribeAttributeToleranceWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -63363,7 +63363,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRRelativeHumidityMeasurementGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -63439,7 +63439,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRRelativeHumidityMeasurementAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -63510,7 +63510,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRRelativeHumidityMeasurementAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -63580,7 +63580,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -63649,7 +63649,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -63735,7 +63735,7 @@ - (void)subscribeAttributeOccupancyWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -63805,7 +63805,7 @@ - (void)subscribeAttributeOccupancySensorTypeWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -63876,7 +63876,7 @@ - (void)subscribeAttributeOccupancySensorTypeBitmapWithMinInterval:(NSNumber * _ // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -63948,7 +63948,7 @@ - (void)writeAttributePirOccupiedToUnoccupiedDelayWithValue:(NSNumber * _Nonnull completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -63988,7 +63988,7 @@ - (void)subscribeAttributePirOccupiedToUnoccupiedDelayWithMinInterval:(NSNumber // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -64060,7 +64060,7 @@ - (void)writeAttributePirUnoccupiedToOccupiedDelayWithValue:(NSNumber * _Nonnull completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -64100,7 +64100,7 @@ - (void)subscribeAttributePirUnoccupiedToOccupiedDelayWithMinInterval:(NSNumber // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -64172,7 +64172,7 @@ - (void)writeAttributePirUnoccupiedToOccupiedThresholdWithValue:(NSNumber * _Non completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -64212,7 +64212,7 @@ - (void)subscribeAttributePirUnoccupiedToOccupiedThresholdWithMinInterval:(NSNum // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -64284,7 +64284,7 @@ - (void)writeAttributeUltrasonicOccupiedToUnoccupiedDelayWithValue:(NSNumber * _ completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -64324,7 +64324,7 @@ - (void)subscribeAttributeUltrasonicOccupiedToUnoccupiedDelayWithMinInterval:(NS // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -64396,7 +64396,7 @@ - (void)writeAttributeUltrasonicUnoccupiedToOccupiedDelayWithValue:(NSNumber * _ completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -64436,7 +64436,7 @@ - (void)subscribeAttributeUltrasonicUnoccupiedToOccupiedDelayWithMinInterval:(NS // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -64508,7 +64508,7 @@ - (void)writeAttributeUltrasonicUnoccupiedToOccupiedThresholdWithValue:(NSNumber completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -64548,7 +64548,7 @@ - (void)subscribeAttributeUltrasonicUnoccupiedToOccupiedThresholdWithMinInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -64620,7 +64620,7 @@ - (void)writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:(NSNumbe completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -64660,7 +64660,7 @@ - (void)subscribeAttributePhysicalContactOccupiedToUnoccupiedDelayWithMinInterva // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -64733,7 +64733,7 @@ - (void)writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:(NSNumbe completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -64773,7 +64773,7 @@ - (void)subscribeAttributePhysicalContactUnoccupiedToOccupiedDelayWithMinInterva // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -64846,7 +64846,7 @@ - (void)writeAttributePhysicalContactUnoccupiedToOccupiedThresholdWithValue:(NSN completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -64886,7 +64886,7 @@ - (void)subscribeAttributePhysicalContactUnoccupiedToOccupiedThresholdWithMinInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -64958,7 +64958,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROccupancySensingGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -65030,7 +65030,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROccupancySensingAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -65100,7 +65100,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROccupancySensingAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -65170,7 +65170,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -65239,7 +65239,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -65325,7 +65325,7 @@ - (void)subscribeAttributeMACAddressWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -65395,7 +65395,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRWakeOnLanGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -65467,7 +65467,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRWakeOnLanAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -65537,7 +65537,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRWakeOnLanAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -65607,7 +65607,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -65676,7 +65676,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -65745,7 +65745,7 @@ - (void)changeChannelWithParams:(MTRChannelClusterChangeChannelParams *)params NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRChannelClusterChangeChannelResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -65769,7 +65769,7 @@ - (void)changeChannelByNumberWithParams:(MTRChannelClusterChangeChannelByNumberP completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -65797,7 +65797,7 @@ new MTRCommandSuccessCallbackBridge( - (void)skipChannelWithParams:(MTRChannelClusterSkipChannelParams *)params completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -65843,7 +65843,7 @@ - (void)subscribeAttributeChannelListWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRChannelChannelListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -65912,7 +65912,7 @@ - (void)subscribeAttributeLineupWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRChannelLineupStructAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -65982,7 +65982,7 @@ - (void)subscribeAttributeCurrentChannelWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRChannelCurrentChannelStructAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -66054,7 +66054,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRChannelGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -66126,7 +66126,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRChannelAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -66196,7 +66196,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRChannelAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -66265,7 +66265,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -66334,7 +66334,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -66403,7 +66403,7 @@ - (void)navigateTargetWithParams:(MTRTargetNavigatorClusterNavigateTargetParams NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTargetNavigatorClusterNavigateTargetResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -66449,7 +66449,7 @@ - (void)subscribeAttributeTargetListWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTargetNavigatorTargetListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -66519,7 +66519,7 @@ - (void)subscribeAttributeCurrentTargetWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -66590,7 +66590,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTargetNavigatorGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -66662,7 +66662,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTargetNavigatorAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -66732,7 +66732,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTargetNavigatorAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -66802,7 +66802,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -66871,7 +66871,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -66945,7 +66945,7 @@ - (void)playWithParams:(MTRMediaPlaybackClusterPlayParams * _Nullable)params (void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -66974,7 +66974,7 @@ - (void)pauseWithParams:(MTRMediaPlaybackClusterPauseParams * _Nullable)params (void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -67003,7 +67003,7 @@ - (void)stopPlaybackWithParams:(MTRMediaPlaybackClusterStopPlaybackParams * _Nul NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -67032,7 +67032,7 @@ - (void)startOverWithParams:(MTRMediaPlaybackClusterStartOverParams * _Nullable) (void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -67061,7 +67061,7 @@ - (void)previousWithParams:(MTRMediaPlaybackClusterPreviousParams * _Nullable)pa (void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -67090,7 +67090,7 @@ - (void)nextWithParams:(MTRMediaPlaybackClusterNextParams * _Nullable)params (void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -67119,7 +67119,7 @@ - (void)rewindWithParams:(MTRMediaPlaybackClusterRewindParams * _Nullable)params (void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -67148,7 +67148,7 @@ - (void)fastForwardWithParams:(MTRMediaPlaybackClusterFastForwardParams * _Nulla NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -67172,7 +67172,7 @@ - (void)skipForwardWithParams:(MTRMediaPlaybackClusterSkipForwardParams *)params NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -67197,7 +67197,7 @@ - (void)skipBackwardWithParams:(MTRMediaPlaybackClusterSkipBackwardParams *)para NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -67222,7 +67222,7 @@ - (void)seekWithParams:(MTRMediaPlaybackClusterSeekParams *)params (void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -67264,7 +67264,7 @@ - (void)subscribeAttributeCurrentStateWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRMediaPlaybackClusterPlaybackStateEnumAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -67334,7 +67334,7 @@ - (void)subscribeAttributeStartTimeWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt64uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -67402,7 +67402,7 @@ - (void)subscribeAttributeDurationWithMinInterval:(NSNumber * _Nonnull)minInterv // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt64uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -67471,7 +67471,7 @@ - (void)subscribeAttributeSampledPositionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRMediaPlaybackSampledPositionStructAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -67542,7 +67542,7 @@ - (void)subscribeAttributePlaybackSpeedWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRFloatAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -67611,7 +67611,7 @@ - (void)subscribeAttributeSeekRangeEndWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt64uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -67681,7 +67681,7 @@ - (void)subscribeAttributeSeekRangeStartWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt64uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -67752,7 +67752,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRMediaPlaybackGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -67824,7 +67824,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRMediaPlaybackAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -67894,7 +67894,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRMediaPlaybackAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -67964,7 +67964,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -68033,7 +68033,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -68100,7 +68100,7 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoi - (void)selectInputWithParams:(MTRMediaInputClusterSelectInputParams *)params completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -68132,7 +68132,7 @@ - (void)showInputStatusWithParams:(MTRMediaInputClusterShowInputStatusParams * _ completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -68163,7 +68163,7 @@ - (void)hideInputStatusWithParams:(MTRMediaInputClusterHideInputStatusParams * _ completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -68189,7 +68189,7 @@ new MTRCommandSuccessCallbackBridge( - (void)renameInputWithParams:(MTRMediaInputClusterRenameInputParams *)params completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -68236,7 +68236,7 @@ - (void)subscribeAttributeInputListWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRMediaInputInputListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -68304,7 +68304,7 @@ - (void)subscribeAttributeCurrentInputWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -68375,7 +68375,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRMediaInputGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -68447,7 +68447,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRMediaInputAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -68517,7 +68517,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRMediaInputAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -68587,7 +68587,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -68656,7 +68656,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -68727,7 +68727,7 @@ - (void)sleepWithCompletionHandler:(StatusCompletion)completionHandler - (void)sleepWithParams:(MTRLowPowerClusterSleepParams * _Nullable)params completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -68774,7 +68774,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRLowPowerGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -68846,7 +68846,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRLowPowerAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -68916,7 +68916,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRLowPowerAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -68986,7 +68986,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -69055,7 +69055,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -69124,7 +69124,7 @@ - (void)sendKeyWithParams:(MTRKeypadInputClusterSendKeyParams *)params (void (^)(MTRKeypadInputClusterSendKeyResponseParams * _Nullable data, NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRKeypadInputClusterSendKeyResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -69168,7 +69168,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRKeypadInputGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -69240,7 +69240,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRKeypadInputAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -69310,7 +69310,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRKeypadInputAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -69380,7 +69380,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -69449,7 +69449,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -69518,7 +69518,7 @@ - (void)launchContentWithParams:(MTRContentLauncherClusterLaunchContentParams *) NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRContentLauncherClusterLaunchResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -69599,7 +69599,7 @@ - (void)launchURLWithParams:(MTRContentLauncherClusterLaunchURLParams *)params (void (^)(MTRContentLauncherClusterLaunchResponseParams * _Nullable data, NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRContentLauncherClusterLaunchResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -69739,7 +69739,7 @@ - (void)subscribeAttributeAcceptHeaderWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRContentLauncherAcceptHeaderListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -69812,7 +69812,7 @@ - (void)writeAttributeSupportedStreamingProtocolsWithValue:(NSNumber * _Nonnull) completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -69852,7 +69852,7 @@ - (void)subscribeAttributeSupportedStreamingProtocolsWithMinInterval:(NSNumber * // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -69923,7 +69923,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRContentLauncherGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -69995,7 +69995,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRContentLauncherAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -70065,7 +70065,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRContentLauncherAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -70135,7 +70135,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -70204,7 +70204,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -70272,7 +70272,7 @@ - (void)selectOutputWithParams:(MTRAudioOutputClusterSelectOutputParams *)params completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -70300,7 +70300,7 @@ - (void)renameOutputWithParams:(MTRAudioOutputClusterRenameOutputParams *)params completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -70347,7 +70347,7 @@ - (void)subscribeAttributeOutputListWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRAudioOutputOutputListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -70417,7 +70417,7 @@ - (void)subscribeAttributeCurrentOutputWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -70488,7 +70488,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRAudioOutputGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -70560,7 +70560,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRAudioOutputAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -70630,7 +70630,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRAudioOutputAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -70700,7 +70700,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -70769,7 +70769,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -70838,7 +70838,7 @@ - (void)launchAppWithParams:(MTRApplicationLauncherClusterLaunchAppParams *)para NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRApplicationLauncherClusterLauncherResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -70868,7 +70868,7 @@ - (void)stopAppWithParams:(MTRApplicationLauncherClusterStopAppParams *)params NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRApplicationLauncherClusterLauncherResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -70894,7 +70894,7 @@ - (void)hideAppWithParams:(MTRApplicationLauncherClusterHideAppParams *)params NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRApplicationLauncherClusterLauncherResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -70937,7 +70937,7 @@ - (void)subscribeAttributeCatalogListWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRApplicationLauncherCatalogListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -71009,7 +71009,7 @@ - (void)writeAttributeCurrentAppWithValue:(MTRApplicationLauncherClusterApplicat completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -71058,7 +71058,7 @@ - (void)subscribeAttributeCurrentAppWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRApplicationLauncherCurrentAppStructAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -71130,7 +71130,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRApplicationLauncherGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -71202,7 +71202,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRApplicationLauncherAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -71272,7 +71272,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRApplicationLauncherAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -71342,7 +71342,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -71411,7 +71411,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -71497,7 +71497,7 @@ - (void)subscribeAttributeVendorNameWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -71565,7 +71565,7 @@ - (void)subscribeAttributeVendorIDWithMinInterval:(NSNumber * _Nonnull)minInterv // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRVendorIdAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -71634,7 +71634,7 @@ - (void)subscribeAttributeApplicationNameWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -71703,7 +71703,7 @@ - (void)subscribeAttributeProductIDWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -71773,7 +71773,7 @@ - (void)subscribeAttributeApplicationWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRApplicationBasicApplicationStructAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -71843,7 +71843,7 @@ - (void)subscribeAttributeStatusWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRApplicationBasicClusterApplicationStatusEnumAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -71913,7 +71913,7 @@ - (void)subscribeAttributeApplicationVersionWithMinInterval:(NSNumber * _Nonnull // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -71983,7 +71983,7 @@ - (void)subscribeAttributeAllowedVendorListWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRApplicationBasicAllowedVendorListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -72055,7 +72055,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRApplicationBasicGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -72127,7 +72127,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRApplicationBasicAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -72197,7 +72197,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRApplicationBasicAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -72267,7 +72267,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -72336,7 +72336,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -72405,7 +72405,7 @@ - (void)getSetupPINWithParams:(MTRAccountLoginClusterGetSetupPINParams *)params NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRAccountLoginClusterGetSetupPINResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -72431,7 +72431,7 @@ new MTRAccountLoginClusterGetSetupPINResponseCallbackBridge(self.callbackQueue, - (void)loginWithParams:(MTRAccountLoginClusterLoginParams *)params completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -72467,7 +72467,7 @@ - (void)logoutWithParams:(MTRAccountLoginClusterLogoutParams * _Nullable)params completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -72517,7 +72517,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRAccountLoginGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -72589,7 +72589,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRAccountLoginAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -72659,7 +72659,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRAccountLoginAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -72729,7 +72729,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -72798,7 +72798,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -72870,7 +72870,7 @@ - (void)getProfileInfoCommandWithParams:(MTRElectricalMeasurementClusterGetProfi completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -72897,7 +72897,7 @@ - (void)getMeasurementProfileCommandWithParams:(MTRElectricalMeasurementClusterG completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -72946,7 +72946,7 @@ - (void)subscribeAttributeMeasurementTypeWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -73015,7 +73015,7 @@ - (void)subscribeAttributeDcVoltageWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -73083,7 +73083,7 @@ - (void)subscribeAttributeDcVoltageMinWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -73152,7 +73152,7 @@ - (void)subscribeAttributeDcVoltageMaxWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -73221,7 +73221,7 @@ - (void)subscribeAttributeDcCurrentWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -73289,7 +73289,7 @@ - (void)subscribeAttributeDcCurrentMinWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -73358,7 +73358,7 @@ - (void)subscribeAttributeDcCurrentMaxWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -73426,7 +73426,7 @@ - (void)subscribeAttributeDcPowerWithMinInterval:(NSNumber * _Nonnull)minInterva // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -73494,7 +73494,7 @@ - (void)subscribeAttributeDcPowerMinWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -73562,7 +73562,7 @@ - (void)subscribeAttributeDcPowerMaxWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -73632,7 +73632,7 @@ - (void)subscribeAttributeDcVoltageMultiplierWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -73702,7 +73702,7 @@ - (void)subscribeAttributeDcVoltageDivisorWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -73773,7 +73773,7 @@ - (void)subscribeAttributeDcCurrentMultiplierWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -73843,7 +73843,7 @@ - (void)subscribeAttributeDcCurrentDivisorWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -73913,7 +73913,7 @@ - (void)subscribeAttributeDcPowerMultiplierWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -73983,7 +73983,7 @@ - (void)subscribeAttributeDcPowerDivisorWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -74052,7 +74052,7 @@ - (void)subscribeAttributeAcFrequencyWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -74122,7 +74122,7 @@ - (void)subscribeAttributeAcFrequencyMinWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -74192,7 +74192,7 @@ - (void)subscribeAttributeAcFrequencyMaxWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -74262,7 +74262,7 @@ - (void)subscribeAttributeNeutralCurrentWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -74332,7 +74332,7 @@ - (void)subscribeAttributeTotalActivePowerWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -74402,7 +74402,7 @@ - (void)subscribeAttributeTotalReactivePowerWithMinInterval:(NSNumber * _Nonnull // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -74472,7 +74472,7 @@ - (void)subscribeAttributeTotalApparentPowerWithMinInterval:(NSNumber * _Nonnull // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -74543,7 +74543,7 @@ - (void)subscribeAttributeMeasured1stHarmonicCurrentWithMinInterval:(NSNumber * // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -74614,7 +74614,7 @@ - (void)subscribeAttributeMeasured3rdHarmonicCurrentWithMinInterval:(NSNumber * // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -74685,7 +74685,7 @@ - (void)subscribeAttributeMeasured5thHarmonicCurrentWithMinInterval:(NSNumber * // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -74756,7 +74756,7 @@ - (void)subscribeAttributeMeasured7thHarmonicCurrentWithMinInterval:(NSNumber * // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -74827,7 +74827,7 @@ - (void)subscribeAttributeMeasured9thHarmonicCurrentWithMinInterval:(NSNumber * // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -74898,7 +74898,7 @@ - (void)subscribeAttributeMeasured11thHarmonicCurrentWithMinInterval:(NSNumber * // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -74969,7 +74969,7 @@ - (void)subscribeAttributeMeasuredPhase1stHarmonicCurrentWithMinInterval:(NSNumb // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -75040,7 +75040,7 @@ - (void)subscribeAttributeMeasuredPhase3rdHarmonicCurrentWithMinInterval:(NSNumb // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -75111,7 +75111,7 @@ - (void)subscribeAttributeMeasuredPhase5thHarmonicCurrentWithMinInterval:(NSNumb // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -75182,7 +75182,7 @@ - (void)subscribeAttributeMeasuredPhase7thHarmonicCurrentWithMinInterval:(NSNumb // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -75253,7 +75253,7 @@ - (void)subscribeAttributeMeasuredPhase9thHarmonicCurrentWithMinInterval:(NSNumb // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -75324,7 +75324,7 @@ - (void)subscribeAttributeMeasuredPhase11thHarmonicCurrentWithMinInterval:(NSNum // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -75395,7 +75395,7 @@ - (void)subscribeAttributeAcFrequencyMultiplierWithMinInterval:(NSNumber * _Nonn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -75465,7 +75465,7 @@ - (void)subscribeAttributeAcFrequencyDivisorWithMinInterval:(NSNumber * _Nonnull // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -75535,7 +75535,7 @@ - (void)subscribeAttributePowerMultiplierWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -75604,7 +75604,7 @@ - (void)subscribeAttributePowerDivisorWithMinInterval:(NSNumber * _Nonnull)minIn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -75675,7 +75675,7 @@ - (void)subscribeAttributeHarmonicCurrentMultiplierWithMinInterval:(NSNumber * _ // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -75746,7 +75746,7 @@ - (void)subscribeAttributePhaseHarmonicCurrentMultiplierWithMinInterval:(NSNumbe // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -75817,7 +75817,7 @@ - (void)subscribeAttributeInstantaneousVoltageWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -75888,7 +75888,7 @@ - (void)subscribeAttributeInstantaneousLineCurrentWithMinInterval:(NSNumber * _N // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -75959,7 +75959,7 @@ - (void)subscribeAttributeInstantaneousActiveCurrentWithMinInterval:(NSNumber * // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -76030,7 +76030,7 @@ - (void)subscribeAttributeInstantaneousReactiveCurrentWithMinInterval:(NSNumber // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -76100,7 +76100,7 @@ - (void)subscribeAttributeInstantaneousPowerWithMinInterval:(NSNumber * _Nonnull // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -76169,7 +76169,7 @@ - (void)subscribeAttributeRmsVoltageWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -76238,7 +76238,7 @@ - (void)subscribeAttributeRmsVoltageMinWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -76308,7 +76308,7 @@ - (void)subscribeAttributeRmsVoltageMaxWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -76377,7 +76377,7 @@ - (void)subscribeAttributeRmsCurrentWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -76446,7 +76446,7 @@ - (void)subscribeAttributeRmsCurrentMinWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -76516,7 +76516,7 @@ - (void)subscribeAttributeRmsCurrentMaxWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -76585,7 +76585,7 @@ - (void)subscribeAttributeActivePowerWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -76655,7 +76655,7 @@ - (void)subscribeAttributeActivePowerMinWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -76725,7 +76725,7 @@ - (void)subscribeAttributeActivePowerMaxWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -76795,7 +76795,7 @@ - (void)subscribeAttributeReactivePowerWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -76865,7 +76865,7 @@ - (void)subscribeAttributeApparentPowerWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -76934,7 +76934,7 @@ - (void)subscribeAttributePowerFactorWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -77006,7 +77006,7 @@ - (void)writeAttributeAverageRmsVoltageMeasurementPeriodWithValue:(NSNumber * _N completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -77046,7 +77046,7 @@ - (void)subscribeAttributeAverageRmsVoltageMeasurementPeriodWithMinInterval:(NSN // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -77118,7 +77118,7 @@ - (void)writeAttributeAverageRmsUnderVoltageCounterWithValue:(NSNumber * _Nonnul completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -77158,7 +77158,7 @@ - (void)subscribeAttributeAverageRmsUnderVoltageCounterWithMinInterval:(NSNumber // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -77230,7 +77230,7 @@ - (void)writeAttributeRmsExtremeOverVoltagePeriodWithValue:(NSNumber * _Nonnull) completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -77270,7 +77270,7 @@ - (void)subscribeAttributeRmsExtremeOverVoltagePeriodWithMinInterval:(NSNumber * // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -77342,7 +77342,7 @@ - (void)writeAttributeRmsExtremeUnderVoltagePeriodWithValue:(NSNumber * _Nonnull completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -77382,7 +77382,7 @@ - (void)subscribeAttributeRmsExtremeUnderVoltagePeriodWithMinInterval:(NSNumber // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -77451,7 +77451,7 @@ - (void)writeAttributeRmsVoltageSagPeriodWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -77491,7 +77491,7 @@ - (void)subscribeAttributeRmsVoltageSagPeriodWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -77561,7 +77561,7 @@ - (void)writeAttributeRmsVoltageSwellPeriodWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -77601,7 +77601,7 @@ - (void)subscribeAttributeRmsVoltageSwellPeriodWithMinInterval:(NSNumber * _Nonn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -77672,7 +77672,7 @@ - (void)subscribeAttributeAcVoltageMultiplierWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -77742,7 +77742,7 @@ - (void)subscribeAttributeAcVoltageDivisorWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -77813,7 +77813,7 @@ - (void)subscribeAttributeAcCurrentMultiplierWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -77883,7 +77883,7 @@ - (void)subscribeAttributeAcCurrentDivisorWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -77953,7 +77953,7 @@ - (void)subscribeAttributeAcPowerMultiplierWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -78023,7 +78023,7 @@ - (void)subscribeAttributeAcPowerDivisorWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -78092,7 +78092,7 @@ - (void)writeAttributeOverloadAlarmsMaskWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -78131,7 +78131,7 @@ - (void)subscribeAttributeOverloadAlarmsMaskWithMinInterval:(NSNumber * _Nonnull // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -78201,7 +78201,7 @@ - (void)subscribeAttributeVoltageOverloadWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -78271,7 +78271,7 @@ - (void)subscribeAttributeCurrentOverloadWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -78340,7 +78340,7 @@ - (void)writeAttributeAcOverloadAlarmsMaskWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -78380,7 +78380,7 @@ - (void)subscribeAttributeAcOverloadAlarmsMaskWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -78450,7 +78450,7 @@ - (void)subscribeAttributeAcVoltageOverloadWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -78520,7 +78520,7 @@ - (void)subscribeAttributeAcCurrentOverloadWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -78591,7 +78591,7 @@ - (void)subscribeAttributeAcActivePowerOverloadWithMinInterval:(NSNumber * _Nonn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -78662,7 +78662,7 @@ - (void)subscribeAttributeAcReactivePowerOverloadWithMinInterval:(NSNumber * _No // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -78733,7 +78733,7 @@ - (void)subscribeAttributeAverageRmsOverVoltageWithMinInterval:(NSNumber * _Nonn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -78804,7 +78804,7 @@ - (void)subscribeAttributeAverageRmsUnderVoltageWithMinInterval:(NSNumber * _Non // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -78875,7 +78875,7 @@ - (void)subscribeAttributeRmsExtremeOverVoltageWithMinInterval:(NSNumber * _Nonn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -78946,7 +78946,7 @@ - (void)subscribeAttributeRmsExtremeUnderVoltageWithMinInterval:(NSNumber * _Non // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -79016,7 +79016,7 @@ - (void)subscribeAttributeRmsVoltageSagWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -79086,7 +79086,7 @@ - (void)subscribeAttributeRmsVoltageSwellWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -79156,7 +79156,7 @@ - (void)subscribeAttributeLineCurrentPhaseBWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -79227,7 +79227,7 @@ - (void)subscribeAttributeActiveCurrentPhaseBWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -79298,7 +79298,7 @@ - (void)subscribeAttributeReactiveCurrentPhaseBWithMinInterval:(NSNumber * _Nonn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -79368,7 +79368,7 @@ - (void)subscribeAttributeRmsVoltagePhaseBWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -79439,7 +79439,7 @@ - (void)subscribeAttributeRmsVoltageMinPhaseBWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -79510,7 +79510,7 @@ - (void)subscribeAttributeRmsVoltageMaxPhaseBWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -79580,7 +79580,7 @@ - (void)subscribeAttributeRmsCurrentPhaseBWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -79651,7 +79651,7 @@ - (void)subscribeAttributeRmsCurrentMinPhaseBWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -79722,7 +79722,7 @@ - (void)subscribeAttributeRmsCurrentMaxPhaseBWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -79792,7 +79792,7 @@ - (void)subscribeAttributeActivePowerPhaseBWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -79863,7 +79863,7 @@ - (void)subscribeAttributeActivePowerMinPhaseBWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -79934,7 +79934,7 @@ - (void)subscribeAttributeActivePowerMaxPhaseBWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -80005,7 +80005,7 @@ - (void)subscribeAttributeReactivePowerPhaseBWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -80076,7 +80076,7 @@ - (void)subscribeAttributeApparentPowerPhaseBWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -80146,7 +80146,7 @@ - (void)subscribeAttributePowerFactorPhaseBWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -80217,7 +80217,7 @@ - (void)subscribeAttributeAverageRmsVoltageMeasurementPeriodPhaseBWithMinInterva // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -80289,7 +80289,7 @@ - (void)subscribeAttributeAverageRmsOverVoltageCounterPhaseBWithMinInterval:(NSN // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -80360,7 +80360,7 @@ - (void)subscribeAttributeAverageRmsUnderVoltageCounterPhaseBWithMinInterval:(NS // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -80431,7 +80431,7 @@ - (void)subscribeAttributeRmsExtremeOverVoltagePeriodPhaseBWithMinInterval:(NSNu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -80502,7 +80502,7 @@ - (void)subscribeAttributeRmsExtremeUnderVoltagePeriodPhaseBWithMinInterval:(NSN // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -80573,7 +80573,7 @@ - (void)subscribeAttributeRmsVoltageSagPeriodPhaseBWithMinInterval:(NSNumber * _ // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -80644,7 +80644,7 @@ - (void)subscribeAttributeRmsVoltageSwellPeriodPhaseBWithMinInterval:(NSNumber * // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -80714,7 +80714,7 @@ - (void)subscribeAttributeLineCurrentPhaseCWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -80785,7 +80785,7 @@ - (void)subscribeAttributeActiveCurrentPhaseCWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -80856,7 +80856,7 @@ - (void)subscribeAttributeReactiveCurrentPhaseCWithMinInterval:(NSNumber * _Nonn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -80926,7 +80926,7 @@ - (void)subscribeAttributeRmsVoltagePhaseCWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -80997,7 +80997,7 @@ - (void)subscribeAttributeRmsVoltageMinPhaseCWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -81068,7 +81068,7 @@ - (void)subscribeAttributeRmsVoltageMaxPhaseCWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -81138,7 +81138,7 @@ - (void)subscribeAttributeRmsCurrentPhaseCWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -81209,7 +81209,7 @@ - (void)subscribeAttributeRmsCurrentMinPhaseCWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -81280,7 +81280,7 @@ - (void)subscribeAttributeRmsCurrentMaxPhaseCWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -81350,7 +81350,7 @@ - (void)subscribeAttributeActivePowerPhaseCWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -81421,7 +81421,7 @@ - (void)subscribeAttributeActivePowerMinPhaseCWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -81492,7 +81492,7 @@ - (void)subscribeAttributeActivePowerMaxPhaseCWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -81563,7 +81563,7 @@ - (void)subscribeAttributeReactivePowerPhaseCWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -81634,7 +81634,7 @@ - (void)subscribeAttributeApparentPowerPhaseCWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -81704,7 +81704,7 @@ - (void)subscribeAttributePowerFactorPhaseCWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -81775,7 +81775,7 @@ - (void)subscribeAttributeAverageRmsVoltageMeasurementPeriodPhaseCWithMinInterva // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -81847,7 +81847,7 @@ - (void)subscribeAttributeAverageRmsOverVoltageCounterPhaseCWithMinInterval:(NSN // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -81918,7 +81918,7 @@ - (void)subscribeAttributeAverageRmsUnderVoltageCounterPhaseCWithMinInterval:(NS // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -81989,7 +81989,7 @@ - (void)subscribeAttributeRmsExtremeOverVoltagePeriodPhaseCWithMinInterval:(NSNu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -82060,7 +82060,7 @@ - (void)subscribeAttributeRmsExtremeUnderVoltagePeriodPhaseCWithMinInterval:(NSN // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -82131,7 +82131,7 @@ - (void)subscribeAttributeRmsVoltageSagPeriodPhaseCWithMinInterval:(NSNumber * _ // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -82202,7 +82202,7 @@ - (void)subscribeAttributeRmsVoltageSwellPeriodPhaseCWithMinInterval:(NSNumber * // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -82273,7 +82273,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRElectricalMeasurementGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -82345,7 +82345,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRElectricalMeasurementAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -82415,7 +82415,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRElectricalMeasurementAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -82485,7 +82485,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -82554,7 +82554,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -82625,7 +82625,7 @@ - (void)testWithCompletionHandler:(StatusCompletion)completionHandler - (void)testWithParams:(MTRTestClusterClusterTestParams * _Nullable)params completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -82656,7 +82656,7 @@ - (void)testNotHandledWithParams:(MTRTestClusterClusterTestNotHandledParams * _N completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -82689,7 +82689,7 @@ - (void)testSpecificWithParams:(MTRTestClusterClusterTestSpecificParams * _Nulla NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterClusterTestSpecificResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -82716,7 +82716,7 @@ - (void)testUnknownCommandWithParams:(MTRTestClusterClusterTestUnknownCommandPar completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -82744,7 +82744,7 @@ - (void)testAddArgumentsWithParams:(MTRTestClusterClusterTestAddArgumentsParams NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterClusterTestAddArgumentsResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -82770,7 +82770,7 @@ - (void)testSimpleArgumentRequestWithParams:(MTRTestClusterClusterTestSimpleArgu NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterClusterTestSimpleArgumentResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -82796,7 +82796,7 @@ - (void)testStructArrayArgumentRequestWithParams:(MTRTestClusterClusterTestStruc NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterClusterTestStructArrayArgumentResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -83030,7 +83030,7 @@ - (void)testStructArgumentRequestWithParams:(MTRTestClusterClusterTestStructArgu NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterClusterBooleanResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -83062,7 +83062,7 @@ - (void)testNestedStructArgumentRequestWithParams:(MTRTestClusterClusterTestNest NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterClusterBooleanResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -83096,7 +83096,7 @@ - (void)testListStructArgumentRequestWithParams:(MTRTestClusterClusterTestListSt NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterClusterBooleanResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -83151,7 +83151,7 @@ - (void)testListInt8UArgumentRequestWithParams:(MTRTestClusterClusterTestListInt NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterClusterBooleanResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -83197,7 +83197,7 @@ - (void)testNestedStructListArgumentRequestWithParams:(MTRTestClusterClusterTest NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterClusterBooleanResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -83329,7 +83329,7 @@ - (void)testListNestedStructListArgumentRequestWithParams: NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterClusterBooleanResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -83485,7 +83485,7 @@ - (void)testListInt8UReverseRequestWithParams:(MTRTestClusterClusterTestListInt8 NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterClusterTestListInt8UReverseResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -83531,7 +83531,7 @@ - (void)testEnumsRequestWithParams:(MTRTestClusterClusterTestEnumsRequestParams NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterClusterTestEnumsResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -83557,7 +83557,7 @@ - (void)testNullableOptionalRequestWithParams:(MTRTestClusterClusterTestNullable NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterClusterTestNullableOptionalResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -83593,7 +83593,7 @@ - (void)testComplexNullableOptionalRequestWithParams:(MTRTestClusterClusterTestC NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterClusterTestComplexNullableOptionalResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -83786,7 +83786,7 @@ - (void)simpleStructEchoRequestWithParams:(MTRTestClusterClusterSimpleStructEcho NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterClusterSimpleStructResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -83821,7 +83821,7 @@ - (void)timedInvokeRequestWithParams:(MTRTestClusterClusterTimedInvokeRequestPar completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -83851,7 +83851,7 @@ - (void)testSimpleOptionalArgumentRequestWithParams:(MTRTestClusterClusterTestSi completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, self.device, ^(id _Nullable value, NSError * _Nullable error) { @@ -83885,7 +83885,7 @@ - (void)testEmitTestEventRequestWithParams:(MTRTestClusterClusterTestEmitTestEve NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterClusterTestEmitTestEventResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -83914,7 +83914,7 @@ - (void)testEmitTestFabricScopedEventRequestWithParams:(MTRTestClusterClusterTes NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterClusterTestEmitTestFabricScopedEventResponseCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -83955,7 +83955,7 @@ - (void)writeAttributeBooleanWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -83993,7 +83993,7 @@ - (void)subscribeAttributeBooleanWithMinInterval:(NSNumber * _Nonnull)minInterva // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBooleanAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -84060,7 +84060,7 @@ - (void)writeAttributeBitmap8WithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -84098,7 +84098,7 @@ - (void)subscribeAttributeBitmap8WithMinInterval:(NSNumber * _Nonnull)minInterva // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterBitmap8AttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -84166,7 +84166,7 @@ - (void)writeAttributeBitmap16WithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -84204,7 +84204,7 @@ - (void)subscribeAttributeBitmap16WithMinInterval:(NSNumber * _Nonnull)minInterv // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterBitmap16AttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -84272,7 +84272,7 @@ - (void)writeAttributeBitmap32WithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -84310,7 +84310,7 @@ - (void)subscribeAttributeBitmap32WithMinInterval:(NSNumber * _Nonnull)minInterv // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterBitmap32AttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -84378,7 +84378,7 @@ - (void)writeAttributeBitmap64WithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -84416,7 +84416,7 @@ - (void)subscribeAttributeBitmap64WithMinInterval:(NSNumber * _Nonnull)minInterv // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterBitmap64AttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -84483,7 +84483,7 @@ - (void)writeAttributeInt8uWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -84521,7 +84521,7 @@ - (void)subscribeAttributeInt8uWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -84588,7 +84588,7 @@ - (void)writeAttributeInt16uWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -84626,7 +84626,7 @@ - (void)subscribeAttributeInt16uWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -84693,7 +84693,7 @@ - (void)writeAttributeInt24uWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -84731,7 +84731,7 @@ - (void)subscribeAttributeInt24uWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -84798,7 +84798,7 @@ - (void)writeAttributeInt32uWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -84836,7 +84836,7 @@ - (void)subscribeAttributeInt32uWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -84903,7 +84903,7 @@ - (void)writeAttributeInt40uWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -84941,7 +84941,7 @@ - (void)subscribeAttributeInt40uWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt64uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -85008,7 +85008,7 @@ - (void)writeAttributeInt48uWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -85046,7 +85046,7 @@ - (void)subscribeAttributeInt48uWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt64uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -85113,7 +85113,7 @@ - (void)writeAttributeInt56uWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -85151,7 +85151,7 @@ - (void)subscribeAttributeInt56uWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt64uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -85218,7 +85218,7 @@ - (void)writeAttributeInt64uWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -85256,7 +85256,7 @@ - (void)subscribeAttributeInt64uWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt64uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -85323,7 +85323,7 @@ - (void)writeAttributeInt8sWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -85361,7 +85361,7 @@ - (void)subscribeAttributeInt8sWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -85428,7 +85428,7 @@ - (void)writeAttributeInt16sWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -85466,7 +85466,7 @@ - (void)subscribeAttributeInt16sWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -85533,7 +85533,7 @@ - (void)writeAttributeInt24sWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -85571,7 +85571,7 @@ - (void)subscribeAttributeInt24sWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -85638,7 +85638,7 @@ - (void)writeAttributeInt32sWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -85676,7 +85676,7 @@ - (void)subscribeAttributeInt32sWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -85743,7 +85743,7 @@ - (void)writeAttributeInt40sWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -85781,7 +85781,7 @@ - (void)subscribeAttributeInt40sWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt64sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -85848,7 +85848,7 @@ - (void)writeAttributeInt48sWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -85886,7 +85886,7 @@ - (void)subscribeAttributeInt48sWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt64sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -85953,7 +85953,7 @@ - (void)writeAttributeInt56sWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -85991,7 +85991,7 @@ - (void)subscribeAttributeInt56sWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt64sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -86058,7 +86058,7 @@ - (void)writeAttributeInt64sWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -86096,7 +86096,7 @@ - (void)subscribeAttributeInt64sWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt64sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -86163,7 +86163,7 @@ - (void)writeAttributeEnum8WithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -86201,7 +86201,7 @@ - (void)subscribeAttributeEnum8WithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -86268,7 +86268,7 @@ - (void)writeAttributeEnum16WithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -86306,7 +86306,7 @@ - (void)subscribeAttributeEnum16WithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -86374,7 +86374,7 @@ - (void)writeAttributeFloatSingleWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -86412,7 +86412,7 @@ - (void)subscribeAttributeFloatSingleWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRFloatAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -86481,7 +86481,7 @@ - (void)writeAttributeFloatDoubleWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -86519,7 +86519,7 @@ - (void)subscribeAttributeFloatDoubleWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRDoubleAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -86588,7 +86588,7 @@ - (void)writeAttributeOctetStringWithValue:(NSData * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -86626,7 +86626,7 @@ - (void)subscribeAttributeOctetStringWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROctetStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -86694,7 +86694,7 @@ - (void)writeAttributeListInt8uWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -86753,7 +86753,7 @@ - (void)subscribeAttributeListInt8uWithMinInterval:(NSNumber * _Nonnull)minInter // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterListInt8uListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -86821,7 +86821,7 @@ - (void)writeAttributeListOctetStringWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -86881,7 +86881,7 @@ - (void)subscribeAttributeListOctetStringWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterListOctetStringListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -86951,7 +86951,7 @@ - (void)writeAttributeListStructOctetStringWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -87013,7 +87013,7 @@ - (void)subscribeAttributeListStructOctetStringWithMinInterval:(NSNumber * _Nonn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterListStructOctetStringListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -87083,7 +87083,7 @@ - (void)writeAttributeLongOctetStringWithValue:(NSData * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -87122,7 +87122,7 @@ - (void)subscribeAttributeLongOctetStringWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTROctetStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -87191,7 +87191,7 @@ - (void)writeAttributeCharStringWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -87229,7 +87229,7 @@ - (void)subscribeAttributeCharStringWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -87297,7 +87297,7 @@ - (void)writeAttributeLongCharStringWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -87336,7 +87336,7 @@ - (void)subscribeAttributeLongCharStringWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -87404,7 +87404,7 @@ - (void)writeAttributeEpochUsWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -87442,7 +87442,7 @@ - (void)subscribeAttributeEpochUsWithMinInterval:(NSNumber * _Nonnull)minInterva // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt64uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -87509,7 +87509,7 @@ - (void)writeAttributeEpochSWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -87547,7 +87547,7 @@ - (void)subscribeAttributeEpochSWithMinInterval:(NSNumber * _Nonnull)minInterval // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -87615,7 +87615,7 @@ - (void)writeAttributeVendorIdWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -87653,7 +87653,7 @@ - (void)subscribeAttributeVendorIdWithMinInterval:(NSNumber * _Nonnull)minInterv // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRVendorIdAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -87724,7 +87724,7 @@ - (void)writeAttributeListNullablesAndOptionalsStructWithValue:(NSArray * _Nonnu completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -87957,7 +87957,7 @@ - (void)subscribeAttributeListNullablesAndOptionalsStructWithMinInterval:(NSNumb // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterListNullablesAndOptionalsStructListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -88027,7 +88027,7 @@ - (void)writeAttributeEnumAttrWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -88065,7 +88065,7 @@ - (void)subscribeAttributeEnumAttrWithMinInterval:(NSNumber * _Nonnull)minInterv // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterClusterSimpleEnumAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -88137,7 +88137,7 @@ - (void)writeAttributeStructAttrWithValue:(MTRTestClusterClusterSimpleStruct * _ completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -88183,7 +88183,7 @@ - (void)subscribeAttributeStructAttrWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterStructAttrStructAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -88253,7 +88253,7 @@ - (void)writeAttributeRangeRestrictedInt8uWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -88293,7 +88293,7 @@ - (void)subscribeAttributeRangeRestrictedInt8uWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -88362,7 +88362,7 @@ - (void)writeAttributeRangeRestrictedInt8sWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -88402,7 +88402,7 @@ - (void)subscribeAttributeRangeRestrictedInt8sWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt8sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -88472,7 +88472,7 @@ - (void)writeAttributeRangeRestrictedInt16uWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -88512,7 +88512,7 @@ - (void)subscribeAttributeRangeRestrictedInt16uWithMinInterval:(NSNumber * _Nonn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -88582,7 +88582,7 @@ - (void)writeAttributeRangeRestrictedInt16sWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -88622,7 +88622,7 @@ - (void)subscribeAttributeRangeRestrictedInt16sWithMinInterval:(NSNumber * _Nonn // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -88691,7 +88691,7 @@ - (void)writeAttributeListLongOctetStringWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -88752,7 +88752,7 @@ - (void)subscribeAttributeListLongOctetStringWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterListLongOctetStringListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -88803,7 +88803,7 @@ new MTRTestClusterListLongOctetStringListAttributeCallbackBridge( - (void)readAttributeListFabricScopedWithParams:(MTRReadParams * _Nullable)params completionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterListFabricScopedListAttributeCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { using TypeInfo = TestCluster::Attributes::ListFabricScoped::TypeInfo; @@ -88824,7 +88824,7 @@ - (void)writeAttributeListFabricScopedWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -88940,7 +88940,7 @@ - (void)subscribeAttributeListFabricScopedWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterListFabricScopedListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -89010,7 +89010,7 @@ - (void)writeAttributeTimedWriteBooleanWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -89049,7 +89049,7 @@ - (void)subscribeAttributeTimedWriteBooleanWithMinInterval:(NSNumber * _Nonnull) // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBooleanAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -89118,7 +89118,7 @@ - (void)writeAttributeGeneralErrorBooleanWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -89158,7 +89158,7 @@ - (void)subscribeAttributeGeneralErrorBooleanWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBooleanAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -89227,7 +89227,7 @@ - (void)writeAttributeClusterErrorBooleanWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -89267,7 +89267,7 @@ - (void)subscribeAttributeClusterErrorBooleanWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBooleanAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -89336,7 +89336,7 @@ - (void)writeAttributeUnsupportedWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -89374,7 +89374,7 @@ - (void)subscribeAttributeUnsupportedWithMinInterval:(NSNumber * _Nonnull)minInt // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRBooleanAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -89443,7 +89443,7 @@ - (void)writeAttributeNullableBooleanWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -89487,7 +89487,7 @@ - (void)subscribeAttributeNullableBooleanWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableBooleanAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -89556,7 +89556,7 @@ - (void)writeAttributeNullableBitmap8WithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -89600,7 +89600,7 @@ - (void)subscribeAttributeNullableBitmap8WithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterNullableBitmap8AttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -89670,7 +89670,7 @@ - (void)writeAttributeNullableBitmap16WithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -89714,7 +89714,7 @@ - (void)subscribeAttributeNullableBitmap16WithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterNullableBitmap16AttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -89784,7 +89784,7 @@ - (void)writeAttributeNullableBitmap32WithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -89828,7 +89828,7 @@ - (void)subscribeAttributeNullableBitmap32WithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterNullableBitmap32AttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -89898,7 +89898,7 @@ - (void)writeAttributeNullableBitmap64WithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -89942,7 +89942,7 @@ - (void)subscribeAttributeNullableBitmap64WithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterNullableBitmap64AttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -90012,7 +90012,7 @@ - (void)writeAttributeNullableInt8uWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -90056,7 +90056,7 @@ - (void)subscribeAttributeNullableInt8uWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -90125,7 +90125,7 @@ - (void)writeAttributeNullableInt16uWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -90169,7 +90169,7 @@ - (void)subscribeAttributeNullableInt16uWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -90238,7 +90238,7 @@ - (void)writeAttributeNullableInt24uWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -90282,7 +90282,7 @@ - (void)subscribeAttributeNullableInt24uWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -90351,7 +90351,7 @@ - (void)writeAttributeNullableInt32uWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -90395,7 +90395,7 @@ - (void)subscribeAttributeNullableInt32uWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -90464,7 +90464,7 @@ - (void)writeAttributeNullableInt40uWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -90508,7 +90508,7 @@ - (void)subscribeAttributeNullableInt40uWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt64uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -90577,7 +90577,7 @@ - (void)writeAttributeNullableInt48uWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -90621,7 +90621,7 @@ - (void)subscribeAttributeNullableInt48uWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt64uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -90690,7 +90690,7 @@ - (void)writeAttributeNullableInt56uWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -90734,7 +90734,7 @@ - (void)subscribeAttributeNullableInt56uWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt64uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -90803,7 +90803,7 @@ - (void)writeAttributeNullableInt64uWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -90847,7 +90847,7 @@ - (void)subscribeAttributeNullableInt64uWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt64uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -90916,7 +90916,7 @@ - (void)writeAttributeNullableInt8sWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -90960,7 +90960,7 @@ - (void)subscribeAttributeNullableInt8sWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -91029,7 +91029,7 @@ - (void)writeAttributeNullableInt16sWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -91073,7 +91073,7 @@ - (void)subscribeAttributeNullableInt16sWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -91142,7 +91142,7 @@ - (void)writeAttributeNullableInt24sWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -91186,7 +91186,7 @@ - (void)subscribeAttributeNullableInt24sWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt32sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -91255,7 +91255,7 @@ - (void)writeAttributeNullableInt32sWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -91299,7 +91299,7 @@ - (void)subscribeAttributeNullableInt32sWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt32sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -91368,7 +91368,7 @@ - (void)writeAttributeNullableInt40sWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -91412,7 +91412,7 @@ - (void)subscribeAttributeNullableInt40sWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt64sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -91481,7 +91481,7 @@ - (void)writeAttributeNullableInt48sWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -91525,7 +91525,7 @@ - (void)subscribeAttributeNullableInt48sWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt64sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -91594,7 +91594,7 @@ - (void)writeAttributeNullableInt56sWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -91638,7 +91638,7 @@ - (void)subscribeAttributeNullableInt56sWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt64sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -91707,7 +91707,7 @@ - (void)writeAttributeNullableInt64sWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -91751,7 +91751,7 @@ - (void)subscribeAttributeNullableInt64sWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt64sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -91820,7 +91820,7 @@ - (void)writeAttributeNullableEnum8WithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -91864,7 +91864,7 @@ - (void)subscribeAttributeNullableEnum8WithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -91933,7 +91933,7 @@ - (void)writeAttributeNullableEnum16WithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -91977,7 +91977,7 @@ - (void)subscribeAttributeNullableEnum16WithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -92046,7 +92046,7 @@ - (void)writeAttributeNullableFloatSingleWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -92091,7 +92091,7 @@ - (void)subscribeAttributeNullableFloatSingleWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableFloatAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -92160,7 +92160,7 @@ - (void)writeAttributeNullableFloatDoubleWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -92205,7 +92205,7 @@ - (void)subscribeAttributeNullableFloatDoubleWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableDoubleAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -92274,7 +92274,7 @@ - (void)writeAttributeNullableOctetStringWithValue:(NSData * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -92319,7 +92319,7 @@ - (void)subscribeAttributeNullableOctetStringWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableOctetStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -92388,7 +92388,7 @@ - (void)writeAttributeNullableCharStringWithValue:(NSString * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -92432,7 +92432,7 @@ - (void)subscribeAttributeNullableCharStringWithMinInterval:(NSNumber * _Nonnull // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -92501,7 +92501,7 @@ - (void)writeAttributeNullableEnumAttrWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -92545,7 +92545,7 @@ - (void)subscribeAttributeNullableEnumAttrWithMinInterval:(NSNumber * _Nonnull)m // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableTestClusterClusterSimpleEnumAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -92618,7 +92618,7 @@ - (void)writeAttributeNullableStructWithValue:(MTRTestClusterClusterSimpleStruct completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -92669,7 +92669,7 @@ - (void)subscribeAttributeNullableStructWithMinInterval:(NSNumber * _Nonnull)min // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterNullableStructStructAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -92742,7 +92742,7 @@ - (void)writeAttributeNullableRangeRestrictedInt8uWithValue:(NSNumber * _Nullabl completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -92787,7 +92787,7 @@ - (void)subscribeAttributeNullableRangeRestrictedInt8uWithMinInterval:(NSNumber // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -92859,7 +92859,7 @@ - (void)writeAttributeNullableRangeRestrictedInt8sWithValue:(NSNumber * _Nullabl completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -92904,7 +92904,7 @@ - (void)subscribeAttributeNullableRangeRestrictedInt8sWithMinInterval:(NSNumber // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt8sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -92976,7 +92976,7 @@ - (void)writeAttributeNullableRangeRestrictedInt16uWithValue:(NSNumber * _Nullab completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -93021,7 +93021,7 @@ - (void)subscribeAttributeNullableRangeRestrictedInt16uWithMinInterval:(NSNumber // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -93093,7 +93093,7 @@ - (void)writeAttributeNullableRangeRestrictedInt16sWithValue:(NSNumber * _Nullab completionHandler:(StatusCompletion)completionHandler { // Make a copy of params before we go async. - params = (params == nil) ? nil : [params copy]; + params = [params copy]; value = [value copy]; new MTRDefaultSuccessCallbackBridge( @@ -93138,7 +93138,7 @@ - (void)subscribeAttributeNullableRangeRestrictedInt16sWithMinInterval:(NSNumber // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRNullableInt16sAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -93209,7 +93209,7 @@ - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnu // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterGeneratedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -93281,7 +93281,7 @@ - (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnul // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterAcceptedCommandListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -93351,7 +93351,7 @@ - (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minI // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRTestClusterAttributeListListAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -93421,7 +93421,7 @@ - (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInte // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { @@ -93490,7 +93490,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)mi // Make a copy of params before we go async. minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; - params = (params == nil) ? nil : [params copy]; + params = [params copy]; new MTRInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h new file mode 100644 index 00000000000000..b954e81f009771 --- /dev/null +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -0,0 +1,5281 @@ +/* + * + * 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 + +#import + +#import + +#import +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * Cluster Identify + * + */ +@interface MTRClusterIdentify : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)identifyWithParams:(MTRIdentifyClusterIdentifyParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)triggerEffectWithParams:(MTRIdentifyClusterTriggerEffectParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; + +- (NSDictionary *)readAttributeIdentifyTimeWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeIdentifyTimeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeIdentifyTimeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeIdentifyTypeWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Groups + * + */ +@interface MTRClusterGroups : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)addGroupWithParams:(MTRGroupsClusterAddGroupParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRGroupsClusterAddGroupResponseParams * _Nullable data, NSError * _Nullable error))completionHandler; +- (void)viewGroupWithParams:(MTRGroupsClusterViewGroupParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRGroupsClusterViewGroupResponseParams * _Nullable data, NSError * _Nullable error))completionHandler; +- (void)getGroupMembershipWithParams:(MTRGroupsClusterGetGroupMembershipParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRGroupsClusterGetGroupMembershipResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)removeGroupWithParams:(MTRGroupsClusterRemoveGroupParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRGroupsClusterRemoveGroupResponseParams * _Nullable data, NSError * _Nullable error))completionHandler; +- (void)removeAllGroupsWithParams:(MTRGroupsClusterRemoveAllGroupsParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)removeAllGroupsWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)addGroupIfIdentifyingWithParams:(MTRGroupsClusterAddGroupIfIdentifyingParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; + +- (NSDictionary *)readAttributeNameSupportWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Scenes + * + */ +@interface MTRClusterScenes : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)addSceneWithParams:(MTRScenesClusterAddSceneParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRScenesClusterAddSceneResponseParams * _Nullable data, NSError * _Nullable error))completionHandler; +- (void)viewSceneWithParams:(MTRScenesClusterViewSceneParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRScenesClusterViewSceneResponseParams * _Nullable data, NSError * _Nullable error))completionHandler; +- (void)removeSceneWithParams:(MTRScenesClusterRemoveSceneParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRScenesClusterRemoveSceneResponseParams * _Nullable data, NSError * _Nullable error))completionHandler; +- (void)removeAllScenesWithParams:(MTRScenesClusterRemoveAllScenesParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRScenesClusterRemoveAllScenesResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)storeSceneWithParams:(MTRScenesClusterStoreSceneParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRScenesClusterStoreSceneResponseParams * _Nullable data, NSError * _Nullable error))completionHandler; +- (void)recallSceneWithParams:(MTRScenesClusterRecallSceneParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)getSceneMembershipWithParams:(MTRScenesClusterGetSceneMembershipParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRScenesClusterGetSceneMembershipResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)enhancedAddSceneWithParams:(MTRScenesClusterEnhancedAddSceneParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRScenesClusterEnhancedAddSceneResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)enhancedViewSceneWithParams:(MTRScenesClusterEnhancedViewSceneParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRScenesClusterEnhancedViewSceneResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)copySceneWithParams:(MTRScenesClusterCopySceneParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRScenesClusterCopySceneResponseParams * _Nullable data, NSError * _Nullable error))completionHandler; + +- (NSDictionary *)readAttributeSceneCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeCurrentSceneWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeCurrentGroupWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeSceneValidWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeNameSupportWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeLastConfiguredByWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster On/Off + * + */ +@interface MTRClusterOnOff : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)offWithParams:(MTROnOffClusterOffParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)offWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)onWithParams:(MTROnOffClusterOnParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)onWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)toggleWithParams:(MTROnOffClusterToggleParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)toggleWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)offWithEffectWithParams:(MTROnOffClusterOffWithEffectParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)onWithRecallGlobalSceneWithParams:(MTROnOffClusterOnWithRecallGlobalSceneParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)onWithRecallGlobalSceneWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)onWithTimedOffWithParams:(MTROnOffClusterOnWithTimedOffParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; + +- (NSDictionary *)readAttributeOnOffWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGlobalSceneControlWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeOnTimeWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeOnTimeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeOnTimeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeOffWaitTimeWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeOffWaitTimeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeOffWaitTimeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeStartUpOnOffWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeStartUpOnOffWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeStartUpOnOffWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster On/off Switch Configuration + * + */ +@interface MTRClusterOnOffSwitchConfiguration : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (NSDictionary *)readAttributeSwitchTypeWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeSwitchActionsWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeSwitchActionsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeSwitchActionsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Level Control + * + */ +@interface MTRClusterLevelControl : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)moveToLevelWithParams:(MTRLevelControlClusterMoveToLevelParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)moveWithParams:(MTRLevelControlClusterMoveParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)stepWithParams:(MTRLevelControlClusterStepParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)stopWithParams:(MTRLevelControlClusterStopParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)moveToLevelWithOnOffWithParams:(MTRLevelControlClusterMoveToLevelWithOnOffParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)moveWithOnOffWithParams:(MTRLevelControlClusterMoveWithOnOffParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)stepWithOnOffWithParams:(MTRLevelControlClusterStepWithOnOffParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)stopWithOnOffWithParams:(MTRLevelControlClusterStopWithOnOffParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)moveToClosestFrequencyWithParams:(MTRLevelControlClusterMoveToClosestFrequencyParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; + +- (NSDictionary *)readAttributeCurrentLevelWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRemainingTimeWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMinLevelWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMaxLevelWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeCurrentFrequencyWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMinFrequencyWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMaxFrequencyWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeOptionsWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeOptionsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeOptionsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeOnOffTransitionTimeWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeOnOffTransitionTimeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeOnOffTransitionTimeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeOnLevelWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeOnLevelWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeOnLevelWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeOnTransitionTimeWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeOnTransitionTimeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeOnTransitionTimeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeOffTransitionTimeWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeOffTransitionTimeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeOffTransitionTimeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeDefaultMoveRateWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeDefaultMoveRateWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeDefaultMoveRateWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeStartUpCurrentLevelWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeStartUpCurrentLevelWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeStartUpCurrentLevelWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Binary Input (Basic) + * + */ +@interface MTRClusterBinaryInputBasic : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (NSDictionary *)readAttributeActiveTextWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeActiveTextWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeActiveTextWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeDescriptionWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeDescriptionWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeDescriptionWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeInactiveTextWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeInactiveTextWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeInactiveTextWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeOutOfServiceWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeOutOfServiceWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeOutOfServiceWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributePolarityWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePresentValueWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributePresentValueWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributePresentValueWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeReliabilityWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeReliabilityWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeReliabilityWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeStatusFlagsWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeApplicationTypeWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Descriptor + * + */ +@interface MTRClusterDescriptor : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (NSDictionary *)readAttributeDeviceListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeServerListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClientListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePartsListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Binding + * + */ +@interface MTRClusterBinding : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (NSDictionary *)readAttributeBindingWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeBindingWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeBindingWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Access Control + * + */ +@interface MTRClusterAccessControl : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (NSDictionary *)readAttributeAclWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeAclWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeAclWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeExtensionWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeExtensionWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeExtensionWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeSubjectsPerAccessControlEntryWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeTargetsPerAccessControlEntryWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAccessControlEntriesPerFabricWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Bridged Actions + * + */ +@interface MTRClusterBridgedActions : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)instantActionWithParams:(MTRBridgedActionsClusterInstantActionParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)instantActionWithTransitionWithParams:(MTRBridgedActionsClusterInstantActionWithTransitionParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)startActionWithParams:(MTRBridgedActionsClusterStartActionParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)startActionWithDurationWithParams:(MTRBridgedActionsClusterStartActionWithDurationParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)stopActionWithParams:(MTRBridgedActionsClusterStopActionParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)pauseActionWithParams:(MTRBridgedActionsClusterPauseActionParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)pauseActionWithDurationWithParams:(MTRBridgedActionsClusterPauseActionWithDurationParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)resumeActionWithParams:(MTRBridgedActionsClusterResumeActionParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)enableActionWithParams:(MTRBridgedActionsClusterEnableActionParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)enableActionWithDurationWithParams:(MTRBridgedActionsClusterEnableActionWithDurationParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)disableActionWithParams:(MTRBridgedActionsClusterDisableActionParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)disableActionWithDurationWithParams:(MTRBridgedActionsClusterDisableActionWithDurationParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; + +- (NSDictionary *)readAttributeActionListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeEndpointListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeSetupUrlWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Basic + * + */ +@interface MTRClusterBasic : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)mfgSpecificPingWithParams:(MTRBasicClusterMfgSpecificPingParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)mfgSpecificPingWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; + +- (NSDictionary *)readAttributeDataModelRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeVendorNameWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeVendorIDWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeProductNameWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeProductIDWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeNodeLabelWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeNodeLabelWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeNodeLabelWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeLocationWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeLocationWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeLocationWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeHardwareVersionWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeHardwareVersionStringWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeSoftwareVersionWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeSoftwareVersionStringWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeManufacturingDateWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePartNumberWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeProductURLWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeProductLabelWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeSerialNumberWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeLocalConfigDisabledWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeLocalConfigDisabledWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeLocalConfigDisabledWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeReachableWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeUniqueIDWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeCapabilityMinimaWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster OTA Software Update Provider + * + */ +@interface MTRClusterOtaSoftwareUpdateProvider : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)queryImageWithParams:(MTROtaSoftwareUpdateProviderClusterQueryImageParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTROtaSoftwareUpdateProviderClusterQueryImageResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)applyUpdateRequestWithParams:(MTROtaSoftwareUpdateProviderClusterApplyUpdateRequestParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTROtaSoftwareUpdateProviderClusterApplyUpdateResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)notifyUpdateAppliedWithParams:(MTROtaSoftwareUpdateProviderClusterNotifyUpdateAppliedParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster OTA Software Update Requestor + * + */ +@interface MTRClusterOtaSoftwareUpdateRequestor : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)announceOtaProviderWithParams:(MTROtaSoftwareUpdateRequestorClusterAnnounceOtaProviderParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; + +- (NSDictionary *)readAttributeDefaultOtaProvidersWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeDefaultOtaProvidersWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeDefaultOtaProvidersWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeUpdatePossibleWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeUpdateStateWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeUpdateStateProgressWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Localization Configuration + * + */ +@interface MTRClusterLocalizationConfiguration : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (NSDictionary *)readAttributeActiveLocaleWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeActiveLocaleWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeActiveLocaleWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeSupportedLocalesWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Time Format Localization + * + */ +@interface MTRClusterTimeFormatLocalization : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (NSDictionary *)readAttributeHourFormatWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeHourFormatWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeHourFormatWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeActiveCalendarTypeWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeActiveCalendarTypeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeActiveCalendarTypeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeSupportedCalendarTypesWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Unit Localization + * + */ +@interface MTRClusterUnitLocalization : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (NSDictionary *)readAttributeTemperatureUnitWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeTemperatureUnitWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeTemperatureUnitWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Power Source Configuration + * + */ +@interface MTRClusterPowerSourceConfiguration : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (NSDictionary *)readAttributeSourcesWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Power Source + * + */ +@interface MTRClusterPowerSource : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (NSDictionary *)readAttributeStatusWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeOrderWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeDescriptionWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeWiredAssessedInputVoltageWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeWiredAssessedInputFrequencyWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeWiredCurrentTypeWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeWiredAssessedCurrentWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeWiredNominalVoltageWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeWiredMaximumCurrentWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeWiredPresentWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeActiveWiredFaultsWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeBatVoltageWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeBatPercentRemainingWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeBatTimeRemainingWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeBatChargeLevelWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeBatReplacementNeededWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeBatReplaceabilityWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeBatPresentWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeActiveBatFaultsWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeBatReplacementDescriptionWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeBatCommonDesignationWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeBatANSIDesignationWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeBatIECDesignationWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeBatApprovedChemistryWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeBatCapacityWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeBatQuantityWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeBatChargeStateWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeBatTimeToFullChargeWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeBatFunctionalWhileChargingWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeBatChargingCurrentWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeActiveBatChargeFaultsWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster General Commissioning + * + */ +@interface MTRClusterGeneralCommissioning : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)armFailSafeWithParams:(MTRGeneralCommissioningClusterArmFailSafeParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRGeneralCommissioningClusterArmFailSafeResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)setRegulatoryConfigWithParams:(MTRGeneralCommissioningClusterSetRegulatoryConfigParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRGeneralCommissioningClusterSetRegulatoryConfigResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)commissioningCompleteWithParams:(MTRGeneralCommissioningClusterCommissioningCompleteParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRGeneralCommissioningClusterCommissioningCompleteResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)commissioningCompleteWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRGeneralCommissioningClusterCommissioningCompleteResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; + +- (NSDictionary *)readAttributeBreadcrumbWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeBreadcrumbWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeBreadcrumbWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeBasicCommissioningInfoWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRegulatoryConfigWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeLocationCapabilityWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeSupportsConcurrentConnectionWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Network Commissioning + * + */ +@interface MTRClusterNetworkCommissioning : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)scanNetworksWithParams:(MTRNetworkCommissioningClusterScanNetworksParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRNetworkCommissioningClusterScanNetworksResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)addOrUpdateWiFiNetworkWithParams:(MTRNetworkCommissioningClusterAddOrUpdateWiFiNetworkParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)addOrUpdateThreadNetworkWithParams:(MTRNetworkCommissioningClusterAddOrUpdateThreadNetworkParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)removeNetworkWithParams:(MTRNetworkCommissioningClusterRemoveNetworkParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)connectNetworkWithParams:(MTRNetworkCommissioningClusterConnectNetworkParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRNetworkCommissioningClusterConnectNetworkResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)reorderNetworkWithParams:(MTRNetworkCommissioningClusterReorderNetworkParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; + +- (NSDictionary *)readAttributeMaxNetworksWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeNetworksWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeScanMaxTimeSecondsWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeConnectMaxTimeSecondsWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeInterfaceEnabledWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeInterfaceEnabledWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeInterfaceEnabledWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeLastNetworkingStatusWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeLastNetworkIDWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeLastConnectErrorValueWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Diagnostic Logs + * + */ +@interface MTRClusterDiagnosticLogs : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)retrieveLogsRequestWithParams:(MTRDiagnosticLogsClusterRetrieveLogsRequestParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRDiagnosticLogsClusterRetrieveLogsResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster General Diagnostics + * + */ +@interface MTRClusterGeneralDiagnostics : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)testEventTriggerWithParams:(MTRGeneralDiagnosticsClusterTestEventTriggerParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; + +- (NSDictionary *)readAttributeNetworkInterfacesWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRebootCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeUpTimeWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeTotalOperationalHoursWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeBootReasonsWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeActiveHardwareFaultsWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeActiveRadioFaultsWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeActiveNetworkFaultsWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeTestEventTriggersEnabledWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Software Diagnostics + * + */ +@interface MTRClusterSoftwareDiagnostics : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)resetWatermarksWithParams:(MTRSoftwareDiagnosticsClusterResetWatermarksParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)resetWatermarksWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; + +- (NSDictionary *)readAttributeThreadMetricsWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeCurrentHeapFreeWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeCurrentHeapUsedWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeCurrentHeapHighWatermarkWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Thread Network Diagnostics + * + */ +@interface MTRClusterThreadNetworkDiagnostics : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)resetCountsWithParams:(MTRThreadNetworkDiagnosticsClusterResetCountsParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)resetCountsWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; + +- (NSDictionary *)readAttributeChannelWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRoutingRoleWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeNetworkNameWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePanIdWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeExtendedPanIdWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMeshLocalPrefixWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeOverrunCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeNeighborTableListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRouteTableListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePartitionIdWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeWeightingWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeDataVersionWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeStableDataVersionWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeLeaderRouterIdWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeDetachedRoleCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeChildRoleCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRouterRoleCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeLeaderRoleCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttachAttemptCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePartitionIdChangeCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeBetterPartitionAttachAttemptCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeParentChangeCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeTxTotalCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeTxUnicastCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeTxBroadcastCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeTxAckRequestedCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeTxAckedCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeTxNoAckRequestedCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeTxDataCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeTxDataPollCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeTxBeaconCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeTxBeaconRequestCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeTxOtherCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeTxRetryCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeTxDirectMaxRetryExpiryCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeTxIndirectMaxRetryExpiryCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeTxErrCcaCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeTxErrAbortCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeTxErrBusyChannelCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRxTotalCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRxUnicastCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRxBroadcastCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRxDataCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRxDataPollCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRxBeaconCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRxBeaconRequestCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRxOtherCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRxAddressFilteredCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRxDestAddrFilteredCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRxDuplicatedCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRxErrNoFrameCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRxErrUnknownNeighborCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRxErrInvalidSrcAddrCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRxErrSecCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRxErrFcsCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRxErrOtherCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeActiveTimestampWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePendingTimestampWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeDelayWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeSecurityPolicyWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeChannelMaskWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeOperationalDatasetComponentsWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeActiveNetworkFaultsListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster WiFi Network Diagnostics + * + */ +@interface MTRClusterWiFiNetworkDiagnostics : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)resetCountsWithParams:(MTRWiFiNetworkDiagnosticsClusterResetCountsParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)resetCountsWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; + +- (NSDictionary *)readAttributeBssidWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeSecurityTypeWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeWiFiVersionWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeChannelNumberWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRssiWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeBeaconLostCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeBeaconRxCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePacketMulticastRxCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePacketMulticastTxCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePacketUnicastRxCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePacketUnicastTxCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeCurrentMaxRateWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeOverrunCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Ethernet Network Diagnostics + * + */ +@interface MTRClusterEthernetNetworkDiagnostics : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)resetCountsWithParams:(MTREthernetNetworkDiagnosticsClusterResetCountsParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)resetCountsWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; + +- (NSDictionary *)readAttributePHYRateWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFullDuplexWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePacketRxCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePacketTxCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeTxErrCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeCollisionCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeOverrunCountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeCarrierDetectWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeTimeSinceResetWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Bridged Device Basic + * + */ +@interface MTRClusterBridgedDeviceBasic : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (NSDictionary *)readAttributeVendorNameWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeVendorIDWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeProductNameWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeNodeLabelWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeNodeLabelWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeNodeLabelWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeHardwareVersionWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeHardwareVersionStringWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeSoftwareVersionWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeSoftwareVersionStringWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeManufacturingDateWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePartNumberWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeProductURLWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeProductLabelWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeSerialNumberWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeReachableWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeUniqueIDWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Switch + * + */ +@interface MTRClusterSwitch : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (NSDictionary *)readAttributeNumberOfPositionsWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeCurrentPositionWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMultiPressMaxWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster AdministratorCommissioning + * + */ +@interface MTRClusterAdministratorCommissioning : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)openCommissioningWindowWithParams:(MTRAdministratorCommissioningClusterOpenCommissioningWindowParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)openBasicCommissioningWindowWithParams:(MTRAdministratorCommissioningClusterOpenBasicCommissioningWindowParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)revokeCommissioningWithParams:(MTRAdministratorCommissioningClusterRevokeCommissioningParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)revokeCommissioningWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; + +- (NSDictionary *)readAttributeWindowStatusWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAdminFabricIndexWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAdminVendorIdWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Operational Credentials + * + */ +@interface MTRClusterOperationalCredentials : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)attestationRequestWithParams:(MTROperationalCredentialsClusterAttestationRequestParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTROperationalCredentialsClusterAttestationResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)certificateChainRequestWithParams:(MTROperationalCredentialsClusterCertificateChainRequestParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTROperationalCredentialsClusterCertificateChainResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)CSRRequestWithParams:(MTROperationalCredentialsClusterCSRRequestParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTROperationalCredentialsClusterCSRResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)addNOCWithParams:(MTROperationalCredentialsClusterAddNOCParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTROperationalCredentialsClusterNOCResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)updateNOCWithParams:(MTROperationalCredentialsClusterUpdateNOCParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTROperationalCredentialsClusterNOCResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)updateFabricLabelWithParams:(MTROperationalCredentialsClusterUpdateFabricLabelParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTROperationalCredentialsClusterNOCResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)removeFabricWithParams:(MTROperationalCredentialsClusterRemoveFabricParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTROperationalCredentialsClusterNOCResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)addTrustedRootCertificateWithParams:(MTROperationalCredentialsClusterAddTrustedRootCertificateParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; + +- (NSDictionary *)readAttributeNOCsWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFabricsWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeSupportedFabricsWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeCommissionedFabricsWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeTrustedRootCertificatesWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeCurrentFabricIndexWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Group Key Management + * + */ +@interface MTRClusterGroupKeyManagement : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)keySetWriteWithParams:(MTRGroupKeyManagementClusterKeySetWriteParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)keySetReadWithParams:(MTRGroupKeyManagementClusterKeySetReadParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRGroupKeyManagementClusterKeySetReadResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)keySetRemoveWithParams:(MTRGroupKeyManagementClusterKeySetRemoveParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)keySetReadAllIndicesWithParams:(MTRGroupKeyManagementClusterKeySetReadAllIndicesParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRGroupKeyManagementClusterKeySetReadAllIndicesResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; + +- (NSDictionary *)readAttributeGroupKeyMapWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeGroupKeyMapWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeGroupKeyMapWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeGroupTableWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMaxGroupsPerFabricWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMaxGroupKeysPerFabricWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Fixed Label + * + */ +@interface MTRClusterFixedLabel : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (NSDictionary *)readAttributeLabelListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster User Label + * + */ +@interface MTRClusterUserLabel : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (NSDictionary *)readAttributeLabelListWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeLabelListWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeLabelListWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Boolean State + * + */ +@interface MTRClusterBooleanState : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (NSDictionary *)readAttributeStateValueWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Mode Select + * + */ +@interface MTRClusterModeSelect : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)changeToModeWithParams:(MTRModeSelectClusterChangeToModeParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; + +- (NSDictionary *)readAttributeDescriptionWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeStandardNamespaceWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeSupportedModesWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeCurrentModeWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeStartUpModeWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeStartUpModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeStartUpModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeOnModeWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeOnModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeOnModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Door Lock + * + */ +@interface MTRClusterDoorLock : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)lockDoorWithParams:(MTRDoorLockClusterLockDoorParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)unlockDoorWithParams:(MTRDoorLockClusterUnlockDoorParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)unlockWithTimeoutWithParams:(MTRDoorLockClusterUnlockWithTimeoutParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)setWeekDayScheduleWithParams:(MTRDoorLockClusterSetWeekDayScheduleParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)getWeekDayScheduleWithParams:(MTRDoorLockClusterGetWeekDayScheduleParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)clearWeekDayScheduleWithParams:(MTRDoorLockClusterClearWeekDayScheduleParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)setYearDayScheduleWithParams:(MTRDoorLockClusterSetYearDayScheduleParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)getYearDayScheduleWithParams:(MTRDoorLockClusterGetYearDayScheduleParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)clearYearDayScheduleWithParams:(MTRDoorLockClusterClearYearDayScheduleParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)setHolidayScheduleWithParams:(MTRDoorLockClusterSetHolidayScheduleParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)getHolidayScheduleWithParams:(MTRDoorLockClusterGetHolidayScheduleParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)clearHolidayScheduleWithParams:(MTRDoorLockClusterClearHolidayScheduleParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)setUserWithParams:(MTRDoorLockClusterSetUserParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)getUserWithParams:(MTRDoorLockClusterGetUserParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRDoorLockClusterGetUserResponseParams * _Nullable data, NSError * _Nullable error))completionHandler; +- (void)clearUserWithParams:(MTRDoorLockClusterClearUserParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)setCredentialWithParams:(MTRDoorLockClusterSetCredentialParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRDoorLockClusterSetCredentialResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)getCredentialStatusWithParams:(MTRDoorLockClusterGetCredentialStatusParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRDoorLockClusterGetCredentialStatusResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)clearCredentialWithParams:(MTRDoorLockClusterClearCredentialParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; + +- (NSDictionary *)readAttributeLockStateWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeLockTypeWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeActuatorEnabledWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeDoorStateWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeDoorOpenEventsWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeDoorOpenEventsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeDoorOpenEventsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeDoorClosedEventsWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeDoorClosedEventsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeDoorClosedEventsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeOpenPeriodWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeOpenPeriodWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeOpenPeriodWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeNumberOfTotalUsersSupportedWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeNumberOfPINUsersSupportedWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeNumberOfRFIDUsersSupportedWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeNumberOfWeekDaySchedulesSupportedPerUserWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeNumberOfYearDaySchedulesSupportedPerUserWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeNumberOfHolidaySchedulesSupportedWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMaxPINCodeLengthWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMinPINCodeLengthWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMaxRFIDCodeLengthWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMinRFIDCodeLengthWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeCredentialRulesSupportWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeNumberOfCredentialsSupportedPerUserWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeLanguageWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeLanguageWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeLanguageWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeLEDSettingsWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeLEDSettingsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeLEDSettingsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeAutoRelockTimeWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeAutoRelockTimeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeAutoRelockTimeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeSoundVolumeWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeSoundVolumeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeSoundVolumeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeOperatingModeWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeOperatingModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeOperatingModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeSupportedOperatingModesWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeDefaultConfigurationRegisterWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeEnableLocalProgrammingWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeEnableLocalProgrammingWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeEnableLocalProgrammingWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeEnableOneTouchLockingWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeEnableOneTouchLockingWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeEnableOneTouchLockingWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeEnableInsideStatusLEDWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeEnableInsideStatusLEDWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeEnableInsideStatusLEDWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeEnablePrivacyModeButtonWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeEnablePrivacyModeButtonWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeEnablePrivacyModeButtonWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeLocalProgrammingFeaturesWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeLocalProgrammingFeaturesWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeLocalProgrammingFeaturesWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeWrongCodeEntryLimitWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeWrongCodeEntryLimitWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeWrongCodeEntryLimitWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeUserCodeTemporaryDisableTimeWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeUserCodeTemporaryDisableTimeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeUserCodeTemporaryDisableTimeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeSendPINOverTheAirWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeSendPINOverTheAirWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeSendPINOverTheAirWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeRequirePINforRemoteOperationWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeRequirePINforRemoteOperationWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeRequirePINforRemoteOperationWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeExpiringUserTimeoutWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeExpiringUserTimeoutWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeExpiringUserTimeoutWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Window Covering + * + */ +@interface MTRClusterWindowCovering : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)upOrOpenWithParams:(MTRWindowCoveringClusterUpOrOpenParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)upOrOpenWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)downOrCloseWithParams:(MTRWindowCoveringClusterDownOrCloseParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)downOrCloseWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)stopMotionWithParams:(MTRWindowCoveringClusterStopMotionParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)stopMotionWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)goToLiftValueWithParams:(MTRWindowCoveringClusterGoToLiftValueParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)goToLiftPercentageWithParams:(MTRWindowCoveringClusterGoToLiftPercentageParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)goToTiltValueWithParams:(MTRWindowCoveringClusterGoToTiltValueParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)goToTiltPercentageWithParams:(MTRWindowCoveringClusterGoToTiltPercentageParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; + +- (NSDictionary *)readAttributeTypeWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePhysicalClosedLimitLiftWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePhysicalClosedLimitTiltWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeCurrentPositionLiftWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeCurrentPositionTiltWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeNumberOfActuationsLiftWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeNumberOfActuationsTiltWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeConfigStatusWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeCurrentPositionLiftPercentageWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeCurrentPositionTiltPercentageWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeOperationalStatusWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeTargetPositionLiftPercent100thsWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeTargetPositionTiltPercent100thsWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeEndProductTypeWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeCurrentPositionLiftPercent100thsWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeCurrentPositionTiltPercent100thsWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeInstalledOpenLimitLiftWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeInstalledClosedLimitLiftWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeInstalledOpenLimitTiltWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeInstalledClosedLimitTiltWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeModeWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeSafetyStatusWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Barrier Control + * + */ +@interface MTRClusterBarrierControl : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)barrierControlGoToPercentWithParams:(MTRBarrierControlClusterBarrierControlGoToPercentParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)barrierControlStopWithParams:(MTRBarrierControlClusterBarrierControlStopParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)barrierControlStopWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; + +- (NSDictionary *)readAttributeBarrierMovingStateWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeBarrierSafetyStatusWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeBarrierCapabilitiesWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeBarrierOpenEventsWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeBarrierOpenEventsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeBarrierOpenEventsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeBarrierCloseEventsWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeBarrierCloseEventsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeBarrierCloseEventsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeBarrierCommandOpenEventsWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeBarrierCommandOpenEventsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeBarrierCommandOpenEventsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeBarrierCommandCloseEventsWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeBarrierCommandCloseEventsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeBarrierCommandCloseEventsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeBarrierOpenPeriodWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeBarrierOpenPeriodWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeBarrierOpenPeriodWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeBarrierClosePeriodWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeBarrierClosePeriodWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeBarrierClosePeriodWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeBarrierPositionWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Pump Configuration and Control + * + */ +@interface MTRClusterPumpConfigurationAndControl : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (NSDictionary *)readAttributeMaxPressureWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMaxSpeedWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMaxFlowWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMinConstPressureWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMaxConstPressureWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMinCompPressureWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMaxCompPressureWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMinConstSpeedWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMaxConstSpeedWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMinConstFlowWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMaxConstFlowWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMinConstTempWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMaxConstTempWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePumpStatusWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeEffectiveOperationModeWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeEffectiveControlModeWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeCapacityWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeSpeedWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeLifetimeRunningHoursWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeLifetimeRunningHoursWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeLifetimeRunningHoursWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributePowerWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeLifetimeEnergyConsumedWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeLifetimeEnergyConsumedWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeLifetimeEnergyConsumedWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeOperationModeWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeOperationModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeOperationModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeControlModeWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeControlModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeControlModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Thermostat + * + */ +@interface MTRClusterThermostat : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)setpointRaiseLowerWithParams:(MTRThermostatClusterSetpointRaiseLowerParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)setWeeklyScheduleWithParams:(MTRThermostatClusterSetWeeklyScheduleParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)getWeeklyScheduleWithParams:(MTRThermostatClusterGetWeeklyScheduleParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRThermostatClusterGetWeeklyScheduleResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)clearWeeklyScheduleWithParams:(MTRThermostatClusterClearWeeklyScheduleParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)clearWeeklyScheduleWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; + +- (NSDictionary *)readAttributeLocalTemperatureWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeOutdoorTemperatureWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeOccupancyWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAbsMinHeatSetpointLimitWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAbsMaxHeatSetpointLimitWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAbsMinCoolSetpointLimitWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAbsMaxCoolSetpointLimitWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePICoolingDemandWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePIHeatingDemandWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeHVACSystemTypeConfigurationWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeHVACSystemTypeConfigurationWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeHVACSystemTypeConfigurationWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeLocalTemperatureCalibrationWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeLocalTemperatureCalibrationWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeLocalTemperatureCalibrationWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeOccupiedCoolingSetpointWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeOccupiedCoolingSetpointWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeOccupiedCoolingSetpointWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeOccupiedHeatingSetpointWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeOccupiedHeatingSetpointWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeOccupiedHeatingSetpointWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeUnoccupiedCoolingSetpointWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeUnoccupiedCoolingSetpointWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeUnoccupiedCoolingSetpointWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeUnoccupiedHeatingSetpointWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeUnoccupiedHeatingSetpointWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeUnoccupiedHeatingSetpointWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeMinHeatSetpointLimitWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeMinHeatSetpointLimitWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeMinHeatSetpointLimitWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeMaxHeatSetpointLimitWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeMaxHeatSetpointLimitWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeMaxHeatSetpointLimitWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeMinCoolSetpointLimitWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeMinCoolSetpointLimitWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeMinCoolSetpointLimitWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeMaxCoolSetpointLimitWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeMaxCoolSetpointLimitWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeMaxCoolSetpointLimitWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeMinSetpointDeadBandWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeMinSetpointDeadBandWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeMinSetpointDeadBandWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeRemoteSensingWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeRemoteSensingWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeRemoteSensingWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeControlSequenceOfOperationWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeControlSequenceOfOperationWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeControlSequenceOfOperationWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeSystemModeWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeSystemModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeSystemModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeThermostatRunningModeWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeStartOfWeekWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeNumberOfWeeklyTransitionsWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeNumberOfDailyTransitionsWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeTemperatureSetpointHoldWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeTemperatureSetpointHoldWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeTemperatureSetpointHoldWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeTemperatureSetpointHoldDurationWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeTemperatureSetpointHoldDurationWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeTemperatureSetpointHoldDurationWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeThermostatProgrammingOperationModeWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeThermostatProgrammingOperationModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeThermostatProgrammingOperationModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeThermostatRunningStateWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeSetpointChangeSourceWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeSetpointChangeAmountWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeSetpointChangeSourceTimestampWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeOccupiedSetbackWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeOccupiedSetbackWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeOccupiedSetbackWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeOccupiedSetbackMinWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeOccupiedSetbackMaxWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeUnoccupiedSetbackWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeUnoccupiedSetbackWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeUnoccupiedSetbackWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeUnoccupiedSetbackMinWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeUnoccupiedSetbackMaxWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeEmergencyHeatDeltaWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeEmergencyHeatDeltaWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeEmergencyHeatDeltaWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeACTypeWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeACTypeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeACTypeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeACCapacityWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeACCapacityWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeACCapacityWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeACRefrigerantTypeWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeACRefrigerantTypeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeACRefrigerantTypeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeACCompressorTypeWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeACCompressorTypeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeACCompressorTypeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeACErrorCodeWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeACErrorCodeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeACErrorCodeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeACLouverPositionWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeACLouverPositionWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeACLouverPositionWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeACCoilTemperatureWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeACCapacityformatWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeACCapacityformatWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeACCapacityformatWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Fan Control + * + */ +@interface MTRClusterFanControl : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (NSDictionary *)readAttributeFanModeWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeFanModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeFanModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeFanModeSequenceWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeFanModeSequenceWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeFanModeSequenceWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributePercentSettingWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributePercentSettingWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributePercentSettingWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributePercentCurrentWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeSpeedMaxWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeSpeedSettingWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeSpeedSettingWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeSpeedSettingWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeSpeedCurrentWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRockSupportWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRockSettingWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeRockSettingWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeRockSettingWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeWindSupportWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeWindSettingWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeWindSettingWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeWindSettingWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Thermostat User Interface Configuration + * + */ +@interface MTRClusterThermostatUserInterfaceConfiguration : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (NSDictionary *)readAttributeTemperatureDisplayModeWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeTemperatureDisplayModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeTemperatureDisplayModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeKeypadLockoutWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeKeypadLockoutWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeKeypadLockoutWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeScheduleProgrammingVisibilityWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeScheduleProgrammingVisibilityWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeScheduleProgrammingVisibilityWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Color Control + * + */ +@interface MTRClusterColorControl : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)moveToHueWithParams:(MTRColorControlClusterMoveToHueParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)moveHueWithParams:(MTRColorControlClusterMoveHueParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)stepHueWithParams:(MTRColorControlClusterStepHueParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)moveToSaturationWithParams:(MTRColorControlClusterMoveToSaturationParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)moveSaturationWithParams:(MTRColorControlClusterMoveSaturationParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)stepSaturationWithParams:(MTRColorControlClusterStepSaturationParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)moveToHueAndSaturationWithParams:(MTRColorControlClusterMoveToHueAndSaturationParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)moveToColorWithParams:(MTRColorControlClusterMoveToColorParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)moveColorWithParams:(MTRColorControlClusterMoveColorParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)stepColorWithParams:(MTRColorControlClusterStepColorParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)moveToColorTemperatureWithParams:(MTRColorControlClusterMoveToColorTemperatureParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)enhancedMoveToHueWithParams:(MTRColorControlClusterEnhancedMoveToHueParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)enhancedMoveHueWithParams:(MTRColorControlClusterEnhancedMoveHueParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)enhancedStepHueWithParams:(MTRColorControlClusterEnhancedStepHueParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)enhancedMoveToHueAndSaturationWithParams:(MTRColorControlClusterEnhancedMoveToHueAndSaturationParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)colorLoopSetWithParams:(MTRColorControlClusterColorLoopSetParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)stopMoveStepWithParams:(MTRColorControlClusterStopMoveStepParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)moveColorTemperatureWithParams:(MTRColorControlClusterMoveColorTemperatureParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)stepColorTemperatureWithParams:(MTRColorControlClusterStepColorTemperatureParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; + +- (NSDictionary *)readAttributeCurrentHueWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeCurrentSaturationWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRemainingTimeWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeCurrentXWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeCurrentYWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeDriftCompensationWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeCompensationTextWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeColorTemperatureWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeColorModeWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeOptionsWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeOptionsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeOptionsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeNumberOfPrimariesWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePrimary1XWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePrimary1YWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePrimary1IntensityWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePrimary2XWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePrimary2YWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePrimary2IntensityWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePrimary3XWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePrimary3YWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePrimary3IntensityWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePrimary4XWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePrimary4YWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePrimary4IntensityWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePrimary5XWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePrimary5YWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePrimary5IntensityWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePrimary6XWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePrimary6YWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePrimary6IntensityWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeWhitePointXWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeWhitePointXWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeWhitePointXWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeWhitePointYWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeWhitePointYWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeWhitePointYWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeColorPointRXWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeColorPointRXWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeColorPointRXWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeColorPointRYWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeColorPointRYWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeColorPointRYWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeColorPointRIntensityWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeColorPointRIntensityWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeColorPointRIntensityWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeColorPointGXWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeColorPointGXWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeColorPointGXWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeColorPointGYWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeColorPointGYWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeColorPointGYWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeColorPointGIntensityWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeColorPointGIntensityWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeColorPointGIntensityWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeColorPointBXWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeColorPointBXWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeColorPointBXWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeColorPointBYWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeColorPointBYWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeColorPointBYWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeColorPointBIntensityWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeColorPointBIntensityWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeColorPointBIntensityWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeEnhancedCurrentHueWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeEnhancedColorModeWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeColorLoopActiveWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeColorLoopDirectionWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeColorLoopTimeWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeColorLoopStartEnhancedHueWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeColorLoopStoredEnhancedHueWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeColorCapabilitiesWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeColorTempPhysicalMinMiredsWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeColorTempPhysicalMaxMiredsWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeCoupleColorTempToLevelMinMiredsWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeStartUpColorTemperatureMiredsWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeStartUpColorTemperatureMiredsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeStartUpColorTemperatureMiredsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Ballast Configuration + * + */ +@interface MTRClusterBallastConfiguration : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (NSDictionary *)readAttributePhysicalMinLevelWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePhysicalMaxLevelWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeBallastStatusWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMinLevelWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeMinLevelWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeMinLevelWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeMaxLevelWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeMaxLevelWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeMaxLevelWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeIntrinsicBalanceFactorWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeIntrinsicBalanceFactorWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeIntrinsicBalanceFactorWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeBallastFactorAdjustmentWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeBallastFactorAdjustmentWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeBallastFactorAdjustmentWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeLampQuantityWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeLampTypeWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeLampTypeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeLampTypeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeLampManufacturerWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeLampManufacturerWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeLampManufacturerWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeLampRatedHoursWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeLampRatedHoursWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeLampRatedHoursWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeLampBurnHoursWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeLampBurnHoursWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeLampBurnHoursWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeLampAlarmModeWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeLampAlarmModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeLampAlarmModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeLampBurnHoursTripPointWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeLampBurnHoursTripPointWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeLampBurnHoursTripPointWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Illuminance Measurement + * + */ +@interface MTRClusterIlluminanceMeasurement : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (NSDictionary *)readAttributeMeasuredValueWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMinMeasuredValueWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMaxMeasuredValueWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeToleranceWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeLightSensorTypeWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Temperature Measurement + * + */ +@interface MTRClusterTemperatureMeasurement : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (NSDictionary *)readAttributeMeasuredValueWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMinMeasuredValueWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMaxMeasuredValueWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeToleranceWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Pressure Measurement + * + */ +@interface MTRClusterPressureMeasurement : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (NSDictionary *)readAttributeMeasuredValueWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMinMeasuredValueWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMaxMeasuredValueWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeToleranceWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeScaledValueWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMinScaledValueWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMaxScaledValueWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeScaledToleranceWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeScaleWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Flow Measurement + * + */ +@interface MTRClusterFlowMeasurement : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (NSDictionary *)readAttributeMeasuredValueWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMinMeasuredValueWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMaxMeasuredValueWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeToleranceWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Relative Humidity Measurement + * + */ +@interface MTRClusterRelativeHumidityMeasurement : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (NSDictionary *)readAttributeMeasuredValueWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMinMeasuredValueWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMaxMeasuredValueWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeToleranceWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Occupancy Sensing + * + */ +@interface MTRClusterOccupancySensing : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (NSDictionary *)readAttributeOccupancyWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeOccupancySensorTypeWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeOccupancySensorTypeBitmapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePirOccupiedToUnoccupiedDelayWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributePirOccupiedToUnoccupiedDelayWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributePirOccupiedToUnoccupiedDelayWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributePirUnoccupiedToOccupiedDelayWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributePirUnoccupiedToOccupiedDelayWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributePirUnoccupiedToOccupiedDelayWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributePirUnoccupiedToOccupiedThresholdWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributePirUnoccupiedToOccupiedThresholdWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributePirUnoccupiedToOccupiedThresholdWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeUltrasonicOccupiedToUnoccupiedDelayWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeUltrasonicOccupiedToUnoccupiedDelayWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeUltrasonicOccupiedToUnoccupiedDelayWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeUltrasonicUnoccupiedToOccupiedDelayWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeUltrasonicUnoccupiedToOccupiedDelayWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeUltrasonicUnoccupiedToOccupiedDelayWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeUltrasonicUnoccupiedToOccupiedThresholdWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeUltrasonicUnoccupiedToOccupiedThresholdWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeUltrasonicUnoccupiedToOccupiedThresholdWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributePhysicalContactOccupiedToUnoccupiedDelayWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributePhysicalContactUnoccupiedToOccupiedDelayWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributePhysicalContactUnoccupiedToOccupiedThresholdWithParams: + (MTRReadParams * _Nullable)params; +- (void)writeAttributePhysicalContactUnoccupiedToOccupiedThresholdWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributePhysicalContactUnoccupiedToOccupiedThresholdWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Wake on LAN + * + */ +@interface MTRClusterWakeOnLan : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (NSDictionary *)readAttributeMACAddressWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Channel + * + */ +@interface MTRClusterChannel : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)changeChannelWithParams:(MTRChannelClusterChangeChannelParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRChannelClusterChangeChannelResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)changeChannelByNumberWithParams:(MTRChannelClusterChangeChannelByNumberParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)skipChannelWithParams:(MTRChannelClusterSkipChannelParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; + +- (NSDictionary *)readAttributeChannelListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeLineupWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeCurrentChannelWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Target Navigator + * + */ +@interface MTRClusterTargetNavigator : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)navigateTargetWithParams:(MTRTargetNavigatorClusterNavigateTargetParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRTargetNavigatorClusterNavigateTargetResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; + +- (NSDictionary *)readAttributeTargetListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeCurrentTargetWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Media Playback + * + */ +@interface MTRClusterMediaPlayback : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)playWithParams:(MTRMediaPlaybackClusterPlayParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler; +- (void)playWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)pauseWithParams:(MTRMediaPlaybackClusterPauseParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler; +- (void)pauseWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)stopPlaybackWithParams:(MTRMediaPlaybackClusterStopPlaybackParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)stopPlaybackWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)startOverWithParams:(MTRMediaPlaybackClusterStartOverParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)startOverWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)previousWithParams:(MTRMediaPlaybackClusterPreviousParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler; +- (void)previousWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)nextWithParams:(MTRMediaPlaybackClusterNextParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler; +- (void)nextWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)rewindWithParams:(MTRMediaPlaybackClusterRewindParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler; +- (void)rewindWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)fastForwardWithParams:(MTRMediaPlaybackClusterFastForwardParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)fastForwardWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)skipForwardWithParams:(MTRMediaPlaybackClusterSkipForwardParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)skipBackwardWithParams:(MTRMediaPlaybackClusterSkipBackwardParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)seekWithParams:(MTRMediaPlaybackClusterSeekParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler; + +- (NSDictionary *)readAttributeCurrentStateWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeStartTimeWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeDurationWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeSampledPositionWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePlaybackSpeedWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeSeekRangeEndWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeSeekRangeStartWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Media Input + * + */ +@interface MTRClusterMediaInput : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)selectInputWithParams:(MTRMediaInputClusterSelectInputParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)showInputStatusWithParams:(MTRMediaInputClusterShowInputStatusParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)showInputStatusWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)hideInputStatusWithParams:(MTRMediaInputClusterHideInputStatusParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)hideInputStatusWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)renameInputWithParams:(MTRMediaInputClusterRenameInputParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; + +- (NSDictionary *)readAttributeInputListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeCurrentInputWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Low Power + * + */ +@interface MTRClusterLowPower : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)sleepWithParams:(MTRLowPowerClusterSleepParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)sleepWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Keypad Input + * + */ +@interface MTRClusterKeypadInput : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)sendKeyWithParams:(MTRKeypadInputClusterSendKeyParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRKeypadInputClusterSendKeyResponseParams * _Nullable data, NSError * _Nullable error))completionHandler; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Content Launcher + * + */ +@interface MTRClusterContentLauncher : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)launchContentWithParams:(MTRContentLauncherClusterLaunchContentParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRContentLauncherClusterLaunchResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)launchURLWithParams:(MTRContentLauncherClusterLaunchURLParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRContentLauncherClusterLaunchResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; + +- (NSDictionary *)readAttributeAcceptHeaderWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeSupportedStreamingProtocolsWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeSupportedStreamingProtocolsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeSupportedStreamingProtocolsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Audio Output + * + */ +@interface MTRClusterAudioOutput : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)selectOutputWithParams:(MTRAudioOutputClusterSelectOutputParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)renameOutputWithParams:(MTRAudioOutputClusterRenameOutputParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; + +- (NSDictionary *)readAttributeOutputListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeCurrentOutputWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Application Launcher + * + */ +@interface MTRClusterApplicationLauncher : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)launchAppWithParams:(MTRApplicationLauncherClusterLaunchAppParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)stopAppWithParams:(MTRApplicationLauncherClusterStopAppParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)hideAppWithParams:(MTRApplicationLauncherClusterHideAppParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; + +- (NSDictionary *)readAttributeCatalogListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeCurrentAppWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeCurrentAppWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeCurrentAppWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Application Basic + * + */ +@interface MTRClusterApplicationBasic : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (NSDictionary *)readAttributeVendorNameWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeVendorIDWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeApplicationNameWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeProductIDWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeApplicationWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeStatusWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeApplicationVersionWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAllowedVendorListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Account Login + * + */ +@interface MTRClusterAccountLogin : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)getSetupPINWithParams:(MTRAccountLoginClusterGetSetupPINParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRAccountLoginClusterGetSetupPINResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)loginWithParams:(MTRAccountLoginClusterLoginParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)logoutWithParams:(MTRAccountLoginClusterLogoutParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)logoutWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Electrical Measurement + * + */ +@interface MTRClusterElectricalMeasurement : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)getProfileInfoCommandWithParams:(MTRElectricalMeasurementClusterGetProfileInfoCommandParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)getProfileInfoCommandWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)getMeasurementProfileCommandWithParams:(MTRElectricalMeasurementClusterGetMeasurementProfileCommandParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; + +- (NSDictionary *)readAttributeMeasurementTypeWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeDcVoltageWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeDcVoltageMinWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeDcVoltageMaxWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeDcCurrentWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeDcCurrentMinWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeDcCurrentMaxWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeDcPowerWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeDcPowerMinWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeDcPowerMaxWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeDcVoltageMultiplierWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeDcVoltageDivisorWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeDcCurrentMultiplierWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeDcCurrentDivisorWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeDcPowerMultiplierWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeDcPowerDivisorWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcFrequencyWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcFrequencyMinWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcFrequencyMaxWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeNeutralCurrentWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeTotalActivePowerWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeTotalReactivePowerWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeTotalApparentPowerWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMeasured1stHarmonicCurrentWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMeasured3rdHarmonicCurrentWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMeasured5thHarmonicCurrentWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMeasured7thHarmonicCurrentWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMeasured9thHarmonicCurrentWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMeasured11thHarmonicCurrentWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMeasuredPhase1stHarmonicCurrentWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMeasuredPhase3rdHarmonicCurrentWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMeasuredPhase5thHarmonicCurrentWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMeasuredPhase7thHarmonicCurrentWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMeasuredPhase9thHarmonicCurrentWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeMeasuredPhase11thHarmonicCurrentWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcFrequencyMultiplierWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcFrequencyDivisorWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePowerMultiplierWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePowerDivisorWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeHarmonicCurrentMultiplierWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePhaseHarmonicCurrentMultiplierWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeInstantaneousVoltageWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeInstantaneousLineCurrentWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeInstantaneousActiveCurrentWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeInstantaneousReactiveCurrentWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeInstantaneousPowerWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRmsVoltageWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRmsVoltageMinWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRmsVoltageMaxWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRmsCurrentWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRmsCurrentMinWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRmsCurrentMaxWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeActivePowerWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeActivePowerMinWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeActivePowerMaxWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeReactivePowerWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeApparentPowerWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePowerFactorWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAverageRmsVoltageMeasurementPeriodWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeAverageRmsVoltageMeasurementPeriodWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeAverageRmsVoltageMeasurementPeriodWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeAverageRmsUnderVoltageCounterWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeAverageRmsUnderVoltageCounterWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeAverageRmsUnderVoltageCounterWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeRmsExtremeOverVoltagePeriodWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeRmsExtremeOverVoltagePeriodWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeRmsExtremeOverVoltagePeriodWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeRmsExtremeUnderVoltagePeriodWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeRmsExtremeUnderVoltagePeriodWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeRmsExtremeUnderVoltagePeriodWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeRmsVoltageSagPeriodWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeRmsVoltageSagPeriodWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeRmsVoltageSagPeriodWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeRmsVoltageSwellPeriodWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeRmsVoltageSwellPeriodWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeRmsVoltageSwellPeriodWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcVoltageMultiplierWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcVoltageDivisorWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcCurrentMultiplierWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcCurrentDivisorWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcPowerMultiplierWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcPowerDivisorWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeOverloadAlarmsMaskWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeOverloadAlarmsMaskWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeOverloadAlarmsMaskWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeVoltageOverloadWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeCurrentOverloadWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcOverloadAlarmsMaskWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeAcOverloadAlarmsMaskWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeAcOverloadAlarmsMaskWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcVoltageOverloadWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcCurrentOverloadWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcActivePowerOverloadWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcReactivePowerOverloadWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAverageRmsOverVoltageWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAverageRmsUnderVoltageWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRmsExtremeOverVoltageWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRmsExtremeUnderVoltageWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRmsVoltageSagWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRmsVoltageSwellWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeLineCurrentPhaseBWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeActiveCurrentPhaseBWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeReactiveCurrentPhaseBWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRmsVoltagePhaseBWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRmsVoltageMinPhaseBWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRmsVoltageMaxPhaseBWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRmsCurrentPhaseBWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRmsCurrentMinPhaseBWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRmsCurrentMaxPhaseBWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeActivePowerPhaseBWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeActivePowerMinPhaseBWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeActivePowerMaxPhaseBWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeReactivePowerPhaseBWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeApparentPowerPhaseBWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePowerFactorPhaseBWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAverageRmsVoltageMeasurementPeriodPhaseBWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAverageRmsOverVoltageCounterPhaseBWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAverageRmsUnderVoltageCounterPhaseBWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRmsExtremeOverVoltagePeriodPhaseBWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRmsExtremeUnderVoltagePeriodPhaseBWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRmsVoltageSagPeriodPhaseBWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRmsVoltageSwellPeriodPhaseBWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeLineCurrentPhaseCWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeActiveCurrentPhaseCWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeReactiveCurrentPhaseCWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRmsVoltagePhaseCWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRmsVoltageMinPhaseCWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRmsVoltageMaxPhaseCWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRmsCurrentPhaseCWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRmsCurrentMinPhaseCWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRmsCurrentMaxPhaseCWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeActivePowerPhaseCWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeActivePowerMinPhaseCWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeActivePowerMaxPhaseCWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeReactivePowerPhaseCWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeApparentPowerPhaseCWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributePowerFactorPhaseCWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAverageRmsVoltageMeasurementPeriodPhaseCWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAverageRmsOverVoltageCounterPhaseCWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAverageRmsUnderVoltageCounterPhaseCWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRmsExtremeOverVoltagePeriodPhaseCWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRmsExtremeUnderVoltagePeriodPhaseCWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRmsVoltageSagPeriodPhaseCWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeRmsVoltageSwellPeriodPhaseCWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +/** + * Cluster Test Cluster + * + */ +@interface MTRClusterTestCluster : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)testWithParams:(MTRTestClusterClusterTestParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)testWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)testNotHandledWithParams:(MTRTestClusterClusterTestNotHandledParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)testNotHandledWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)testSpecificWithParams:(MTRTestClusterClusterTestSpecificParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRTestClusterClusterTestSpecificResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)testSpecificWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRTestClusterClusterTestSpecificResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)testUnknownCommandWithParams:(MTRTestClusterClusterTestUnknownCommandParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)testUnknownCommandWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)testAddArgumentsWithParams:(MTRTestClusterClusterTestAddArgumentsParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRTestClusterClusterTestAddArgumentsResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)testSimpleArgumentRequestWithParams:(MTRTestClusterClusterTestSimpleArgumentRequestParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRTestClusterClusterTestSimpleArgumentResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)testStructArrayArgumentRequestWithParams:(MTRTestClusterClusterTestStructArrayArgumentRequestParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRTestClusterClusterTestStructArrayArgumentResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)testStructArgumentRequestWithParams:(MTRTestClusterClusterTestStructArgumentRequestParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRTestClusterClusterBooleanResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)testNestedStructArgumentRequestWithParams:(MTRTestClusterClusterTestNestedStructArgumentRequestParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRTestClusterClusterBooleanResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)testListStructArgumentRequestWithParams:(MTRTestClusterClusterTestListStructArgumentRequestParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRTestClusterClusterBooleanResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)testListInt8UArgumentRequestWithParams:(MTRTestClusterClusterTestListInt8UArgumentRequestParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRTestClusterClusterBooleanResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)testNestedStructListArgumentRequestWithParams:(MTRTestClusterClusterTestNestedStructListArgumentRequestParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRTestClusterClusterBooleanResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)testListNestedStructListArgumentRequestWithParams: + (MTRTestClusterClusterTestListNestedStructListArgumentRequestParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRTestClusterClusterBooleanResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)testListInt8UReverseRequestWithParams:(MTRTestClusterClusterTestListInt8UReverseRequestParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRTestClusterClusterTestListInt8UReverseResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)testEnumsRequestWithParams:(MTRTestClusterClusterTestEnumsRequestParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRTestClusterClusterTestEnumsResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)testNullableOptionalRequestWithParams:(MTRTestClusterClusterTestNullableOptionalRequestParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRTestClusterClusterTestNullableOptionalResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)testComplexNullableOptionalRequestWithParams:(MTRTestClusterClusterTestComplexNullableOptionalRequestParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRTestClusterClusterTestComplexNullableOptionalResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)simpleStructEchoRequestWithParams:(MTRTestClusterClusterSimpleStructEchoRequestParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRTestClusterClusterSimpleStructResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)timedInvokeRequestWithParams:(MTRTestClusterClusterTimedInvokeRequestParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)timedInvokeRequestWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)testSimpleOptionalArgumentRequestWithParams:(MTRTestClusterClusterTestSimpleOptionalArgumentRequestParams * _Nullable)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler; +- (void)testEmitTestEventRequestWithParams:(MTRTestClusterClusterTestEmitTestEventRequestParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRTestClusterClusterTestEmitTestEventResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)testEmitTestFabricScopedEventRequestWithParams:(MTRTestClusterClusterTestEmitTestFabricScopedEventRequestParams *)params + expectedValues:(NSArray *> *)expectedDataValueDictionaries + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)( + MTRTestClusterClusterTestEmitTestFabricScopedEventResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; + +- (NSDictionary *)readAttributeBooleanWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeBooleanWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeBooleanWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeBitmap8WithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeBitmap8WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeBitmap8WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeBitmap16WithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeBitmap16WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeBitmap16WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeBitmap32WithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeBitmap32WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeBitmap32WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeBitmap64WithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeBitmap64WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeBitmap64WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeInt8uWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeInt8uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeInt8uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeInt16uWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeInt16uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeInt16uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeInt24uWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeInt24uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeInt24uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeInt32uWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeInt32uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeInt32uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeInt40uWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeInt40uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeInt40uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeInt48uWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeInt48uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeInt48uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeInt56uWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeInt56uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeInt56uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeInt64uWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeInt64uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeInt64uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeInt8sWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeInt8sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeInt8sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeInt16sWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeInt16sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeInt16sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeInt24sWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeInt24sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeInt24sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeInt32sWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeInt32sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeInt32sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeInt40sWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeInt40sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeInt40sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeInt48sWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeInt48sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeInt48sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeInt56sWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeInt56sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeInt56sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeInt64sWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeInt64sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeInt64sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeEnum8WithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeEnum8WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeEnum8WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeEnum16WithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeEnum16WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeEnum16WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeFloatSingleWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeFloatSingleWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeFloatSingleWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeFloatDoubleWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeFloatDoubleWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeFloatDoubleWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeOctetStringWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeOctetStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeOctetStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeListInt8uWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeListInt8uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeListInt8uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeListOctetStringWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeListOctetStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeListOctetStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeListStructOctetStringWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeListStructOctetStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeListStructOctetStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeLongOctetStringWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeLongOctetStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeLongOctetStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeCharStringWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeCharStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeCharStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeLongCharStringWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeLongCharStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeLongCharStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeEpochUsWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeEpochUsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeEpochUsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeEpochSWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeEpochSWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeEpochSWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeVendorIdWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeVendorIdWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeVendorIdWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeListNullablesAndOptionalsStructWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeListNullablesAndOptionalsStructWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeListNullablesAndOptionalsStructWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeEnumAttrWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeEnumAttrWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeEnumAttrWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeStructAttrWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeStructAttrWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeStructAttrWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeRangeRestrictedInt8uWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeRangeRestrictedInt8uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeRangeRestrictedInt8uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeRangeRestrictedInt8sWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeRangeRestrictedInt8sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeRangeRestrictedInt8sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeRangeRestrictedInt16uWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeRangeRestrictedInt16uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeRangeRestrictedInt16uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeRangeRestrictedInt16sWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeRangeRestrictedInt16sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeRangeRestrictedInt16sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeListLongOctetStringWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeListLongOctetStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeListLongOctetStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeListFabricScopedWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeListFabricScopedWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeListFabricScopedWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeTimedWriteBooleanWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeTimedWriteBooleanWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeTimedWriteBooleanWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneralErrorBooleanWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeGeneralErrorBooleanWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeGeneralErrorBooleanWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterErrorBooleanWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeClusterErrorBooleanWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeClusterErrorBooleanWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeUnsupportedWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeUnsupportedWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeUnsupportedWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeNullableBooleanWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeNullableBooleanWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeNullableBooleanWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeNullableBitmap8WithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeNullableBitmap8WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeNullableBitmap8WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeNullableBitmap16WithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeNullableBitmap16WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeNullableBitmap16WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeNullableBitmap32WithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeNullableBitmap32WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeNullableBitmap32WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeNullableBitmap64WithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeNullableBitmap64WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeNullableBitmap64WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeNullableInt8uWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeNullableInt8uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeNullableInt8uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeNullableInt16uWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeNullableInt16uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeNullableInt16uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeNullableInt24uWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeNullableInt24uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeNullableInt24uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeNullableInt32uWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeNullableInt32uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeNullableInt32uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeNullableInt40uWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeNullableInt40uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeNullableInt40uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeNullableInt48uWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeNullableInt48uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeNullableInt48uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeNullableInt56uWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeNullableInt56uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeNullableInt56uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeNullableInt64uWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeNullableInt64uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeNullableInt64uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeNullableInt8sWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeNullableInt8sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeNullableInt8sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeNullableInt16sWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeNullableInt16sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeNullableInt16sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeNullableInt24sWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeNullableInt24sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeNullableInt24sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeNullableInt32sWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeNullableInt32sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeNullableInt32sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeNullableInt40sWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeNullableInt40sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeNullableInt40sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeNullableInt48sWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeNullableInt48sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeNullableInt48sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeNullableInt56sWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeNullableInt56sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeNullableInt56sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeNullableInt64sWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeNullableInt64sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeNullableInt64sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeNullableEnum8WithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeNullableEnum8WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeNullableEnum8WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeNullableEnum16WithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeNullableEnum16WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeNullableEnum16WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeNullableFloatSingleWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeNullableFloatSingleWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeNullableFloatSingleWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeNullableFloatDoubleWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeNullableFloatDoubleWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeNullableFloatDoubleWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeNullableOctetStringWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeNullableOctetStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeNullableOctetStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeNullableCharStringWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeNullableCharStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeNullableCharStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeNullableEnumAttrWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeNullableEnumAttrWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeNullableEnumAttrWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeNullableStructWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeNullableStructWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeNullableStructWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeNullableRangeRestrictedInt8uWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeNullableRangeRestrictedInt8uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeNullableRangeRestrictedInt8uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeNullableRangeRestrictedInt8sWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeNullableRangeRestrictedInt8sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeNullableRangeRestrictedInt8sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeNullableRangeRestrictedInt16uWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeNullableRangeRestrictedInt16uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeNullableRangeRestrictedInt16uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeNullableRangeRestrictedInt16sWithParams:(MTRReadParams * _Nullable)params; +- (void)writeAttributeNullableRangeRestrictedInt16sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs; +- (void)writeAttributeNullableRangeRestrictedInt16sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm new file mode 100644 index 00000000000000..5b8c4d745a9d7d --- /dev/null +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -0,0 +1,22424 @@ +/* + * + * 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 + +#import + +#import "MTRAttributeCacheContainer_Internal.h" +#import "MTRBaseDevice_internal.h" +#import "MTRCallbackBridge_internal.h" +#import "MTRClusterConstants.h" +#import "MTRCluster_internal.h" +#import "MTRClusters_internal.h" +#import "MTRCommandPayloadsObjc.h" +#import "MTRDevice.h" +#import "MTRDevice_Internal.h" +#import "MTRStructsObjc.h" + +#include +#include +#include + +using chip::Callback::Callback; +using chip::Callback::Cancelable; +using namespace chip::app::Clusters; +using chip::Messaging::ExchangeManager; +using chip::SessionHandle; + +// NOLINTBEGIN(clang-analyzer-cplusplus.NewDeleteLeaks): Linter is unable to locate the delete on these objects. +@implementation MTRClusterIdentify + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)identifyWithParams:(MTRIdentifyClusterIdentifyParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + Identify::Commands::Identify::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.identifyTime = params.identifyTime.unsignedShortValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::IdentifyCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)triggerEffectWithParams:(MTRIdentifyClusterTriggerEffectParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + Identify::Commands::TriggerEffect::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.effectIdentifier = static_cast>( + params.effectIdentifier.unsignedCharValue); + request.effectVariant + = static_cast>(params.effectVariant.unsignedCharValue); + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::IdentifyCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeIdentifyTimeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterIdentifyID) + attributeId:@(MTRClusterIdentifyAttributeIdentifyTimeID) + params:params]; +} + +- (void)writeAttributeIdentifyTimeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeIdentifyTimeWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeIdentifyTimeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterIdentifyID) + attributeId:@(MTRClusterIdentifyAttributeIdentifyTimeID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeIdentifyTypeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterIdentifyID) + attributeId:@(MTRClusterIdentifyAttributeIdentifyTypeID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterIdentifyID) + attributeId:@(MTRClusterIdentifyAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterIdentifyID) + attributeId:@(MTRClusterIdentifyAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterIdentifyID) + attributeId:@(MTRClusterIdentifyAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterIdentifyID) + attributeId:@(MTRClusterIdentifyAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterIdentifyID) + attributeId:@(MTRClusterIdentifyAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterGroups + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)addGroupWithParams:(MTRGroupsClusterAddGroupParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRGroupsClusterAddGroupResponseParams * _Nullable data, NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRGroupsClusterAddGroupResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + Groups::Commands::AddGroup::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.groupId = params.groupId.unsignedShortValue; + request.groupName = [self asCharSpan:params.groupName]; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::GroupsCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)viewGroupWithParams:(MTRGroupsClusterViewGroupParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRGroupsClusterViewGroupResponseParams * _Nullable data, NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRGroupsClusterViewGroupResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + Groups::Commands::ViewGroup::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.groupId = params.groupId.unsignedShortValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::GroupsCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)getGroupMembershipWithParams:(MTRGroupsClusterGetGroupMembershipParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRGroupsClusterGetGroupMembershipResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRGroupsClusterGetGroupMembershipResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + Groups::Commands::GetGroupMembership::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (params.groupList.count != 0) { + auto * listHolder_0 = new ListHolder(params.groupList.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < params.groupList.count; ++i_0) { + if (![params.groupList[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) params.groupList[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedShortValue; + } + request.groupList = ListType_0(listHolder_0->mList, params.groupList.count); + } else { + request.groupList = ListType_0(); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::GroupsCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)removeGroupWithParams:(MTRGroupsClusterRemoveGroupParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRGroupsClusterRemoveGroupResponseParams * _Nullable data, NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRGroupsClusterRemoveGroupResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + Groups::Commands::RemoveGroup::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.groupId = params.groupId.unsignedShortValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::GroupsCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)removeAllGroupsWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + [self removeAllGroupsWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completionHandler:completionHandler]; +} +- (void)removeAllGroupsWithParams:(MTRGroupsClusterRemoveAllGroupsParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + Groups::Commands::RemoveAllGroups::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::GroupsCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)addGroupIfIdentifyingWithParams:(MTRGroupsClusterAddGroupIfIdentifyingParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + Groups::Commands::AddGroupIfIdentifying::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.groupId = params.groupId.unsignedShortValue; + request.groupName = [self asCharSpan:params.groupName]; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::GroupsCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeNameSupportWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGroupsID) + attributeId:@(MTRClusterGroupsAttributeNameSupportID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGroupsID) + attributeId:@(MTRClusterGroupsAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGroupsID) + attributeId:@(MTRClusterGroupsAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGroupsID) + attributeId:@(MTRClusterGroupsAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGroupsID) + attributeId:@(MTRClusterGroupsAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGroupsID) + attributeId:@(MTRClusterGroupsAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterScenes + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)addSceneWithParams:(MTRScenesClusterAddSceneParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRScenesClusterAddSceneResponseParams * _Nullable data, NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRScenesClusterAddSceneResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + Scenes::Commands::AddScene::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.groupId = params.groupId.unsignedShortValue; + request.sceneId = params.sceneId.unsignedCharValue; + request.transitionTime = params.transitionTime.unsignedShortValue; + request.sceneName = [self asCharSpan:params.sceneName]; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (params.extensionFieldSets.count != 0) { + auto * listHolder_0 = new ListHolder(params.extensionFieldSets.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < params.extensionFieldSets.count; ++i_0) { + if (![params.extensionFieldSets[i_0] isKindOfClass:[MTRScenesClusterExtensionFieldSet class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (MTRScenesClusterExtensionFieldSet *) params.extensionFieldSets[i_0]; + listHolder_0->mList[i_0].clusterId = element_0.clusterId.unsignedIntValue; + { + using ListType_2 = std::remove_reference_tmList[i_0].attributeValueList)>; + using ListMemberType_2 = ListMemberTypeGetter::Type; + if (element_0.attributeValueList.count != 0) { + auto * listHolder_2 = new ListHolder(element_0.attributeValueList.count); + if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_2); + for (size_t i_2 = 0; i_2 < element_0.attributeValueList.count; ++i_2) { + if (![element_0.attributeValueList[i_2] + isKindOfClass:[MTRScenesClusterAttributeValuePair class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_2 = (MTRScenesClusterAttributeValuePair *) element_0.attributeValueList[i_2]; + if (element_2.attributeId != nil) { + auto & definedValue_4 = listHolder_2->mList[i_2].attributeId.Emplace(); + definedValue_4 = element_2.attributeId.unsignedIntValue; + } + { + using ListType_4 + = std::remove_reference_tmList[i_2].attributeValue)>; + using ListMemberType_4 = ListMemberTypeGetter::Type; + if (element_2.attributeValue.count != 0) { + auto * listHolder_4 + = new ListHolder(element_2.attributeValue.count); + if (listHolder_4 == nullptr || listHolder_4->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_4); + for (size_t i_4 = 0; i_4 < element_2.attributeValue.count; ++i_4) { + if (![element_2.attributeValue[i_4] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_4 = (NSNumber *) element_2.attributeValue[i_4]; + listHolder_4->mList[i_4] = element_4.unsignedCharValue; + } + listHolder_2->mList[i_2].attributeValue + = ListType_4(listHolder_4->mList, element_2.attributeValue.count); + } else { + listHolder_2->mList[i_2].attributeValue = ListType_4(); + } + } + } + listHolder_0->mList[i_0].attributeValueList + = ListType_2(listHolder_2->mList, element_0.attributeValueList.count); + } else { + listHolder_0->mList[i_0].attributeValueList = ListType_2(); + } + } + } + request.extensionFieldSets = ListType_0(listHolder_0->mList, params.extensionFieldSets.count); + } else { + request.extensionFieldSets = ListType_0(); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ScenesCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)viewSceneWithParams:(MTRScenesClusterViewSceneParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRScenesClusterViewSceneResponseParams * _Nullable data, NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRScenesClusterViewSceneResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + Scenes::Commands::ViewScene::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.groupId = params.groupId.unsignedShortValue; + request.sceneId = params.sceneId.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ScenesCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)removeSceneWithParams:(MTRScenesClusterRemoveSceneParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRScenesClusterRemoveSceneResponseParams * _Nullable data, NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRScenesClusterRemoveSceneResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + Scenes::Commands::RemoveScene::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.groupId = params.groupId.unsignedShortValue; + request.sceneId = params.sceneId.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ScenesCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)removeAllScenesWithParams:(MTRScenesClusterRemoveAllScenesParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRScenesClusterRemoveAllScenesResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRScenesClusterRemoveAllScenesResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + Scenes::Commands::RemoveAllScenes::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.groupId = params.groupId.unsignedShortValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ScenesCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)storeSceneWithParams:(MTRScenesClusterStoreSceneParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRScenesClusterStoreSceneResponseParams * _Nullable data, NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRScenesClusterStoreSceneResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + Scenes::Commands::StoreScene::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.groupId = params.groupId.unsignedShortValue; + request.sceneId = params.sceneId.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ScenesCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)recallSceneWithParams:(MTRScenesClusterRecallSceneParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + Scenes::Commands::RecallScene::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.groupId = params.groupId.unsignedShortValue; + request.sceneId = params.sceneId.unsignedCharValue; + if (params.transitionTime != nil) { + auto & definedValue_0 = request.transitionTime.Emplace(); + if (params.transitionTime == nil) { + definedValue_0.SetNull(); + } else { + auto & nonNullValue_1 = definedValue_0.SetNonNull(); + nonNullValue_1 = params.transitionTime.unsignedShortValue; + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ScenesCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)getSceneMembershipWithParams:(MTRScenesClusterGetSceneMembershipParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRScenesClusterGetSceneMembershipResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRScenesClusterGetSceneMembershipResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + Scenes::Commands::GetSceneMembership::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.groupId = params.groupId.unsignedShortValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ScenesCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)enhancedAddSceneWithParams:(MTRScenesClusterEnhancedAddSceneParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRScenesClusterEnhancedAddSceneResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRScenesClusterEnhancedAddSceneResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + Scenes::Commands::EnhancedAddScene::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.groupId = params.groupId.unsignedShortValue; + request.sceneId = params.sceneId.unsignedCharValue; + request.transitionTime = params.transitionTime.unsignedShortValue; + request.sceneName = [self asCharSpan:params.sceneName]; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (params.extensionFieldSets.count != 0) { + auto * listHolder_0 = new ListHolder(params.extensionFieldSets.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < params.extensionFieldSets.count; ++i_0) { + if (![params.extensionFieldSets[i_0] isKindOfClass:[MTRScenesClusterExtensionFieldSet class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (MTRScenesClusterExtensionFieldSet *) params.extensionFieldSets[i_0]; + listHolder_0->mList[i_0].clusterId = element_0.clusterId.unsignedIntValue; + { + using ListType_2 = std::remove_reference_tmList[i_0].attributeValueList)>; + using ListMemberType_2 = ListMemberTypeGetter::Type; + if (element_0.attributeValueList.count != 0) { + auto * listHolder_2 = new ListHolder(element_0.attributeValueList.count); + if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_2); + for (size_t i_2 = 0; i_2 < element_0.attributeValueList.count; ++i_2) { + if (![element_0.attributeValueList[i_2] + isKindOfClass:[MTRScenesClusterAttributeValuePair class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_2 = (MTRScenesClusterAttributeValuePair *) element_0.attributeValueList[i_2]; + if (element_2.attributeId != nil) { + auto & definedValue_4 = listHolder_2->mList[i_2].attributeId.Emplace(); + definedValue_4 = element_2.attributeId.unsignedIntValue; + } + { + using ListType_4 + = std::remove_reference_tmList[i_2].attributeValue)>; + using ListMemberType_4 = ListMemberTypeGetter::Type; + if (element_2.attributeValue.count != 0) { + auto * listHolder_4 + = new ListHolder(element_2.attributeValue.count); + if (listHolder_4 == nullptr || listHolder_4->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_4); + for (size_t i_4 = 0; i_4 < element_2.attributeValue.count; ++i_4) { + if (![element_2.attributeValue[i_4] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_4 = (NSNumber *) element_2.attributeValue[i_4]; + listHolder_4->mList[i_4] = element_4.unsignedCharValue; + } + listHolder_2->mList[i_2].attributeValue + = ListType_4(listHolder_4->mList, element_2.attributeValue.count); + } else { + listHolder_2->mList[i_2].attributeValue = ListType_4(); + } + } + } + listHolder_0->mList[i_0].attributeValueList + = ListType_2(listHolder_2->mList, element_0.attributeValueList.count); + } else { + listHolder_0->mList[i_0].attributeValueList = ListType_2(); + } + } + } + request.extensionFieldSets = ListType_0(listHolder_0->mList, params.extensionFieldSets.count); + } else { + request.extensionFieldSets = ListType_0(); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ScenesCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)enhancedViewSceneWithParams:(MTRScenesClusterEnhancedViewSceneParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRScenesClusterEnhancedViewSceneResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRScenesClusterEnhancedViewSceneResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + Scenes::Commands::EnhancedViewScene::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.groupId = params.groupId.unsignedShortValue; + request.sceneId = params.sceneId.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ScenesCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)copySceneWithParams:(MTRScenesClusterCopySceneParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRScenesClusterCopySceneResponseParams * _Nullable data, NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRScenesClusterCopySceneResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + Scenes::Commands::CopyScene::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.mode = static_cast>(params.mode.unsignedCharValue); + request.groupIdFrom = params.groupIdFrom.unsignedShortValue; + request.sceneIdFrom = params.sceneIdFrom.unsignedCharValue; + request.groupIdTo = params.groupIdTo.unsignedShortValue; + request.sceneIdTo = params.sceneIdTo.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ScenesCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeSceneCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterScenesID) + attributeId:@(MTRClusterScenesAttributeSceneCountID) + params:params]; +} + +- (NSDictionary *)readAttributeCurrentSceneWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterScenesID) + attributeId:@(MTRClusterScenesAttributeCurrentSceneID) + params:params]; +} + +- (NSDictionary *)readAttributeCurrentGroupWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterScenesID) + attributeId:@(MTRClusterScenesAttributeCurrentGroupID) + params:params]; +} + +- (NSDictionary *)readAttributeSceneValidWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterScenesID) + attributeId:@(MTRClusterScenesAttributeSceneValidID) + params:params]; +} + +- (NSDictionary *)readAttributeNameSupportWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterScenesID) + attributeId:@(MTRClusterScenesAttributeNameSupportID) + params:params]; +} + +- (NSDictionary *)readAttributeLastConfiguredByWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterScenesID) + attributeId:@(MTRClusterScenesAttributeLastConfiguredByID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterScenesID) + attributeId:@(MTRClusterScenesAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterScenesID) + attributeId:@(MTRClusterScenesAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterScenesID) + attributeId:@(MTRClusterScenesAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterScenesID) + attributeId:@(MTRClusterScenesAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterScenesID) + attributeId:@(MTRClusterScenesAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterOnOff + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)offWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + [self offWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completionHandler:completionHandler]; +} +- (void)offWithParams:(MTROnOffClusterOffParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + OnOff::Commands::Off::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::OnOffCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)onWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + [self onWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completionHandler:completionHandler]; +} +- (void)onWithParams:(MTROnOffClusterOnParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + OnOff::Commands::On::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::OnOffCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)toggleWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + [self toggleWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completionHandler:completionHandler]; +} +- (void)toggleWithParams:(MTROnOffClusterToggleParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + OnOff::Commands::Toggle::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::OnOffCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)offWithEffectWithParams:(MTROnOffClusterOffWithEffectParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + OnOff::Commands::OffWithEffect::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.effectId + = static_cast>(params.effectId.unsignedCharValue); + request.effectVariant + = static_cast>(params.effectVariant.unsignedCharValue); + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::OnOffCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)onWithRecallGlobalSceneWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + [self onWithRecallGlobalSceneWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completionHandler:completionHandler]; +} +- (void)onWithRecallGlobalSceneWithParams:(MTROnOffClusterOnWithRecallGlobalSceneParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + OnOff::Commands::OnWithRecallGlobalScene::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::OnOffCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)onWithTimedOffWithParams:(MTROnOffClusterOnWithTimedOffParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + OnOff::Commands::OnWithTimedOff::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.onOffControl + = static_cast>(params.onOffControl.unsignedCharValue); + request.onTime = params.onTime.unsignedShortValue; + request.offWaitTime = params.offWaitTime.unsignedShortValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::OnOffCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeOnOffWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOnOffID) + attributeId:@(MTRClusterOnOffAttributeOnOffID) + params:params]; +} + +- (NSDictionary *)readAttributeGlobalSceneControlWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOnOffID) + attributeId:@(MTRClusterOnOffAttributeGlobalSceneControlID) + params:params]; +} + +- (NSDictionary *)readAttributeOnTimeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOnOffID) + attributeId:@(MTRClusterOnOffAttributeOnTimeID) + params:params]; +} + +- (void)writeAttributeOnTimeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeOnTimeWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeOnTimeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOnOffID) + attributeId:@(MTRClusterOnOffAttributeOnTimeID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeOffWaitTimeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOnOffID) + attributeId:@(MTRClusterOnOffAttributeOffWaitTimeID) + params:params]; +} + +- (void)writeAttributeOffWaitTimeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeOffWaitTimeWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeOffWaitTimeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOnOffID) + attributeId:@(MTRClusterOnOffAttributeOffWaitTimeID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeStartUpOnOffWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOnOffID) + attributeId:@(MTRClusterOnOffAttributeStartUpOnOffID) + params:params]; +} + +- (void)writeAttributeStartUpOnOffWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeStartUpOnOffWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeStartUpOnOffWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOnOffID) + attributeId:@(MTRClusterOnOffAttributeStartUpOnOffID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOnOffID) + attributeId:@(MTRClusterOnOffAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOnOffID) + attributeId:@(MTRClusterOnOffAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOnOffID) + attributeId:@(MTRClusterOnOffAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOnOffID) + attributeId:@(MTRClusterOnOffAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOnOffID) + attributeId:@(MTRClusterOnOffAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterOnOffSwitchConfiguration + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (NSDictionary *)readAttributeSwitchTypeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOnOffSwitchConfigurationID) + attributeId:@(MTRClusterOnOffSwitchConfigurationAttributeSwitchTypeID) + params:params]; +} + +- (NSDictionary *)readAttributeSwitchActionsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOnOffSwitchConfigurationID) + attributeId:@(MTRClusterOnOffSwitchConfigurationAttributeSwitchActionsID) + params:params]; +} + +- (void)writeAttributeSwitchActionsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeSwitchActionsWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeSwitchActionsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOnOffSwitchConfigurationID) + attributeId:@(MTRClusterOnOffSwitchConfigurationAttributeSwitchActionsID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOnOffSwitchConfigurationID) + attributeId:@(MTRClusterOnOffSwitchConfigurationAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOnOffSwitchConfigurationID) + attributeId:@(MTRClusterOnOffSwitchConfigurationAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOnOffSwitchConfigurationID) + attributeId:@(MTRClusterOnOffSwitchConfigurationAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOnOffSwitchConfigurationID) + attributeId:@(MTRClusterOnOffSwitchConfigurationAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOnOffSwitchConfigurationID) + attributeId:@(MTRClusterOnOffSwitchConfigurationAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterLevelControl + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)moveToLevelWithParams:(MTRLevelControlClusterMoveToLevelParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + LevelControl::Commands::MoveToLevel::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.level = params.level.unsignedCharValue; + request.transitionTime = params.transitionTime.unsignedShortValue; + request.optionsMask = params.optionsMask.unsignedCharValue; + request.optionsOverride = params.optionsOverride.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::LevelControlCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)moveWithParams:(MTRLevelControlClusterMoveParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + LevelControl::Commands::Move::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.moveMode + = static_cast>(params.moveMode.unsignedCharValue); + request.rate = params.rate.unsignedCharValue; + request.optionsMask = params.optionsMask.unsignedCharValue; + request.optionsOverride = params.optionsOverride.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::LevelControlCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)stepWithParams:(MTRLevelControlClusterStepParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + LevelControl::Commands::Step::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.stepMode + = static_cast>(params.stepMode.unsignedCharValue); + request.stepSize = params.stepSize.unsignedCharValue; + request.transitionTime = params.transitionTime.unsignedShortValue; + request.optionsMask = params.optionsMask.unsignedCharValue; + request.optionsOverride = params.optionsOverride.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::LevelControlCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)stopWithParams:(MTRLevelControlClusterStopParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + LevelControl::Commands::Stop::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.optionsMask = params.optionsMask.unsignedCharValue; + request.optionsOverride = params.optionsOverride.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::LevelControlCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)moveToLevelWithOnOffWithParams:(MTRLevelControlClusterMoveToLevelWithOnOffParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + LevelControl::Commands::MoveToLevelWithOnOff::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.level = params.level.unsignedCharValue; + request.transitionTime = params.transitionTime.unsignedShortValue; + request.optionsMask = params.optionsMask.unsignedCharValue; + request.optionsOverride = params.optionsOverride.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::LevelControlCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)moveWithOnOffWithParams:(MTRLevelControlClusterMoveWithOnOffParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + LevelControl::Commands::MoveWithOnOff::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.moveMode + = static_cast>(params.moveMode.unsignedCharValue); + request.rate = params.rate.unsignedCharValue; + request.optionsMask = params.optionsMask.unsignedCharValue; + request.optionsOverride = params.optionsOverride.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::LevelControlCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)stepWithOnOffWithParams:(MTRLevelControlClusterStepWithOnOffParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + LevelControl::Commands::StepWithOnOff::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.stepMode + = static_cast>(params.stepMode.unsignedCharValue); + request.stepSize = params.stepSize.unsignedCharValue; + request.transitionTime = params.transitionTime.unsignedShortValue; + request.optionsMask = params.optionsMask.unsignedCharValue; + request.optionsOverride = params.optionsOverride.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::LevelControlCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)stopWithOnOffWithParams:(MTRLevelControlClusterStopWithOnOffParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + LevelControl::Commands::StopWithOnOff::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.optionsMask = params.optionsMask.unsignedCharValue; + request.optionsOverride = params.optionsOverride.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::LevelControlCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)moveToClosestFrequencyWithParams:(MTRLevelControlClusterMoveToClosestFrequencyParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + LevelControl::Commands::MoveToClosestFrequency::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.frequency = params.frequency.unsignedShortValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::LevelControlCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeCurrentLevelWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLevelControlID) + attributeId:@(MTRClusterLevelControlAttributeCurrentLevelID) + params:params]; +} + +- (NSDictionary *)readAttributeRemainingTimeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLevelControlID) + attributeId:@(MTRClusterLevelControlAttributeRemainingTimeID) + params:params]; +} + +- (NSDictionary *)readAttributeMinLevelWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLevelControlID) + attributeId:@(MTRClusterLevelControlAttributeMinLevelID) + params:params]; +} + +- (NSDictionary *)readAttributeMaxLevelWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLevelControlID) + attributeId:@(MTRClusterLevelControlAttributeMaxLevelID) + params:params]; +} + +- (NSDictionary *)readAttributeCurrentFrequencyWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLevelControlID) + attributeId:@(MTRClusterLevelControlAttributeCurrentFrequencyID) + params:params]; +} + +- (NSDictionary *)readAttributeMinFrequencyWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLevelControlID) + attributeId:@(MTRClusterLevelControlAttributeMinFrequencyID) + params:params]; +} + +- (NSDictionary *)readAttributeMaxFrequencyWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLevelControlID) + attributeId:@(MTRClusterLevelControlAttributeMaxFrequencyID) + params:params]; +} + +- (NSDictionary *)readAttributeOptionsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLevelControlID) + attributeId:@(MTRClusterLevelControlAttributeOptionsID) + params:params]; +} + +- (void)writeAttributeOptionsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeOptionsWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeOptionsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLevelControlID) + attributeId:@(MTRClusterLevelControlAttributeOptionsID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeOnOffTransitionTimeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLevelControlID) + attributeId:@(MTRClusterLevelControlAttributeOnOffTransitionTimeID) + params:params]; +} + +- (void)writeAttributeOnOffTransitionTimeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeOnOffTransitionTimeWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeOnOffTransitionTimeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLevelControlID) + attributeId:@(MTRClusterLevelControlAttributeOnOffTransitionTimeID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeOnLevelWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLevelControlID) + attributeId:@(MTRClusterLevelControlAttributeOnLevelID) + params:params]; +} + +- (void)writeAttributeOnLevelWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeOnLevelWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeOnLevelWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLevelControlID) + attributeId:@(MTRClusterLevelControlAttributeOnLevelID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeOnTransitionTimeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLevelControlID) + attributeId:@(MTRClusterLevelControlAttributeOnTransitionTimeID) + params:params]; +} + +- (void)writeAttributeOnTransitionTimeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeOnTransitionTimeWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeOnTransitionTimeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLevelControlID) + attributeId:@(MTRClusterLevelControlAttributeOnTransitionTimeID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeOffTransitionTimeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLevelControlID) + attributeId:@(MTRClusterLevelControlAttributeOffTransitionTimeID) + params:params]; +} + +- (void)writeAttributeOffTransitionTimeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeOffTransitionTimeWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeOffTransitionTimeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLevelControlID) + attributeId:@(MTRClusterLevelControlAttributeOffTransitionTimeID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeDefaultMoveRateWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLevelControlID) + attributeId:@(MTRClusterLevelControlAttributeDefaultMoveRateID) + params:params]; +} + +- (void)writeAttributeDefaultMoveRateWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeDefaultMoveRateWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeDefaultMoveRateWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLevelControlID) + attributeId:@(MTRClusterLevelControlAttributeDefaultMoveRateID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeStartUpCurrentLevelWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLevelControlID) + attributeId:@(MTRClusterLevelControlAttributeStartUpCurrentLevelID) + params:params]; +} + +- (void)writeAttributeStartUpCurrentLevelWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeStartUpCurrentLevelWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeStartUpCurrentLevelWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLevelControlID) + attributeId:@(MTRClusterLevelControlAttributeStartUpCurrentLevelID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLevelControlID) + attributeId:@(MTRClusterLevelControlAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLevelControlID) + attributeId:@(MTRClusterLevelControlAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLevelControlID) + attributeId:@(MTRClusterLevelControlAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLevelControlID) + attributeId:@(MTRClusterLevelControlAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLevelControlID) + attributeId:@(MTRClusterLevelControlAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterBinaryInputBasic + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (NSDictionary *)readAttributeActiveTextWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBinaryInputBasicID) + attributeId:@(MTRClusterBinaryInputBasicAttributeActiveTextID) + params:params]; +} + +- (void)writeAttributeActiveTextWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeActiveTextWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeActiveTextWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBinaryInputBasicID) + attributeId:@(MTRClusterBinaryInputBasicAttributeActiveTextID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeDescriptionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBinaryInputBasicID) + attributeId:@(MTRClusterBinaryInputBasicAttributeDescriptionID) + params:params]; +} + +- (void)writeAttributeDescriptionWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeDescriptionWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeDescriptionWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBinaryInputBasicID) + attributeId:@(MTRClusterBinaryInputBasicAttributeDescriptionID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeInactiveTextWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBinaryInputBasicID) + attributeId:@(MTRClusterBinaryInputBasicAttributeInactiveTextID) + params:params]; +} + +- (void)writeAttributeInactiveTextWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeInactiveTextWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeInactiveTextWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBinaryInputBasicID) + attributeId:@(MTRClusterBinaryInputBasicAttributeInactiveTextID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeOutOfServiceWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBinaryInputBasicID) + attributeId:@(MTRClusterBinaryInputBasicAttributeOutOfServiceID) + params:params]; +} + +- (void)writeAttributeOutOfServiceWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeOutOfServiceWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeOutOfServiceWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBinaryInputBasicID) + attributeId:@(MTRClusterBinaryInputBasicAttributeOutOfServiceID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributePolarityWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBinaryInputBasicID) + attributeId:@(MTRClusterBinaryInputBasicAttributePolarityID) + params:params]; +} + +- (NSDictionary *)readAttributePresentValueWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBinaryInputBasicID) + attributeId:@(MTRClusterBinaryInputBasicAttributePresentValueID) + params:params]; +} + +- (void)writeAttributePresentValueWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributePresentValueWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributePresentValueWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBinaryInputBasicID) + attributeId:@(MTRClusterBinaryInputBasicAttributePresentValueID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeReliabilityWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBinaryInputBasicID) + attributeId:@(MTRClusterBinaryInputBasicAttributeReliabilityID) + params:params]; +} + +- (void)writeAttributeReliabilityWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeReliabilityWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeReliabilityWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBinaryInputBasicID) + attributeId:@(MTRClusterBinaryInputBasicAttributeReliabilityID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeStatusFlagsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBinaryInputBasicID) + attributeId:@(MTRClusterBinaryInputBasicAttributeStatusFlagsID) + params:params]; +} + +- (NSDictionary *)readAttributeApplicationTypeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBinaryInputBasicID) + attributeId:@(MTRClusterBinaryInputBasicAttributeApplicationTypeID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBinaryInputBasicID) + attributeId:@(MTRClusterBinaryInputBasicAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBinaryInputBasicID) + attributeId:@(MTRClusterBinaryInputBasicAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBinaryInputBasicID) + attributeId:@(MTRClusterBinaryInputBasicAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBinaryInputBasicID) + attributeId:@(MTRClusterBinaryInputBasicAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBinaryInputBasicID) + attributeId:@(MTRClusterBinaryInputBasicAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterDescriptor + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (NSDictionary *)readAttributeDeviceListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDescriptorID) + attributeId:@(MTRClusterDescriptorAttributeDeviceListID) + params:params]; +} + +- (NSDictionary *)readAttributeServerListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDescriptorID) + attributeId:@(MTRClusterDescriptorAttributeServerListID) + params:params]; +} + +- (NSDictionary *)readAttributeClientListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDescriptorID) + attributeId:@(MTRClusterDescriptorAttributeClientListID) + params:params]; +} + +- (NSDictionary *)readAttributePartsListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDescriptorID) + attributeId:@(MTRClusterDescriptorAttributePartsListID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDescriptorID) + attributeId:@(MTRClusterDescriptorAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDescriptorID) + attributeId:@(MTRClusterDescriptorAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDescriptorID) + attributeId:@(MTRClusterDescriptorAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDescriptorID) + attributeId:@(MTRClusterDescriptorAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDescriptorID) + attributeId:@(MTRClusterDescriptorAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterBinding + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (NSDictionary *)readAttributeBindingWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBindingID) + attributeId:@(MTRClusterBindingAttributeBindingID) + params:params]; +} + +- (void)writeAttributeBindingWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeBindingWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeBindingWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBindingID) + attributeId:@(MTRClusterBindingAttributeBindingID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBindingID) + attributeId:@(MTRClusterBindingAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBindingID) + attributeId:@(MTRClusterBindingAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBindingID) + attributeId:@(MTRClusterBindingAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBindingID) + attributeId:@(MTRClusterBindingAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBindingID) + attributeId:@(MTRClusterBindingAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterAccessControl + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (NSDictionary *)readAttributeAclWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterAccessControlID) + attributeId:@(MTRClusterAccessControlAttributeAclID) + params:params]; +} + +- (void)writeAttributeAclWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeAclWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeAclWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterAccessControlID) + attributeId:@(MTRClusterAccessControlAttributeAclID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeExtensionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterAccessControlID) + attributeId:@(MTRClusterAccessControlAttributeExtensionID) + params:params]; +} + +- (void)writeAttributeExtensionWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeExtensionWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeExtensionWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterAccessControlID) + attributeId:@(MTRClusterAccessControlAttributeExtensionID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeSubjectsPerAccessControlEntryWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterAccessControlID) + attributeId:@(MTRClusterAccessControlAttributeSubjectsPerAccessControlEntryID) + params:params]; +} + +- (NSDictionary *)readAttributeTargetsPerAccessControlEntryWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterAccessControlID) + attributeId:@(MTRClusterAccessControlAttributeTargetsPerAccessControlEntryID) + params:params]; +} + +- (NSDictionary *)readAttributeAccessControlEntriesPerFabricWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterAccessControlID) + attributeId:@(MTRClusterAccessControlAttributeAccessControlEntriesPerFabricID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterAccessControlID) + attributeId:@(MTRClusterAccessControlAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterAccessControlID) + attributeId:@(MTRClusterAccessControlAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterAccessControlID) + attributeId:@(MTRClusterAccessControlAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterAccessControlID) + attributeId:@(MTRClusterAccessControlAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterAccessControlID) + attributeId:@(MTRClusterAccessControlAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterBridgedActions + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)instantActionWithParams:(MTRBridgedActionsClusterInstantActionParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + BridgedActions::Commands::InstantAction::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.actionID = params.actionID.unsignedShortValue; + if (params.invokeID != nil) { + auto & definedValue_0 = request.invokeID.Emplace(); + definedValue_0 = params.invokeID.unsignedIntValue; + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::BridgedActionsCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)instantActionWithTransitionWithParams:(MTRBridgedActionsClusterInstantActionWithTransitionParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + BridgedActions::Commands::InstantActionWithTransition::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.actionID = params.actionID.unsignedShortValue; + if (params.invokeID != nil) { + auto & definedValue_0 = request.invokeID.Emplace(); + definedValue_0 = params.invokeID.unsignedIntValue; + } + request.transitionTime = params.transitionTime.unsignedShortValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::BridgedActionsCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)startActionWithParams:(MTRBridgedActionsClusterStartActionParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + BridgedActions::Commands::StartAction::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.actionID = params.actionID.unsignedShortValue; + if (params.invokeID != nil) { + auto & definedValue_0 = request.invokeID.Emplace(); + definedValue_0 = params.invokeID.unsignedIntValue; + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::BridgedActionsCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)startActionWithDurationWithParams:(MTRBridgedActionsClusterStartActionWithDurationParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + BridgedActions::Commands::StartActionWithDuration::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.actionID = params.actionID.unsignedShortValue; + if (params.invokeID != nil) { + auto & definedValue_0 = request.invokeID.Emplace(); + definedValue_0 = params.invokeID.unsignedIntValue; + } + request.duration = params.duration.unsignedIntValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::BridgedActionsCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)stopActionWithParams:(MTRBridgedActionsClusterStopActionParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + BridgedActions::Commands::StopAction::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.actionID = params.actionID.unsignedShortValue; + if (params.invokeID != nil) { + auto & definedValue_0 = request.invokeID.Emplace(); + definedValue_0 = params.invokeID.unsignedIntValue; + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::BridgedActionsCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)pauseActionWithParams:(MTRBridgedActionsClusterPauseActionParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + BridgedActions::Commands::PauseAction::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.actionID = params.actionID.unsignedShortValue; + if (params.invokeID != nil) { + auto & definedValue_0 = request.invokeID.Emplace(); + definedValue_0 = params.invokeID.unsignedIntValue; + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::BridgedActionsCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)pauseActionWithDurationWithParams:(MTRBridgedActionsClusterPauseActionWithDurationParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + BridgedActions::Commands::PauseActionWithDuration::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.actionID = params.actionID.unsignedShortValue; + if (params.invokeID != nil) { + auto & definedValue_0 = request.invokeID.Emplace(); + definedValue_0 = params.invokeID.unsignedIntValue; + } + request.duration = params.duration.unsignedIntValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::BridgedActionsCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)resumeActionWithParams:(MTRBridgedActionsClusterResumeActionParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + BridgedActions::Commands::ResumeAction::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.actionID = params.actionID.unsignedShortValue; + if (params.invokeID != nil) { + auto & definedValue_0 = request.invokeID.Emplace(); + definedValue_0 = params.invokeID.unsignedIntValue; + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::BridgedActionsCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)enableActionWithParams:(MTRBridgedActionsClusterEnableActionParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + BridgedActions::Commands::EnableAction::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.actionID = params.actionID.unsignedShortValue; + if (params.invokeID != nil) { + auto & definedValue_0 = request.invokeID.Emplace(); + definedValue_0 = params.invokeID.unsignedIntValue; + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::BridgedActionsCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)enableActionWithDurationWithParams:(MTRBridgedActionsClusterEnableActionWithDurationParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + BridgedActions::Commands::EnableActionWithDuration::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.actionID = params.actionID.unsignedShortValue; + if (params.invokeID != nil) { + auto & definedValue_0 = request.invokeID.Emplace(); + definedValue_0 = params.invokeID.unsignedIntValue; + } + request.duration = params.duration.unsignedIntValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::BridgedActionsCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)disableActionWithParams:(MTRBridgedActionsClusterDisableActionParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + BridgedActions::Commands::DisableAction::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.actionID = params.actionID.unsignedShortValue; + if (params.invokeID != nil) { + auto & definedValue_0 = request.invokeID.Emplace(); + definedValue_0 = params.invokeID.unsignedIntValue; + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::BridgedActionsCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)disableActionWithDurationWithParams:(MTRBridgedActionsClusterDisableActionWithDurationParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + BridgedActions::Commands::DisableActionWithDuration::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.actionID = params.actionID.unsignedShortValue; + if (params.invokeID != nil) { + auto & definedValue_0 = request.invokeID.Emplace(); + definedValue_0 = params.invokeID.unsignedIntValue; + } + request.duration = params.duration.unsignedIntValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::BridgedActionsCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeActionListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBridgedActionsID) + attributeId:@(MTRClusterBridgedActionsAttributeActionListID) + params:params]; +} + +- (NSDictionary *)readAttributeEndpointListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBridgedActionsID) + attributeId:@(MTRClusterBridgedActionsAttributeEndpointListID) + params:params]; +} + +- (NSDictionary *)readAttributeSetupUrlWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBridgedActionsID) + attributeId:@(MTRClusterBridgedActionsAttributeSetupUrlID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBridgedActionsID) + attributeId:@(MTRClusterBridgedActionsAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBridgedActionsID) + attributeId:@(MTRClusterBridgedActionsAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBridgedActionsID) + attributeId:@(MTRClusterBridgedActionsAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBridgedActionsID) + attributeId:@(MTRClusterBridgedActionsAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBridgedActionsID) + attributeId:@(MTRClusterBridgedActionsAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterBasic + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)mfgSpecificPingWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + [self mfgSpecificPingWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completionHandler:completionHandler]; +} +- (void)mfgSpecificPingWithParams:(MTRBasicClusterMfgSpecificPingParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + Basic::Commands::MfgSpecificPing::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::BasicCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeDataModelRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBasicID) + attributeId:@(MTRClusterBasicAttributeDataModelRevisionID) + params:params]; +} + +- (NSDictionary *)readAttributeVendorNameWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBasicID) + attributeId:@(MTRClusterBasicAttributeVendorNameID) + params:params]; +} + +- (NSDictionary *)readAttributeVendorIDWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBasicID) + attributeId:@(MTRClusterBasicAttributeVendorIDID) + params:params]; +} + +- (NSDictionary *)readAttributeProductNameWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBasicID) + attributeId:@(MTRClusterBasicAttributeProductNameID) + params:params]; +} + +- (NSDictionary *)readAttributeProductIDWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBasicID) + attributeId:@(MTRClusterBasicAttributeProductIDID) + params:params]; +} + +- (NSDictionary *)readAttributeNodeLabelWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBasicID) + attributeId:@(MTRClusterBasicAttributeNodeLabelID) + params:params]; +} + +- (void)writeAttributeNodeLabelWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNodeLabelWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNodeLabelWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBasicID) + attributeId:@(MTRClusterBasicAttributeNodeLabelID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeLocationWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBasicID) + attributeId:@(MTRClusterBasicAttributeLocationID) + params:params]; +} + +- (void)writeAttributeLocationWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeLocationWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeLocationWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBasicID) + attributeId:@(MTRClusterBasicAttributeLocationID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeHardwareVersionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBasicID) + attributeId:@(MTRClusterBasicAttributeHardwareVersionID) + params:params]; +} + +- (NSDictionary *)readAttributeHardwareVersionStringWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBasicID) + attributeId:@(MTRClusterBasicAttributeHardwareVersionStringID) + params:params]; +} + +- (NSDictionary *)readAttributeSoftwareVersionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBasicID) + attributeId:@(MTRClusterBasicAttributeSoftwareVersionID) + params:params]; +} + +- (NSDictionary *)readAttributeSoftwareVersionStringWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBasicID) + attributeId:@(MTRClusterBasicAttributeSoftwareVersionStringID) + params:params]; +} + +- (NSDictionary *)readAttributeManufacturingDateWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBasicID) + attributeId:@(MTRClusterBasicAttributeManufacturingDateID) + params:params]; +} + +- (NSDictionary *)readAttributePartNumberWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBasicID) + attributeId:@(MTRClusterBasicAttributePartNumberID) + params:params]; +} + +- (NSDictionary *)readAttributeProductURLWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBasicID) + attributeId:@(MTRClusterBasicAttributeProductURLID) + params:params]; +} + +- (NSDictionary *)readAttributeProductLabelWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBasicID) + attributeId:@(MTRClusterBasicAttributeProductLabelID) + params:params]; +} + +- (NSDictionary *)readAttributeSerialNumberWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBasicID) + attributeId:@(MTRClusterBasicAttributeSerialNumberID) + params:params]; +} + +- (NSDictionary *)readAttributeLocalConfigDisabledWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBasicID) + attributeId:@(MTRClusterBasicAttributeLocalConfigDisabledID) + params:params]; +} + +- (void)writeAttributeLocalConfigDisabledWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeLocalConfigDisabledWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeLocalConfigDisabledWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBasicID) + attributeId:@(MTRClusterBasicAttributeLocalConfigDisabledID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeReachableWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBasicID) + attributeId:@(MTRClusterBasicAttributeReachableID) + params:params]; +} + +- (NSDictionary *)readAttributeUniqueIDWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBasicID) + attributeId:@(MTRClusterBasicAttributeUniqueIDID) + params:params]; +} + +- (NSDictionary *)readAttributeCapabilityMinimaWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBasicID) + attributeId:@(MTRClusterBasicAttributeCapabilityMinimaID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBasicID) + attributeId:@(MTRClusterBasicAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBasicID) + attributeId:@(MTRClusterBasicAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBasicID) + attributeId:@(MTRClusterBasicAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBasicID) + attributeId:@(MTRClusterBasicAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBasicID) + attributeId:@(MTRClusterBasicAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterOtaSoftwareUpdateProvider + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)queryImageWithParams:(MTROtaSoftwareUpdateProviderClusterQueryImageParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTROtaSoftwareUpdateProviderClusterQueryImageResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTROtaSoftwareUpdateProviderClusterQueryImageResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + OtaSoftwareUpdateProvider::Commands::QueryImage::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.vendorId + = static_cast>(params.vendorId.unsignedShortValue); + request.productId = params.productId.unsignedShortValue; + request.softwareVersion = params.softwareVersion.unsignedIntValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (params.protocolsSupported.count != 0) { + auto * listHolder_0 = new ListHolder(params.protocolsSupported.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < params.protocolsSupported.count; ++i_0) { + if (![params.protocolsSupported[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) params.protocolsSupported[i_0]; + listHolder_0->mList[i_0] = static_castmList[i_0])>>( + element_0.unsignedCharValue); + } + request.protocolsSupported = ListType_0(listHolder_0->mList, params.protocolsSupported.count); + } else { + request.protocolsSupported = ListType_0(); + } + } + if (params.hardwareVersion != nil) { + auto & definedValue_0 = request.hardwareVersion.Emplace(); + definedValue_0 = params.hardwareVersion.unsignedShortValue; + } + if (params.location != nil) { + auto & definedValue_0 = request.location.Emplace(); + definedValue_0 = [self asCharSpan:params.location]; + } + if (params.requestorCanConsent != nil) { + auto & definedValue_0 = request.requestorCanConsent.Emplace(); + definedValue_0 = params.requestorCanConsent.boolValue; + } + if (params.metadataForProvider != nil) { + auto & definedValue_0 = request.metadataForProvider.Emplace(); + definedValue_0 = [self asByteSpan:params.metadataForProvider]; + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::OtaSoftwareUpdateProviderCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)applyUpdateRequestWithParams:(MTROtaSoftwareUpdateProviderClusterApplyUpdateRequestParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTROtaSoftwareUpdateProviderClusterApplyUpdateResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTROtaSoftwareUpdateProviderClusterApplyUpdateResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + OtaSoftwareUpdateProvider::Commands::ApplyUpdateRequest::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.updateToken = [self asByteSpan:params.updateToken]; + request.newVersion = params.newVersion.unsignedIntValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::OtaSoftwareUpdateProviderCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)notifyUpdateAppliedWithParams:(MTROtaSoftwareUpdateProviderClusterNotifyUpdateAppliedParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + OtaSoftwareUpdateProvider::Commands::NotifyUpdateApplied::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.updateToken = [self asByteSpan:params.updateToken]; + request.softwareVersion = params.softwareVersion.unsignedIntValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::OtaSoftwareUpdateProviderCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOtaSoftwareUpdateProviderID) + attributeId:@(MTRClusterOtaSoftwareUpdateProviderAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOtaSoftwareUpdateProviderID) + attributeId:@(MTRClusterOtaSoftwareUpdateProviderAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOtaSoftwareUpdateProviderID) + attributeId:@(MTRClusterOtaSoftwareUpdateProviderAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOtaSoftwareUpdateProviderID) + attributeId:@(MTRClusterOtaSoftwareUpdateProviderAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOtaSoftwareUpdateProviderID) + attributeId:@(MTRClusterOtaSoftwareUpdateProviderAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterOtaSoftwareUpdateRequestor + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)announceOtaProviderWithParams:(MTROtaSoftwareUpdateRequestorClusterAnnounceOtaProviderParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + OtaSoftwareUpdateRequestor::Commands::AnnounceOtaProvider::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.providerNodeId = params.providerNodeId.unsignedLongLongValue; + request.vendorId + = static_cast>(params.vendorId.unsignedShortValue); + request.announcementReason = static_cast>( + params.announcementReason.unsignedCharValue); + if (params.metadataForNode != nil) { + auto & definedValue_0 = request.metadataForNode.Emplace(); + definedValue_0 = [self asByteSpan:params.metadataForNode]; + } + request.endpoint = params.endpoint.unsignedShortValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::OtaSoftwareUpdateRequestorCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeDefaultOtaProvidersWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOtaSoftwareUpdateRequestorID) + attributeId:@(MTRClusterOtaSoftwareUpdateRequestorAttributeDefaultOtaProvidersID) + params:params]; +} + +- (void)writeAttributeDefaultOtaProvidersWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeDefaultOtaProvidersWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeDefaultOtaProvidersWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOtaSoftwareUpdateRequestorID) + attributeId:@(MTRClusterOtaSoftwareUpdateRequestorAttributeDefaultOtaProvidersID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeUpdatePossibleWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOtaSoftwareUpdateRequestorID) + attributeId:@(MTRClusterOtaSoftwareUpdateRequestorAttributeUpdatePossibleID) + params:params]; +} + +- (NSDictionary *)readAttributeUpdateStateWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOtaSoftwareUpdateRequestorID) + attributeId:@(MTRClusterOtaSoftwareUpdateRequestorAttributeUpdateStateID) + params:params]; +} + +- (NSDictionary *)readAttributeUpdateStateProgressWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOtaSoftwareUpdateRequestorID) + attributeId:@(MTRClusterOtaSoftwareUpdateRequestorAttributeUpdateStateProgressID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOtaSoftwareUpdateRequestorID) + attributeId:@(MTRClusterOtaSoftwareUpdateRequestorAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOtaSoftwareUpdateRequestorID) + attributeId:@(MTRClusterOtaSoftwareUpdateRequestorAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOtaSoftwareUpdateRequestorID) + attributeId:@(MTRClusterOtaSoftwareUpdateRequestorAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOtaSoftwareUpdateRequestorID) + attributeId:@(MTRClusterOtaSoftwareUpdateRequestorAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOtaSoftwareUpdateRequestorID) + attributeId:@(MTRClusterOtaSoftwareUpdateRequestorAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterLocalizationConfiguration + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (NSDictionary *)readAttributeActiveLocaleWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLocalizationConfigurationID) + attributeId:@(MTRClusterLocalizationConfigurationAttributeActiveLocaleID) + params:params]; +} + +- (void)writeAttributeActiveLocaleWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeActiveLocaleWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeActiveLocaleWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLocalizationConfigurationID) + attributeId:@(MTRClusterLocalizationConfigurationAttributeActiveLocaleID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeSupportedLocalesWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLocalizationConfigurationID) + attributeId:@(MTRClusterLocalizationConfigurationAttributeSupportedLocalesID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLocalizationConfigurationID) + attributeId:@(MTRClusterLocalizationConfigurationAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLocalizationConfigurationID) + attributeId:@(MTRClusterLocalizationConfigurationAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLocalizationConfigurationID) + attributeId:@(MTRClusterLocalizationConfigurationAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLocalizationConfigurationID) + attributeId:@(MTRClusterLocalizationConfigurationAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLocalizationConfigurationID) + attributeId:@(MTRClusterLocalizationConfigurationAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterTimeFormatLocalization + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (NSDictionary *)readAttributeHourFormatWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTimeFormatLocalizationID) + attributeId:@(MTRClusterTimeFormatLocalizationAttributeHourFormatID) + params:params]; +} + +- (void)writeAttributeHourFormatWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeHourFormatWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeHourFormatWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTimeFormatLocalizationID) + attributeId:@(MTRClusterTimeFormatLocalizationAttributeHourFormatID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeActiveCalendarTypeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTimeFormatLocalizationID) + attributeId:@(MTRClusterTimeFormatLocalizationAttributeActiveCalendarTypeID) + params:params]; +} + +- (void)writeAttributeActiveCalendarTypeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeActiveCalendarTypeWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeActiveCalendarTypeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTimeFormatLocalizationID) + attributeId:@(MTRClusterTimeFormatLocalizationAttributeActiveCalendarTypeID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeSupportedCalendarTypesWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTimeFormatLocalizationID) + attributeId:@(MTRClusterTimeFormatLocalizationAttributeSupportedCalendarTypesID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTimeFormatLocalizationID) + attributeId:@(MTRClusterTimeFormatLocalizationAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTimeFormatLocalizationID) + attributeId:@(MTRClusterTimeFormatLocalizationAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTimeFormatLocalizationID) + attributeId:@(MTRClusterTimeFormatLocalizationAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTimeFormatLocalizationID) + attributeId:@(MTRClusterTimeFormatLocalizationAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTimeFormatLocalizationID) + attributeId:@(MTRClusterTimeFormatLocalizationAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterUnitLocalization + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (NSDictionary *)readAttributeTemperatureUnitWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterUnitLocalizationID) + attributeId:@(MTRClusterUnitLocalizationAttributeTemperatureUnitID) + params:params]; +} + +- (void)writeAttributeTemperatureUnitWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeTemperatureUnitWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeTemperatureUnitWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterUnitLocalizationID) + attributeId:@(MTRClusterUnitLocalizationAttributeTemperatureUnitID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterUnitLocalizationID) + attributeId:@(MTRClusterUnitLocalizationAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterUnitLocalizationID) + attributeId:@(MTRClusterUnitLocalizationAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterUnitLocalizationID) + attributeId:@(MTRClusterUnitLocalizationAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterUnitLocalizationID) + attributeId:@(MTRClusterUnitLocalizationAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterUnitLocalizationID) + attributeId:@(MTRClusterUnitLocalizationAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterPowerSourceConfiguration + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (NSDictionary *)readAttributeSourcesWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceConfigurationID) + attributeId:@(MTRClusterPowerSourceConfigurationAttributeSourcesID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceConfigurationID) + attributeId:@(MTRClusterPowerSourceConfigurationAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceConfigurationID) + attributeId:@(MTRClusterPowerSourceConfigurationAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceConfigurationID) + attributeId:@(MTRClusterPowerSourceConfigurationAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceConfigurationID) + attributeId:@(MTRClusterPowerSourceConfigurationAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceConfigurationID) + attributeId:@(MTRClusterPowerSourceConfigurationAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterPowerSource + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (NSDictionary *)readAttributeStatusWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeStatusID) + params:params]; +} + +- (NSDictionary *)readAttributeOrderWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeOrderID) + params:params]; +} + +- (NSDictionary *)readAttributeDescriptionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeDescriptionID) + params:params]; +} + +- (NSDictionary *)readAttributeWiredAssessedInputVoltageWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeWiredAssessedInputVoltageID) + params:params]; +} + +- (NSDictionary *)readAttributeWiredAssessedInputFrequencyWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeWiredAssessedInputFrequencyID) + params:params]; +} + +- (NSDictionary *)readAttributeWiredCurrentTypeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeWiredCurrentTypeID) + params:params]; +} + +- (NSDictionary *)readAttributeWiredAssessedCurrentWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeWiredAssessedCurrentID) + params:params]; +} + +- (NSDictionary *)readAttributeWiredNominalVoltageWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeWiredNominalVoltageID) + params:params]; +} + +- (NSDictionary *)readAttributeWiredMaximumCurrentWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeWiredMaximumCurrentID) + params:params]; +} + +- (NSDictionary *)readAttributeWiredPresentWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeWiredPresentID) + params:params]; +} + +- (NSDictionary *)readAttributeActiveWiredFaultsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeActiveWiredFaultsID) + params:params]; +} + +- (NSDictionary *)readAttributeBatVoltageWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeBatVoltageID) + params:params]; +} + +- (NSDictionary *)readAttributeBatPercentRemainingWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeBatPercentRemainingID) + params:params]; +} + +- (NSDictionary *)readAttributeBatTimeRemainingWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeBatTimeRemainingID) + params:params]; +} + +- (NSDictionary *)readAttributeBatChargeLevelWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeBatChargeLevelID) + params:params]; +} + +- (NSDictionary *)readAttributeBatReplacementNeededWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeBatReplacementNeededID) + params:params]; +} + +- (NSDictionary *)readAttributeBatReplaceabilityWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeBatReplaceabilityID) + params:params]; +} + +- (NSDictionary *)readAttributeBatPresentWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeBatPresentID) + params:params]; +} + +- (NSDictionary *)readAttributeActiveBatFaultsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeActiveBatFaultsID) + params:params]; +} + +- (NSDictionary *)readAttributeBatReplacementDescriptionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeBatReplacementDescriptionID) + params:params]; +} + +- (NSDictionary *)readAttributeBatCommonDesignationWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeBatCommonDesignationID) + params:params]; +} + +- (NSDictionary *)readAttributeBatANSIDesignationWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeBatANSIDesignationID) + params:params]; +} + +- (NSDictionary *)readAttributeBatIECDesignationWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeBatIECDesignationID) + params:params]; +} + +- (NSDictionary *)readAttributeBatApprovedChemistryWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeBatApprovedChemistryID) + params:params]; +} + +- (NSDictionary *)readAttributeBatCapacityWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeBatCapacityID) + params:params]; +} + +- (NSDictionary *)readAttributeBatQuantityWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeBatQuantityID) + params:params]; +} + +- (NSDictionary *)readAttributeBatChargeStateWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeBatChargeStateID) + params:params]; +} + +- (NSDictionary *)readAttributeBatTimeToFullChargeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeBatTimeToFullChargeID) + params:params]; +} + +- (NSDictionary *)readAttributeBatFunctionalWhileChargingWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeBatFunctionalWhileChargingID) + params:params]; +} + +- (NSDictionary *)readAttributeBatChargingCurrentWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeBatChargingCurrentID) + params:params]; +} + +- (NSDictionary *)readAttributeActiveBatChargeFaultsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeActiveBatChargeFaultsID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPowerSourceID) + attributeId:@(MTRClusterPowerSourceAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterGeneralCommissioning + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)armFailSafeWithParams:(MTRGeneralCommissioningClusterArmFailSafeParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRGeneralCommissioningClusterArmFailSafeResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRGeneralCommissioningClusterArmFailSafeResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + GeneralCommissioning::Commands::ArmFailSafe::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.expiryLengthSeconds = params.expiryLengthSeconds.unsignedShortValue; + request.breadcrumb = params.breadcrumb.unsignedLongLongValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::GeneralCommissioningCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)setRegulatoryConfigWithParams:(MTRGeneralCommissioningClusterSetRegulatoryConfigParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRGeneralCommissioningClusterSetRegulatoryConfigResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRGeneralCommissioningClusterSetRegulatoryConfigResponseCallbackBridge(self.callbackQueue, baseDevice, + completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + GeneralCommissioning::Commands::SetRegulatoryConfig::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.newRegulatoryConfig = static_cast>( + params.newRegulatoryConfig.unsignedCharValue); + request.countryCode = [self asCharSpan:params.countryCode]; + request.breadcrumb = params.breadcrumb.unsignedLongLongValue; + + auto successFn + = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::GeneralCommissioningCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)commissioningCompleteWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRGeneralCommissioningClusterCommissioningCompleteResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + [self commissioningCompleteWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completionHandler:completionHandler]; +} +- (void)commissioningCompleteWithParams:(MTRGeneralCommissioningClusterCommissioningCompleteParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRGeneralCommissioningClusterCommissioningCompleteResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge(self.callbackQueue, baseDevice, + completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + GeneralCommissioning::Commands::CommissioningComplete::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + + auto successFn + = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::GeneralCommissioningCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeBreadcrumbWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGeneralCommissioningID) + attributeId:@(MTRClusterGeneralCommissioningAttributeBreadcrumbID) + params:params]; +} + +- (void)writeAttributeBreadcrumbWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeBreadcrumbWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeBreadcrumbWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGeneralCommissioningID) + attributeId:@(MTRClusterGeneralCommissioningAttributeBreadcrumbID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeBasicCommissioningInfoWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGeneralCommissioningID) + attributeId:@(MTRClusterGeneralCommissioningAttributeBasicCommissioningInfoID) + params:params]; +} + +- (NSDictionary *)readAttributeRegulatoryConfigWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGeneralCommissioningID) + attributeId:@(MTRClusterGeneralCommissioningAttributeRegulatoryConfigID) + params:params]; +} + +- (NSDictionary *)readAttributeLocationCapabilityWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGeneralCommissioningID) + attributeId:@(MTRClusterGeneralCommissioningAttributeLocationCapabilityID) + params:params]; +} + +- (NSDictionary *)readAttributeSupportsConcurrentConnectionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGeneralCommissioningID) + attributeId:@(MTRClusterGeneralCommissioningAttributeSupportsConcurrentConnectionID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGeneralCommissioningID) + attributeId:@(MTRClusterGeneralCommissioningAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGeneralCommissioningID) + attributeId:@(MTRClusterGeneralCommissioningAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGeneralCommissioningID) + attributeId:@(MTRClusterGeneralCommissioningAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGeneralCommissioningID) + attributeId:@(MTRClusterGeneralCommissioningAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGeneralCommissioningID) + attributeId:@(MTRClusterGeneralCommissioningAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterNetworkCommissioning + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)scanNetworksWithParams:(MTRNetworkCommissioningClusterScanNetworksParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRNetworkCommissioningClusterScanNetworksResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRNetworkCommissioningClusterScanNetworksResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + NetworkCommissioning::Commands::ScanNetworks::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + if (params != nil) { + if (params.ssid != nil) { + auto & definedValue_0 = request.ssid.Emplace(); + if (params.ssid == nil) { + definedValue_0.SetNull(); + } else { + auto & nonNullValue_1 = definedValue_0.SetNonNull(); + nonNullValue_1 = [self asByteSpan:params.ssid]; + } + } + if (params.breadcrumb != nil) { + auto & definedValue_0 = request.breadcrumb.Emplace(); + definedValue_0 = params.breadcrumb.unsignedLongLongValue; + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::NetworkCommissioningCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)addOrUpdateWiFiNetworkWithParams:(MTRNetworkCommissioningClusterAddOrUpdateWiFiNetworkParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRNetworkCommissioningClusterNetworkConfigResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + NetworkCommissioning::Commands::AddOrUpdateWiFiNetwork::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.ssid = [self asByteSpan:params.ssid]; + request.credentials = [self asByteSpan:params.credentials]; + if (params.breadcrumb != nil) { + auto & definedValue_0 = request.breadcrumb.Emplace(); + definedValue_0 = params.breadcrumb.unsignedLongLongValue; + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::NetworkCommissioningCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)addOrUpdateThreadNetworkWithParams:(MTRNetworkCommissioningClusterAddOrUpdateThreadNetworkParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRNetworkCommissioningClusterNetworkConfigResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + NetworkCommissioning::Commands::AddOrUpdateThreadNetwork::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.operationalDataset = [self asByteSpan:params.operationalDataset]; + if (params.breadcrumb != nil) { + auto & definedValue_0 = request.breadcrumb.Emplace(); + definedValue_0 = params.breadcrumb.unsignedLongLongValue; + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::NetworkCommissioningCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)removeNetworkWithParams:(MTRNetworkCommissioningClusterRemoveNetworkParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRNetworkCommissioningClusterNetworkConfigResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + NetworkCommissioning::Commands::RemoveNetwork::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.networkID = [self asByteSpan:params.networkID]; + if (params.breadcrumb != nil) { + auto & definedValue_0 = request.breadcrumb.Emplace(); + definedValue_0 = params.breadcrumb.unsignedLongLongValue; + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::NetworkCommissioningCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)connectNetworkWithParams:(MTRNetworkCommissioningClusterConnectNetworkParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRNetworkCommissioningClusterConnectNetworkResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRNetworkCommissioningClusterConnectNetworkResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + NetworkCommissioning::Commands::ConnectNetwork::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.networkID = [self asByteSpan:params.networkID]; + if (params.breadcrumb != nil) { + auto & definedValue_0 = request.breadcrumb.Emplace(); + definedValue_0 = params.breadcrumb.unsignedLongLongValue; + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::NetworkCommissioningCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)reorderNetworkWithParams:(MTRNetworkCommissioningClusterReorderNetworkParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRNetworkCommissioningClusterNetworkConfigResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + NetworkCommissioning::Commands::ReorderNetwork::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.networkID = [self asByteSpan:params.networkID]; + request.networkIndex = params.networkIndex.unsignedCharValue; + if (params.breadcrumb != nil) { + auto & definedValue_0 = request.breadcrumb.Emplace(); + definedValue_0 = params.breadcrumb.unsignedLongLongValue; + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::NetworkCommissioningCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeMaxNetworksWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterNetworkCommissioningID) + attributeId:@(MTRClusterNetworkCommissioningAttributeMaxNetworksID) + params:params]; +} + +- (NSDictionary *)readAttributeNetworksWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterNetworkCommissioningID) + attributeId:@(MTRClusterNetworkCommissioningAttributeNetworksID) + params:params]; +} + +- (NSDictionary *)readAttributeScanMaxTimeSecondsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterNetworkCommissioningID) + attributeId:@(MTRClusterNetworkCommissioningAttributeScanMaxTimeSecondsID) + params:params]; +} + +- (NSDictionary *)readAttributeConnectMaxTimeSecondsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterNetworkCommissioningID) + attributeId:@(MTRClusterNetworkCommissioningAttributeConnectMaxTimeSecondsID) + params:params]; +} + +- (NSDictionary *)readAttributeInterfaceEnabledWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterNetworkCommissioningID) + attributeId:@(MTRClusterNetworkCommissioningAttributeInterfaceEnabledID) + params:params]; +} + +- (void)writeAttributeInterfaceEnabledWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeInterfaceEnabledWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeInterfaceEnabledWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterNetworkCommissioningID) + attributeId:@(MTRClusterNetworkCommissioningAttributeInterfaceEnabledID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeLastNetworkingStatusWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterNetworkCommissioningID) + attributeId:@(MTRClusterNetworkCommissioningAttributeLastNetworkingStatusID) + params:params]; +} + +- (NSDictionary *)readAttributeLastNetworkIDWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterNetworkCommissioningID) + attributeId:@(MTRClusterNetworkCommissioningAttributeLastNetworkIDID) + params:params]; +} + +- (NSDictionary *)readAttributeLastConnectErrorValueWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterNetworkCommissioningID) + attributeId:@(MTRClusterNetworkCommissioningAttributeLastConnectErrorValueID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterNetworkCommissioningID) + attributeId:@(MTRClusterNetworkCommissioningAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterNetworkCommissioningID) + attributeId:@(MTRClusterNetworkCommissioningAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterNetworkCommissioningID) + attributeId:@(MTRClusterNetworkCommissioningAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterNetworkCommissioningID) + attributeId:@(MTRClusterNetworkCommissioningAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterNetworkCommissioningID) + attributeId:@(MTRClusterNetworkCommissioningAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterDiagnosticLogs + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)retrieveLogsRequestWithParams:(MTRDiagnosticLogsClusterRetrieveLogsRequestParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRDiagnosticLogsClusterRetrieveLogsResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRDiagnosticLogsClusterRetrieveLogsResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + DiagnosticLogs::Commands::RetrieveLogsRequest::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.intent = static_cast>(params.intent.unsignedCharValue); + request.requestedProtocol = static_cast>( + params.requestedProtocol.unsignedCharValue); + request.transferFileDesignator = [self asByteSpan:params.transferFileDesignator]; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::DiagnosticLogsCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDiagnosticLogsID) + attributeId:@(MTRClusterDiagnosticLogsAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDiagnosticLogsID) + attributeId:@(MTRClusterDiagnosticLogsAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDiagnosticLogsID) + attributeId:@(MTRClusterDiagnosticLogsAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDiagnosticLogsID) + attributeId:@(MTRClusterDiagnosticLogsAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDiagnosticLogsID) + attributeId:@(MTRClusterDiagnosticLogsAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterGeneralDiagnostics + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)testEventTriggerWithParams:(MTRGeneralDiagnosticsClusterTestEventTriggerParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + GeneralDiagnostics::Commands::TestEventTrigger::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.enableKey = [self asByteSpan:params.enableKey]; + request.eventTrigger = params.eventTrigger.unsignedLongLongValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::GeneralDiagnosticsCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeNetworkInterfacesWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGeneralDiagnosticsID) + attributeId:@(MTRClusterGeneralDiagnosticsAttributeNetworkInterfacesID) + params:params]; +} + +- (NSDictionary *)readAttributeRebootCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGeneralDiagnosticsID) + attributeId:@(MTRClusterGeneralDiagnosticsAttributeRebootCountID) + params:params]; +} + +- (NSDictionary *)readAttributeUpTimeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGeneralDiagnosticsID) + attributeId:@(MTRClusterGeneralDiagnosticsAttributeUpTimeID) + params:params]; +} + +- (NSDictionary *)readAttributeTotalOperationalHoursWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGeneralDiagnosticsID) + attributeId:@(MTRClusterGeneralDiagnosticsAttributeTotalOperationalHoursID) + params:params]; +} + +- (NSDictionary *)readAttributeBootReasonsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGeneralDiagnosticsID) + attributeId:@(MTRClusterGeneralDiagnosticsAttributeBootReasonsID) + params:params]; +} + +- (NSDictionary *)readAttributeActiveHardwareFaultsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGeneralDiagnosticsID) + attributeId:@(MTRClusterGeneralDiagnosticsAttributeActiveHardwareFaultsID) + params:params]; +} + +- (NSDictionary *)readAttributeActiveRadioFaultsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGeneralDiagnosticsID) + attributeId:@(MTRClusterGeneralDiagnosticsAttributeActiveRadioFaultsID) + params:params]; +} + +- (NSDictionary *)readAttributeActiveNetworkFaultsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGeneralDiagnosticsID) + attributeId:@(MTRClusterGeneralDiagnosticsAttributeActiveNetworkFaultsID) + params:params]; +} + +- (NSDictionary *)readAttributeTestEventTriggersEnabledWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGeneralDiagnosticsID) + attributeId:@(MTRClusterGeneralDiagnosticsAttributeTestEventTriggersEnabledID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGeneralDiagnosticsID) + attributeId:@(MTRClusterGeneralDiagnosticsAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGeneralDiagnosticsID) + attributeId:@(MTRClusterGeneralDiagnosticsAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGeneralDiagnosticsID) + attributeId:@(MTRClusterGeneralDiagnosticsAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGeneralDiagnosticsID) + attributeId:@(MTRClusterGeneralDiagnosticsAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGeneralDiagnosticsID) + attributeId:@(MTRClusterGeneralDiagnosticsAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterSoftwareDiagnostics + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)resetWatermarksWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + [self resetWatermarksWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completionHandler:completionHandler]; +} +- (void)resetWatermarksWithParams:(MTRSoftwareDiagnosticsClusterResetWatermarksParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + SoftwareDiagnostics::Commands::ResetWatermarks::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::SoftwareDiagnosticsCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeThreadMetricsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterSoftwareDiagnosticsID) + attributeId:@(MTRClusterSoftwareDiagnosticsAttributeThreadMetricsID) + params:params]; +} + +- (NSDictionary *)readAttributeCurrentHeapFreeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterSoftwareDiagnosticsID) + attributeId:@(MTRClusterSoftwareDiagnosticsAttributeCurrentHeapFreeID) + params:params]; +} + +- (NSDictionary *)readAttributeCurrentHeapUsedWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterSoftwareDiagnosticsID) + attributeId:@(MTRClusterSoftwareDiagnosticsAttributeCurrentHeapUsedID) + params:params]; +} + +- (NSDictionary *)readAttributeCurrentHeapHighWatermarkWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterSoftwareDiagnosticsID) + attributeId:@(MTRClusterSoftwareDiagnosticsAttributeCurrentHeapHighWatermarkID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterSoftwareDiagnosticsID) + attributeId:@(MTRClusterSoftwareDiagnosticsAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterSoftwareDiagnosticsID) + attributeId:@(MTRClusterSoftwareDiagnosticsAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterSoftwareDiagnosticsID) + attributeId:@(MTRClusterSoftwareDiagnosticsAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterSoftwareDiagnosticsID) + attributeId:@(MTRClusterSoftwareDiagnosticsAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterSoftwareDiagnosticsID) + attributeId:@(MTRClusterSoftwareDiagnosticsAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterThreadNetworkDiagnostics + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)resetCountsWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + [self resetCountsWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completionHandler:completionHandler]; +} +- (void)resetCountsWithParams:(MTRThreadNetworkDiagnosticsClusterResetCountsParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + ThreadNetworkDiagnostics::Commands::ResetCounts::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ThreadNetworkDiagnosticsCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeChannelWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeChannelID) + params:params]; +} + +- (NSDictionary *)readAttributeRoutingRoleWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeRoutingRoleID) + params:params]; +} + +- (NSDictionary *)readAttributeNetworkNameWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeNetworkNameID) + params:params]; +} + +- (NSDictionary *)readAttributePanIdWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributePanIdID) + params:params]; +} + +- (NSDictionary *)readAttributeExtendedPanIdWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeExtendedPanIdID) + params:params]; +} + +- (NSDictionary *)readAttributeMeshLocalPrefixWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeMeshLocalPrefixID) + params:params]; +} + +- (NSDictionary *)readAttributeOverrunCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeOverrunCountID) + params:params]; +} + +- (NSDictionary *)readAttributeNeighborTableListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeNeighborTableListID) + params:params]; +} + +- (NSDictionary *)readAttributeRouteTableListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeRouteTableListID) + params:params]; +} + +- (NSDictionary *)readAttributePartitionIdWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributePartitionIdID) + params:params]; +} + +- (NSDictionary *)readAttributeWeightingWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeWeightingID) + params:params]; +} + +- (NSDictionary *)readAttributeDataVersionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeDataVersionID) + params:params]; +} + +- (NSDictionary *)readAttributeStableDataVersionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeStableDataVersionID) + params:params]; +} + +- (NSDictionary *)readAttributeLeaderRouterIdWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeLeaderRouterIdID) + params:params]; +} + +- (NSDictionary *)readAttributeDetachedRoleCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeDetachedRoleCountID) + params:params]; +} + +- (NSDictionary *)readAttributeChildRoleCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeChildRoleCountID) + params:params]; +} + +- (NSDictionary *)readAttributeRouterRoleCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeRouterRoleCountID) + params:params]; +} + +- (NSDictionary *)readAttributeLeaderRoleCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeLeaderRoleCountID) + params:params]; +} + +- (NSDictionary *)readAttributeAttachAttemptCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeAttachAttemptCountID) + params:params]; +} + +- (NSDictionary *)readAttributePartitionIdChangeCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributePartitionIdChangeCountID) + params:params]; +} + +- (NSDictionary *)readAttributeBetterPartitionAttachAttemptCountWithParams:(MTRReadParams * _Nullable)params +{ + return + [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeBetterPartitionAttachAttemptCountID) + params:params]; +} + +- (NSDictionary *)readAttributeParentChangeCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeParentChangeCountID) + params:params]; +} + +- (NSDictionary *)readAttributeTxTotalCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeTxTotalCountID) + params:params]; +} + +- (NSDictionary *)readAttributeTxUnicastCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeTxUnicastCountID) + params:params]; +} + +- (NSDictionary *)readAttributeTxBroadcastCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeTxBroadcastCountID) + params:params]; +} + +- (NSDictionary *)readAttributeTxAckRequestedCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeTxAckRequestedCountID) + params:params]; +} + +- (NSDictionary *)readAttributeTxAckedCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeTxAckedCountID) + params:params]; +} + +- (NSDictionary *)readAttributeTxNoAckRequestedCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeTxNoAckRequestedCountID) + params:params]; +} + +- (NSDictionary *)readAttributeTxDataCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeTxDataCountID) + params:params]; +} + +- (NSDictionary *)readAttributeTxDataPollCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeTxDataPollCountID) + params:params]; +} + +- (NSDictionary *)readAttributeTxBeaconCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeTxBeaconCountID) + params:params]; +} + +- (NSDictionary *)readAttributeTxBeaconRequestCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeTxBeaconRequestCountID) + params:params]; +} + +- (NSDictionary *)readAttributeTxOtherCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeTxOtherCountID) + params:params]; +} + +- (NSDictionary *)readAttributeTxRetryCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeTxRetryCountID) + params:params]; +} + +- (NSDictionary *)readAttributeTxDirectMaxRetryExpiryCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeTxDirectMaxRetryExpiryCountID) + params:params]; +} + +- (NSDictionary *)readAttributeTxIndirectMaxRetryExpiryCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeTxIndirectMaxRetryExpiryCountID) + params:params]; +} + +- (NSDictionary *)readAttributeTxErrCcaCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeTxErrCcaCountID) + params:params]; +} + +- (NSDictionary *)readAttributeTxErrAbortCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeTxErrAbortCountID) + params:params]; +} + +- (NSDictionary *)readAttributeTxErrBusyChannelCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeTxErrBusyChannelCountID) + params:params]; +} + +- (NSDictionary *)readAttributeRxTotalCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeRxTotalCountID) + params:params]; +} + +- (NSDictionary *)readAttributeRxUnicastCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeRxUnicastCountID) + params:params]; +} + +- (NSDictionary *)readAttributeRxBroadcastCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeRxBroadcastCountID) + params:params]; +} + +- (NSDictionary *)readAttributeRxDataCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeRxDataCountID) + params:params]; +} + +- (NSDictionary *)readAttributeRxDataPollCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeRxDataPollCountID) + params:params]; +} + +- (NSDictionary *)readAttributeRxBeaconCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeRxBeaconCountID) + params:params]; +} + +- (NSDictionary *)readAttributeRxBeaconRequestCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeRxBeaconRequestCountID) + params:params]; +} + +- (NSDictionary *)readAttributeRxOtherCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeRxOtherCountID) + params:params]; +} + +- (NSDictionary *)readAttributeRxAddressFilteredCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeRxAddressFilteredCountID) + params:params]; +} + +- (NSDictionary *)readAttributeRxDestAddrFilteredCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeRxDestAddrFilteredCountID) + params:params]; +} + +- (NSDictionary *)readAttributeRxDuplicatedCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeRxDuplicatedCountID) + params:params]; +} + +- (NSDictionary *)readAttributeRxErrNoFrameCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeRxErrNoFrameCountID) + params:params]; +} + +- (NSDictionary *)readAttributeRxErrUnknownNeighborCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeRxErrUnknownNeighborCountID) + params:params]; +} + +- (NSDictionary *)readAttributeRxErrInvalidSrcAddrCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeRxErrInvalidSrcAddrCountID) + params:params]; +} + +- (NSDictionary *)readAttributeRxErrSecCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeRxErrSecCountID) + params:params]; +} + +- (NSDictionary *)readAttributeRxErrFcsCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeRxErrFcsCountID) + params:params]; +} + +- (NSDictionary *)readAttributeRxErrOtherCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeRxErrOtherCountID) + params:params]; +} + +- (NSDictionary *)readAttributeActiveTimestampWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeActiveTimestampID) + params:params]; +} + +- (NSDictionary *)readAttributePendingTimestampWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributePendingTimestampID) + params:params]; +} + +- (NSDictionary *)readAttributeDelayWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeDelayID) + params:params]; +} + +- (NSDictionary *)readAttributeSecurityPolicyWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeSecurityPolicyID) + params:params]; +} + +- (NSDictionary *)readAttributeChannelMaskWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeChannelMaskID) + params:params]; +} + +- (NSDictionary *)readAttributeOperationalDatasetComponentsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeOperationalDatasetComponentsID) + params:params]; +} + +- (NSDictionary *)readAttributeActiveNetworkFaultsListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeActiveNetworkFaultsListID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThreadNetworkDiagnosticsID) + attributeId:@(MTRClusterThreadNetworkDiagnosticsAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterWiFiNetworkDiagnostics + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)resetCountsWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + [self resetCountsWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completionHandler:completionHandler]; +} +- (void)resetCountsWithParams:(MTRWiFiNetworkDiagnosticsClusterResetCountsParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + WiFiNetworkDiagnostics::Commands::ResetCounts::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::WiFiNetworkDiagnosticsCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeBssidWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWiFiNetworkDiagnosticsID) + attributeId:@(MTRClusterWiFiNetworkDiagnosticsAttributeBssidID) + params:params]; +} + +- (NSDictionary *)readAttributeSecurityTypeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWiFiNetworkDiagnosticsID) + attributeId:@(MTRClusterWiFiNetworkDiagnosticsAttributeSecurityTypeID) + params:params]; +} + +- (NSDictionary *)readAttributeWiFiVersionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWiFiNetworkDiagnosticsID) + attributeId:@(MTRClusterWiFiNetworkDiagnosticsAttributeWiFiVersionID) + params:params]; +} + +- (NSDictionary *)readAttributeChannelNumberWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWiFiNetworkDiagnosticsID) + attributeId:@(MTRClusterWiFiNetworkDiagnosticsAttributeChannelNumberID) + params:params]; +} + +- (NSDictionary *)readAttributeRssiWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWiFiNetworkDiagnosticsID) + attributeId:@(MTRClusterWiFiNetworkDiagnosticsAttributeRssiID) + params:params]; +} + +- (NSDictionary *)readAttributeBeaconLostCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWiFiNetworkDiagnosticsID) + attributeId:@(MTRClusterWiFiNetworkDiagnosticsAttributeBeaconLostCountID) + params:params]; +} + +- (NSDictionary *)readAttributeBeaconRxCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWiFiNetworkDiagnosticsID) + attributeId:@(MTRClusterWiFiNetworkDiagnosticsAttributeBeaconRxCountID) + params:params]; +} + +- (NSDictionary *)readAttributePacketMulticastRxCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWiFiNetworkDiagnosticsID) + attributeId:@(MTRClusterWiFiNetworkDiagnosticsAttributePacketMulticastRxCountID) + params:params]; +} + +- (NSDictionary *)readAttributePacketMulticastTxCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWiFiNetworkDiagnosticsID) + attributeId:@(MTRClusterWiFiNetworkDiagnosticsAttributePacketMulticastTxCountID) + params:params]; +} + +- (NSDictionary *)readAttributePacketUnicastRxCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWiFiNetworkDiagnosticsID) + attributeId:@(MTRClusterWiFiNetworkDiagnosticsAttributePacketUnicastRxCountID) + params:params]; +} + +- (NSDictionary *)readAttributePacketUnicastTxCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWiFiNetworkDiagnosticsID) + attributeId:@(MTRClusterWiFiNetworkDiagnosticsAttributePacketUnicastTxCountID) + params:params]; +} + +- (NSDictionary *)readAttributeCurrentMaxRateWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWiFiNetworkDiagnosticsID) + attributeId:@(MTRClusterWiFiNetworkDiagnosticsAttributeCurrentMaxRateID) + params:params]; +} + +- (NSDictionary *)readAttributeOverrunCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWiFiNetworkDiagnosticsID) + attributeId:@(MTRClusterWiFiNetworkDiagnosticsAttributeOverrunCountID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWiFiNetworkDiagnosticsID) + attributeId:@(MTRClusterWiFiNetworkDiagnosticsAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWiFiNetworkDiagnosticsID) + attributeId:@(MTRClusterWiFiNetworkDiagnosticsAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWiFiNetworkDiagnosticsID) + attributeId:@(MTRClusterWiFiNetworkDiagnosticsAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWiFiNetworkDiagnosticsID) + attributeId:@(MTRClusterWiFiNetworkDiagnosticsAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWiFiNetworkDiagnosticsID) + attributeId:@(MTRClusterWiFiNetworkDiagnosticsAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterEthernetNetworkDiagnostics + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)resetCountsWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + [self resetCountsWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completionHandler:completionHandler]; +} +- (void)resetCountsWithParams:(MTREthernetNetworkDiagnosticsClusterResetCountsParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + EthernetNetworkDiagnostics::Commands::ResetCounts::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::EthernetNetworkDiagnosticsCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributePHYRateWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterEthernetNetworkDiagnosticsID) + attributeId:@(MTRClusterEthernetNetworkDiagnosticsAttributePHYRateID) + params:params]; +} + +- (NSDictionary *)readAttributeFullDuplexWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterEthernetNetworkDiagnosticsID) + attributeId:@(MTRClusterEthernetNetworkDiagnosticsAttributeFullDuplexID) + params:params]; +} + +- (NSDictionary *)readAttributePacketRxCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterEthernetNetworkDiagnosticsID) + attributeId:@(MTRClusterEthernetNetworkDiagnosticsAttributePacketRxCountID) + params:params]; +} + +- (NSDictionary *)readAttributePacketTxCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterEthernetNetworkDiagnosticsID) + attributeId:@(MTRClusterEthernetNetworkDiagnosticsAttributePacketTxCountID) + params:params]; +} + +- (NSDictionary *)readAttributeTxErrCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterEthernetNetworkDiagnosticsID) + attributeId:@(MTRClusterEthernetNetworkDiagnosticsAttributeTxErrCountID) + params:params]; +} + +- (NSDictionary *)readAttributeCollisionCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterEthernetNetworkDiagnosticsID) + attributeId:@(MTRClusterEthernetNetworkDiagnosticsAttributeCollisionCountID) + params:params]; +} + +- (NSDictionary *)readAttributeOverrunCountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterEthernetNetworkDiagnosticsID) + attributeId:@(MTRClusterEthernetNetworkDiagnosticsAttributeOverrunCountID) + params:params]; +} + +- (NSDictionary *)readAttributeCarrierDetectWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterEthernetNetworkDiagnosticsID) + attributeId:@(MTRClusterEthernetNetworkDiagnosticsAttributeCarrierDetectID) + params:params]; +} + +- (NSDictionary *)readAttributeTimeSinceResetWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterEthernetNetworkDiagnosticsID) + attributeId:@(MTRClusterEthernetNetworkDiagnosticsAttributeTimeSinceResetID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterEthernetNetworkDiagnosticsID) + attributeId:@(MTRClusterEthernetNetworkDiagnosticsAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterEthernetNetworkDiagnosticsID) + attributeId:@(MTRClusterEthernetNetworkDiagnosticsAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterEthernetNetworkDiagnosticsID) + attributeId:@(MTRClusterEthernetNetworkDiagnosticsAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterEthernetNetworkDiagnosticsID) + attributeId:@(MTRClusterEthernetNetworkDiagnosticsAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterEthernetNetworkDiagnosticsID) + attributeId:@(MTRClusterEthernetNetworkDiagnosticsAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterBridgedDeviceBasic + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (NSDictionary *)readAttributeVendorNameWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBridgedDeviceBasicID) + attributeId:@(MTRClusterBridgedDeviceBasicAttributeVendorNameID) + params:params]; +} + +- (NSDictionary *)readAttributeVendorIDWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBridgedDeviceBasicID) + attributeId:@(MTRClusterBridgedDeviceBasicAttributeVendorIDID) + params:params]; +} + +- (NSDictionary *)readAttributeProductNameWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBridgedDeviceBasicID) + attributeId:@(MTRClusterBridgedDeviceBasicAttributeProductNameID) + params:params]; +} + +- (NSDictionary *)readAttributeNodeLabelWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBridgedDeviceBasicID) + attributeId:@(MTRClusterBridgedDeviceBasicAttributeNodeLabelID) + params:params]; +} + +- (void)writeAttributeNodeLabelWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNodeLabelWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNodeLabelWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBridgedDeviceBasicID) + attributeId:@(MTRClusterBridgedDeviceBasicAttributeNodeLabelID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeHardwareVersionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBridgedDeviceBasicID) + attributeId:@(MTRClusterBridgedDeviceBasicAttributeHardwareVersionID) + params:params]; +} + +- (NSDictionary *)readAttributeHardwareVersionStringWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBridgedDeviceBasicID) + attributeId:@(MTRClusterBridgedDeviceBasicAttributeHardwareVersionStringID) + params:params]; +} + +- (NSDictionary *)readAttributeSoftwareVersionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBridgedDeviceBasicID) + attributeId:@(MTRClusterBridgedDeviceBasicAttributeSoftwareVersionID) + params:params]; +} + +- (NSDictionary *)readAttributeSoftwareVersionStringWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBridgedDeviceBasicID) + attributeId:@(MTRClusterBridgedDeviceBasicAttributeSoftwareVersionStringID) + params:params]; +} + +- (NSDictionary *)readAttributeManufacturingDateWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBridgedDeviceBasicID) + attributeId:@(MTRClusterBridgedDeviceBasicAttributeManufacturingDateID) + params:params]; +} + +- (NSDictionary *)readAttributePartNumberWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBridgedDeviceBasicID) + attributeId:@(MTRClusterBridgedDeviceBasicAttributePartNumberID) + params:params]; +} + +- (NSDictionary *)readAttributeProductURLWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBridgedDeviceBasicID) + attributeId:@(MTRClusterBridgedDeviceBasicAttributeProductURLID) + params:params]; +} + +- (NSDictionary *)readAttributeProductLabelWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBridgedDeviceBasicID) + attributeId:@(MTRClusterBridgedDeviceBasicAttributeProductLabelID) + params:params]; +} + +- (NSDictionary *)readAttributeSerialNumberWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBridgedDeviceBasicID) + attributeId:@(MTRClusterBridgedDeviceBasicAttributeSerialNumberID) + params:params]; +} + +- (NSDictionary *)readAttributeReachableWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBridgedDeviceBasicID) + attributeId:@(MTRClusterBridgedDeviceBasicAttributeReachableID) + params:params]; +} + +- (NSDictionary *)readAttributeUniqueIDWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBridgedDeviceBasicID) + attributeId:@(MTRClusterBridgedDeviceBasicAttributeUniqueIDID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBridgedDeviceBasicID) + attributeId:@(MTRClusterBridgedDeviceBasicAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBridgedDeviceBasicID) + attributeId:@(MTRClusterBridgedDeviceBasicAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBridgedDeviceBasicID) + attributeId:@(MTRClusterBridgedDeviceBasicAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBridgedDeviceBasicID) + attributeId:@(MTRClusterBridgedDeviceBasicAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBridgedDeviceBasicID) + attributeId:@(MTRClusterBridgedDeviceBasicAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterSwitch + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (NSDictionary *)readAttributeNumberOfPositionsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterSwitchID) + attributeId:@(MTRClusterSwitchAttributeNumberOfPositionsID) + params:params]; +} + +- (NSDictionary *)readAttributeCurrentPositionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterSwitchID) + attributeId:@(MTRClusterSwitchAttributeCurrentPositionID) + params:params]; +} + +- (NSDictionary *)readAttributeMultiPressMaxWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterSwitchID) + attributeId:@(MTRClusterSwitchAttributeMultiPressMaxID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterSwitchID) + attributeId:@(MTRClusterSwitchAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterSwitchID) + attributeId:@(MTRClusterSwitchAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterSwitchID) + attributeId:@(MTRClusterSwitchAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterSwitchID) + attributeId:@(MTRClusterSwitchAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterSwitchID) + attributeId:@(MTRClusterSwitchAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterAdministratorCommissioning + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)openCommissioningWindowWithParams:(MTRAdministratorCommissioningClusterOpenCommissioningWindowParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + AdministratorCommissioning::Commands::OpenCommissioningWindow::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + if (!timedInvokeTimeoutMs.HasValue()) { + timedInvokeTimeoutMs.SetValue(10000); + } + request.commissioningTimeout = params.commissioningTimeout.unsignedShortValue; + request.PAKEVerifier = [self asByteSpan:params.pakeVerifier]; + request.discriminator = params.discriminator.unsignedShortValue; + request.iterations = params.iterations.unsignedIntValue; + request.salt = [self asByteSpan:params.salt]; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::AdministratorCommissioningCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)openBasicCommissioningWindowWithParams:(MTRAdministratorCommissioningClusterOpenBasicCommissioningWindowParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + if (!timedInvokeTimeoutMs.HasValue()) { + timedInvokeTimeoutMs.SetValue(10000); + } + request.commissioningTimeout = params.commissioningTimeout.unsignedShortValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::AdministratorCommissioningCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)revokeCommissioningWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + [self revokeCommissioningWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completionHandler:completionHandler]; +} +- (void)revokeCommissioningWithParams:(MTRAdministratorCommissioningClusterRevokeCommissioningParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + AdministratorCommissioning::Commands::RevokeCommissioning::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + if (!timedInvokeTimeoutMs.HasValue()) { + timedInvokeTimeoutMs.SetValue(10000); + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::AdministratorCommissioningCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeWindowStatusWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterAdministratorCommissioningID) + attributeId:@(MTRClusterAdministratorCommissioningAttributeWindowStatusID) + params:params]; +} + +- (NSDictionary *)readAttributeAdminFabricIndexWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterAdministratorCommissioningID) + attributeId:@(MTRClusterAdministratorCommissioningAttributeAdminFabricIndexID) + params:params]; +} + +- (NSDictionary *)readAttributeAdminVendorIdWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterAdministratorCommissioningID) + attributeId:@(MTRClusterAdministratorCommissioningAttributeAdminVendorIdID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterAdministratorCommissioningID) + attributeId:@(MTRClusterAdministratorCommissioningAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterAdministratorCommissioningID) + attributeId:@(MTRClusterAdministratorCommissioningAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterAdministratorCommissioningID) + attributeId:@(MTRClusterAdministratorCommissioningAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterAdministratorCommissioningID) + attributeId:@(MTRClusterAdministratorCommissioningAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterAdministratorCommissioningID) + attributeId:@(MTRClusterAdministratorCommissioningAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterOperationalCredentials + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)attestationRequestWithParams:(MTROperationalCredentialsClusterAttestationRequestParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTROperationalCredentialsClusterAttestationResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTROperationalCredentialsClusterAttestationResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + OperationalCredentials::Commands::AttestationRequest::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.attestationNonce = [self asByteSpan:params.attestationNonce]; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::OperationalCredentialsCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)certificateChainRequestWithParams:(MTROperationalCredentialsClusterCertificateChainRequestParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTROperationalCredentialsClusterCertificateChainResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTROperationalCredentialsClusterCertificateChainResponseCallbackBridge(self.callbackQueue, baseDevice, + completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + OperationalCredentials::Commands::CertificateChainRequest::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.certificateType = params.certificateType.unsignedCharValue; + + auto successFn + = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::OperationalCredentialsCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)CSRRequestWithParams:(MTROperationalCredentialsClusterCSRRequestParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTROperationalCredentialsClusterCSRResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTROperationalCredentialsClusterCSRResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + OperationalCredentials::Commands::CSRRequest::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.CSRNonce = [self asByteSpan:params.csrNonce]; + if (params.isForUpdateNOC != nil) { + auto & definedValue_0 = request.isForUpdateNOC.Emplace(); + definedValue_0 = params.isForUpdateNOC.boolValue; + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::OperationalCredentialsCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)addNOCWithParams:(MTROperationalCredentialsClusterAddNOCParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTROperationalCredentialsClusterNOCResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTROperationalCredentialsClusterNOCResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + OperationalCredentials::Commands::AddNOC::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.NOCValue = [self asByteSpan:params.nocValue]; + if (params.icacValue != nil) { + auto & definedValue_0 = request.ICACValue.Emplace(); + definedValue_0 = [self asByteSpan:params.icacValue]; + } + request.IPKValue = [self asByteSpan:params.ipkValue]; + request.caseAdminSubject = params.caseAdminSubject.unsignedLongLongValue; + request.adminVendorId = static_cast>( + params.adminVendorId.unsignedShortValue); + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::OperationalCredentialsCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)updateNOCWithParams:(MTROperationalCredentialsClusterUpdateNOCParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTROperationalCredentialsClusterNOCResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTROperationalCredentialsClusterNOCResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + OperationalCredentials::Commands::UpdateNOC::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.NOCValue = [self asByteSpan:params.nocValue]; + if (params.icacValue != nil) { + auto & definedValue_0 = request.ICACValue.Emplace(); + definedValue_0 = [self asByteSpan:params.icacValue]; + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::OperationalCredentialsCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)updateFabricLabelWithParams:(MTROperationalCredentialsClusterUpdateFabricLabelParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTROperationalCredentialsClusterNOCResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTROperationalCredentialsClusterNOCResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + OperationalCredentials::Commands::UpdateFabricLabel::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.label = [self asCharSpan:params.label]; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::OperationalCredentialsCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)removeFabricWithParams:(MTROperationalCredentialsClusterRemoveFabricParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTROperationalCredentialsClusterNOCResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTROperationalCredentialsClusterNOCResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + OperationalCredentials::Commands::RemoveFabric::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.fabricIndex = params.fabricIndex.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::OperationalCredentialsCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)addTrustedRootCertificateWithParams:(MTROperationalCredentialsClusterAddTrustedRootCertificateParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + OperationalCredentials::Commands::AddTrustedRootCertificate::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.rootCertificate = [self asByteSpan:params.rootCertificate]; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::OperationalCredentialsCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeNOCsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOperationalCredentialsID) + attributeId:@(MTRClusterOperationalCredentialsAttributeNOCsID) + params:params]; +} + +- (NSDictionary *)readAttributeFabricsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOperationalCredentialsID) + attributeId:@(MTRClusterOperationalCredentialsAttributeFabricsID) + params:params]; +} + +- (NSDictionary *)readAttributeSupportedFabricsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOperationalCredentialsID) + attributeId:@(MTRClusterOperationalCredentialsAttributeSupportedFabricsID) + params:params]; +} + +- (NSDictionary *)readAttributeCommissionedFabricsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOperationalCredentialsID) + attributeId:@(MTRClusterOperationalCredentialsAttributeCommissionedFabricsID) + params:params]; +} + +- (NSDictionary *)readAttributeTrustedRootCertificatesWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOperationalCredentialsID) + attributeId:@(MTRClusterOperationalCredentialsAttributeTrustedRootCertificatesID) + params:params]; +} + +- (NSDictionary *)readAttributeCurrentFabricIndexWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOperationalCredentialsID) + attributeId:@(MTRClusterOperationalCredentialsAttributeCurrentFabricIndexID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOperationalCredentialsID) + attributeId:@(MTRClusterOperationalCredentialsAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOperationalCredentialsID) + attributeId:@(MTRClusterOperationalCredentialsAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOperationalCredentialsID) + attributeId:@(MTRClusterOperationalCredentialsAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOperationalCredentialsID) + attributeId:@(MTRClusterOperationalCredentialsAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOperationalCredentialsID) + attributeId:@(MTRClusterOperationalCredentialsAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterGroupKeyManagement + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)keySetWriteWithParams:(MTRGroupKeyManagementClusterKeySetWriteParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + GroupKeyManagement::Commands::KeySetWrite::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.groupKeySet.groupKeySetID = params.groupKeySet.groupKeySetID.unsignedShortValue; + request.groupKeySet.groupKeySecurityPolicy + = static_cast>( + params.groupKeySet.groupKeySecurityPolicy.unsignedCharValue); + if (params.groupKeySet.epochKey0 == nil) { + request.groupKeySet.epochKey0.SetNull(); + } else { + auto & nonNullValue_1 = request.groupKeySet.epochKey0.SetNonNull(); + nonNullValue_1 = [self asByteSpan:params.groupKeySet.epochKey0]; + } + if (params.groupKeySet.epochStartTime0 == nil) { + request.groupKeySet.epochStartTime0.SetNull(); + } else { + auto & nonNullValue_1 = request.groupKeySet.epochStartTime0.SetNonNull(); + nonNullValue_1 = params.groupKeySet.epochStartTime0.unsignedLongLongValue; + } + if (params.groupKeySet.epochKey1 == nil) { + request.groupKeySet.epochKey1.SetNull(); + } else { + auto & nonNullValue_1 = request.groupKeySet.epochKey1.SetNonNull(); + nonNullValue_1 = [self asByteSpan:params.groupKeySet.epochKey1]; + } + if (params.groupKeySet.epochStartTime1 == nil) { + request.groupKeySet.epochStartTime1.SetNull(); + } else { + auto & nonNullValue_1 = request.groupKeySet.epochStartTime1.SetNonNull(); + nonNullValue_1 = params.groupKeySet.epochStartTime1.unsignedLongLongValue; + } + if (params.groupKeySet.epochKey2 == nil) { + request.groupKeySet.epochKey2.SetNull(); + } else { + auto & nonNullValue_1 = request.groupKeySet.epochKey2.SetNonNull(); + nonNullValue_1 = [self asByteSpan:params.groupKeySet.epochKey2]; + } + if (params.groupKeySet.epochStartTime2 == nil) { + request.groupKeySet.epochStartTime2.SetNull(); + } else { + auto & nonNullValue_1 = request.groupKeySet.epochStartTime2.SetNonNull(); + nonNullValue_1 = params.groupKeySet.epochStartTime2.unsignedLongLongValue; + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::GroupKeyManagementCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)keySetReadWithParams:(MTRGroupKeyManagementClusterKeySetReadParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRGroupKeyManagementClusterKeySetReadResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRGroupKeyManagementClusterKeySetReadResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + GroupKeyManagement::Commands::KeySetRead::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.groupKeySetID = params.groupKeySetID.unsignedShortValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::GroupKeyManagementCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)keySetRemoveWithParams:(MTRGroupKeyManagementClusterKeySetRemoveParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + GroupKeyManagement::Commands::KeySetRemove::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.groupKeySetID = params.groupKeySetID.unsignedShortValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::GroupKeyManagementCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)keySetReadAllIndicesWithParams:(MTRGroupKeyManagementClusterKeySetReadAllIndicesParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRGroupKeyManagementClusterKeySetReadAllIndicesResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRGroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackBridge(self.callbackQueue, baseDevice, + completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + GroupKeyManagement::Commands::KeySetReadAllIndices::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (params.groupKeySetIDs.count != 0) { + auto * listHolder_0 = new ListHolder(params.groupKeySetIDs.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < params.groupKeySetIDs.count; ++i_0) { + if (![params.groupKeySetIDs[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) params.groupKeySetIDs[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedShortValue; + } + request.groupKeySetIDs = ListType_0(listHolder_0->mList, params.groupKeySetIDs.count); + } else { + request.groupKeySetIDs = ListType_0(); + } + } + + auto successFn + = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::GroupKeyManagementCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeGroupKeyMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGroupKeyManagementID) + attributeId:@(MTRClusterGroupKeyManagementAttributeGroupKeyMapID) + params:params]; +} + +- (void)writeAttributeGroupKeyMapWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeGroupKeyMapWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeGroupKeyMapWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGroupKeyManagementID) + attributeId:@(MTRClusterGroupKeyManagementAttributeGroupKeyMapID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeGroupTableWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGroupKeyManagementID) + attributeId:@(MTRClusterGroupKeyManagementAttributeGroupTableID) + params:params]; +} + +- (NSDictionary *)readAttributeMaxGroupsPerFabricWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGroupKeyManagementID) + attributeId:@(MTRClusterGroupKeyManagementAttributeMaxGroupsPerFabricID) + params:params]; +} + +- (NSDictionary *)readAttributeMaxGroupKeysPerFabricWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGroupKeyManagementID) + attributeId:@(MTRClusterGroupKeyManagementAttributeMaxGroupKeysPerFabricID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGroupKeyManagementID) + attributeId:@(MTRClusterGroupKeyManagementAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGroupKeyManagementID) + attributeId:@(MTRClusterGroupKeyManagementAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGroupKeyManagementID) + attributeId:@(MTRClusterGroupKeyManagementAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGroupKeyManagementID) + attributeId:@(MTRClusterGroupKeyManagementAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterGroupKeyManagementID) + attributeId:@(MTRClusterGroupKeyManagementAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterFixedLabel + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (NSDictionary *)readAttributeLabelListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFixedLabelID) + attributeId:@(MTRClusterFixedLabelAttributeLabelListID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFixedLabelID) + attributeId:@(MTRClusterFixedLabelAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFixedLabelID) + attributeId:@(MTRClusterFixedLabelAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFixedLabelID) + attributeId:@(MTRClusterFixedLabelAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFixedLabelID) + attributeId:@(MTRClusterFixedLabelAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFixedLabelID) + attributeId:@(MTRClusterFixedLabelAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterUserLabel + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (NSDictionary *)readAttributeLabelListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterUserLabelID) + attributeId:@(MTRClusterUserLabelAttributeLabelListID) + params:params]; +} + +- (void)writeAttributeLabelListWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeLabelListWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeLabelListWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterUserLabelID) + attributeId:@(MTRClusterUserLabelAttributeLabelListID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterUserLabelID) + attributeId:@(MTRClusterUserLabelAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterUserLabelID) + attributeId:@(MTRClusterUserLabelAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterUserLabelID) + attributeId:@(MTRClusterUserLabelAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterUserLabelID) + attributeId:@(MTRClusterUserLabelAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterUserLabelID) + attributeId:@(MTRClusterUserLabelAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterBooleanState + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (NSDictionary *)readAttributeStateValueWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBooleanStateID) + attributeId:@(MTRClusterBooleanStateAttributeStateValueID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBooleanStateID) + attributeId:@(MTRClusterBooleanStateAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBooleanStateID) + attributeId:@(MTRClusterBooleanStateAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBooleanStateID) + attributeId:@(MTRClusterBooleanStateAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBooleanStateID) + attributeId:@(MTRClusterBooleanStateAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBooleanStateID) + attributeId:@(MTRClusterBooleanStateAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterModeSelect + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)changeToModeWithParams:(MTRModeSelectClusterChangeToModeParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + ModeSelect::Commands::ChangeToMode::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.newMode = params.newMode.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ModeSelectCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeDescriptionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterModeSelectID) + attributeId:@(MTRClusterModeSelectAttributeDescriptionID) + params:params]; +} + +- (NSDictionary *)readAttributeStandardNamespaceWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterModeSelectID) + attributeId:@(MTRClusterModeSelectAttributeStandardNamespaceID) + params:params]; +} + +- (NSDictionary *)readAttributeSupportedModesWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterModeSelectID) + attributeId:@(MTRClusterModeSelectAttributeSupportedModesID) + params:params]; +} + +- (NSDictionary *)readAttributeCurrentModeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterModeSelectID) + attributeId:@(MTRClusterModeSelectAttributeCurrentModeID) + params:params]; +} + +- (NSDictionary *)readAttributeStartUpModeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterModeSelectID) + attributeId:@(MTRClusterModeSelectAttributeStartUpModeID) + params:params]; +} + +- (void)writeAttributeStartUpModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeStartUpModeWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeStartUpModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterModeSelectID) + attributeId:@(MTRClusterModeSelectAttributeStartUpModeID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeOnModeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterModeSelectID) + attributeId:@(MTRClusterModeSelectAttributeOnModeID) + params:params]; +} + +- (void)writeAttributeOnModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeOnModeWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeOnModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterModeSelectID) + attributeId:@(MTRClusterModeSelectAttributeOnModeID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterModeSelectID) + attributeId:@(MTRClusterModeSelectAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterModeSelectID) + attributeId:@(MTRClusterModeSelectAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterModeSelectID) + attributeId:@(MTRClusterModeSelectAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterModeSelectID) + attributeId:@(MTRClusterModeSelectAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterModeSelectID) + attributeId:@(MTRClusterModeSelectAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterDoorLock + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)lockDoorWithParams:(MTRDoorLockClusterLockDoorParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + DoorLock::Commands::LockDoor::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + if (!timedInvokeTimeoutMs.HasValue()) { + timedInvokeTimeoutMs.SetValue(10000); + } + if (params != nil) { + if (params.pinCode != nil) { + auto & definedValue_0 = request.pinCode.Emplace(); + definedValue_0 = [self asByteSpan:params.pinCode]; + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)unlockDoorWithParams:(MTRDoorLockClusterUnlockDoorParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + DoorLock::Commands::UnlockDoor::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + if (!timedInvokeTimeoutMs.HasValue()) { + timedInvokeTimeoutMs.SetValue(10000); + } + if (params != nil) { + if (params.pinCode != nil) { + auto & definedValue_0 = request.pinCode.Emplace(); + definedValue_0 = [self asByteSpan:params.pinCode]; + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)unlockWithTimeoutWithParams:(MTRDoorLockClusterUnlockWithTimeoutParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + DoorLock::Commands::UnlockWithTimeout::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + if (!timedInvokeTimeoutMs.HasValue()) { + timedInvokeTimeoutMs.SetValue(10000); + } + request.timeout = params.timeout.unsignedShortValue; + if (params.pinCode != nil) { + auto & definedValue_0 = request.pinCode.Emplace(); + definedValue_0 = [self asByteSpan:params.pinCode]; + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)setWeekDayScheduleWithParams:(MTRDoorLockClusterSetWeekDayScheduleParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + DoorLock::Commands::SetWeekDaySchedule::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.weekDayIndex = params.weekDayIndex.unsignedCharValue; + request.userIndex = params.userIndex.unsignedShortValue; + request.daysMask + = static_cast>(params.daysMask.unsignedCharValue); + request.startHour = params.startHour.unsignedCharValue; + request.startMinute = params.startMinute.unsignedCharValue; + request.endHour = params.endHour.unsignedCharValue; + request.endMinute = params.endMinute.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)getWeekDayScheduleWithParams:(MTRDoorLockClusterGetWeekDayScheduleParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRDoorLockClusterGetWeekDayScheduleResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + DoorLock::Commands::GetWeekDaySchedule::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.weekDayIndex = params.weekDayIndex.unsignedCharValue; + request.userIndex = params.userIndex.unsignedShortValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)clearWeekDayScheduleWithParams:(MTRDoorLockClusterClearWeekDayScheduleParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + DoorLock::Commands::ClearWeekDaySchedule::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.weekDayIndex = params.weekDayIndex.unsignedCharValue; + request.userIndex = params.userIndex.unsignedShortValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)setYearDayScheduleWithParams:(MTRDoorLockClusterSetYearDayScheduleParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + DoorLock::Commands::SetYearDaySchedule::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.yearDayIndex = params.yearDayIndex.unsignedCharValue; + request.userIndex = params.userIndex.unsignedShortValue; + request.localStartTime = params.localStartTime.unsignedIntValue; + request.localEndTime = params.localEndTime.unsignedIntValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)getYearDayScheduleWithParams:(MTRDoorLockClusterGetYearDayScheduleParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRDoorLockClusterGetYearDayScheduleResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + DoorLock::Commands::GetYearDaySchedule::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.yearDayIndex = params.yearDayIndex.unsignedCharValue; + request.userIndex = params.userIndex.unsignedShortValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)clearYearDayScheduleWithParams:(MTRDoorLockClusterClearYearDayScheduleParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + DoorLock::Commands::ClearYearDaySchedule::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.yearDayIndex = params.yearDayIndex.unsignedCharValue; + request.userIndex = params.userIndex.unsignedShortValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)setHolidayScheduleWithParams:(MTRDoorLockClusterSetHolidayScheduleParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + DoorLock::Commands::SetHolidaySchedule::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.holidayIndex = params.holidayIndex.unsignedCharValue; + request.localStartTime = params.localStartTime.unsignedIntValue; + request.localEndTime = params.localEndTime.unsignedIntValue; + request.operatingMode + = static_cast>(params.operatingMode.unsignedCharValue); + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)getHolidayScheduleWithParams:(MTRDoorLockClusterGetHolidayScheduleParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRDoorLockClusterGetHolidayScheduleResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + DoorLock::Commands::GetHolidaySchedule::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.holidayIndex = params.holidayIndex.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)clearHolidayScheduleWithParams:(MTRDoorLockClusterClearHolidayScheduleParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + DoorLock::Commands::ClearHolidaySchedule::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.holidayIndex = params.holidayIndex.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)setUserWithParams:(MTRDoorLockClusterSetUserParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + DoorLock::Commands::SetUser::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + if (!timedInvokeTimeoutMs.HasValue()) { + timedInvokeTimeoutMs.SetValue(10000); + } + request.operationType + = static_cast>(params.operationType.unsignedCharValue); + request.userIndex = params.userIndex.unsignedShortValue; + if (params.userName == nil) { + request.userName.SetNull(); + } else { + auto & nonNullValue_0 = request.userName.SetNonNull(); + nonNullValue_0 = [self asCharSpan:params.userName]; + } + if (params.userUniqueId == nil) { + request.userUniqueId.SetNull(); + } else { + auto & nonNullValue_0 = request.userUniqueId.SetNonNull(); + nonNullValue_0 = params.userUniqueId.unsignedIntValue; + } + if (params.userStatus == nil) { + request.userStatus.SetNull(); + } else { + auto & nonNullValue_0 = request.userStatus.SetNonNull(); + nonNullValue_0 + = static_cast>(params.userStatus.unsignedCharValue); + } + if (params.userType == nil) { + request.userType.SetNull(); + } else { + auto & nonNullValue_0 = request.userType.SetNonNull(); + nonNullValue_0 + = static_cast>(params.userType.unsignedCharValue); + } + if (params.credentialRule == nil) { + request.credentialRule.SetNull(); + } else { + auto & nonNullValue_0 = request.credentialRule.SetNonNull(); + nonNullValue_0 + = static_cast>(params.credentialRule.unsignedCharValue); + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)getUserWithParams:(MTRDoorLockClusterGetUserParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRDoorLockClusterGetUserResponseParams * _Nullable data, NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRDoorLockClusterGetUserResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + DoorLock::Commands::GetUser::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.userIndex = params.userIndex.unsignedShortValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)clearUserWithParams:(MTRDoorLockClusterClearUserParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + DoorLock::Commands::ClearUser::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + if (!timedInvokeTimeoutMs.HasValue()) { + timedInvokeTimeoutMs.SetValue(10000); + } + request.userIndex = params.userIndex.unsignedShortValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)setCredentialWithParams:(MTRDoorLockClusterSetCredentialParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRDoorLockClusterSetCredentialResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRDoorLockClusterSetCredentialResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + DoorLock::Commands::SetCredential::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + if (!timedInvokeTimeoutMs.HasValue()) { + timedInvokeTimeoutMs.SetValue(10000); + } + request.operationType + = static_cast>(params.operationType.unsignedCharValue); + request.credential.credentialType + = static_cast>( + params.credential.credentialType.unsignedCharValue); + request.credential.credentialIndex = params.credential.credentialIndex.unsignedShortValue; + request.credentialData = [self asByteSpan:params.credentialData]; + if (params.userIndex == nil) { + request.userIndex.SetNull(); + } else { + auto & nonNullValue_0 = request.userIndex.SetNonNull(); + nonNullValue_0 = params.userIndex.unsignedShortValue; + } + if (params.userStatus == nil) { + request.userStatus.SetNull(); + } else { + auto & nonNullValue_0 = request.userStatus.SetNonNull(); + nonNullValue_0 + = static_cast>(params.userStatus.unsignedCharValue); + } + if (params.userType == nil) { + request.userType.SetNull(); + } else { + auto & nonNullValue_0 = request.userType.SetNonNull(); + nonNullValue_0 + = static_cast>(params.userType.unsignedCharValue); + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)getCredentialStatusWithParams:(MTRDoorLockClusterGetCredentialStatusParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRDoorLockClusterGetCredentialStatusResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRDoorLockClusterGetCredentialStatusResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + DoorLock::Commands::GetCredentialStatus::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.credential.credentialType + = static_cast>( + params.credential.credentialType.unsignedCharValue); + request.credential.credentialIndex = params.credential.credentialIndex.unsignedShortValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)clearCredentialWithParams:(MTRDoorLockClusterClearCredentialParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + DoorLock::Commands::ClearCredential::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + if (!timedInvokeTimeoutMs.HasValue()) { + timedInvokeTimeoutMs.SetValue(10000); + } + if (params.credential == nil) { + request.credential.SetNull(); + } else { + auto & nonNullValue_0 = request.credential.SetNonNull(); + nonNullValue_0.credentialType = static_cast>( + params.credential.credentialType.unsignedCharValue); + nonNullValue_0.credentialIndex = params.credential.credentialIndex.unsignedShortValue; + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeLockStateWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeLockStateID) + params:params]; +} + +- (NSDictionary *)readAttributeLockTypeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeLockTypeID) + params:params]; +} + +- (NSDictionary *)readAttributeActuatorEnabledWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeActuatorEnabledID) + params:params]; +} + +- (NSDictionary *)readAttributeDoorStateWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeDoorStateID) + params:params]; +} + +- (NSDictionary *)readAttributeDoorOpenEventsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeDoorOpenEventsID) + params:params]; +} + +- (void)writeAttributeDoorOpenEventsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeDoorOpenEventsWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeDoorOpenEventsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeDoorOpenEventsID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeDoorClosedEventsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeDoorClosedEventsID) + params:params]; +} + +- (void)writeAttributeDoorClosedEventsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeDoorClosedEventsWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeDoorClosedEventsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeDoorClosedEventsID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeOpenPeriodWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeOpenPeriodID) + params:params]; +} + +- (void)writeAttributeOpenPeriodWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeOpenPeriodWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeOpenPeriodWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeOpenPeriodID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeNumberOfTotalUsersSupportedWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeNumberOfTotalUsersSupportedID) + params:params]; +} + +- (NSDictionary *)readAttributeNumberOfPINUsersSupportedWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeNumberOfPINUsersSupportedID) + params:params]; +} + +- (NSDictionary *)readAttributeNumberOfRFIDUsersSupportedWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeNumberOfRFIDUsersSupportedID) + params:params]; +} + +- (NSDictionary *)readAttributeNumberOfWeekDaySchedulesSupportedPerUserWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeNumberOfWeekDaySchedulesSupportedPerUserID) + params:params]; +} + +- (NSDictionary *)readAttributeNumberOfYearDaySchedulesSupportedPerUserWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeNumberOfYearDaySchedulesSupportedPerUserID) + params:params]; +} + +- (NSDictionary *)readAttributeNumberOfHolidaySchedulesSupportedWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeNumberOfHolidaySchedulesSupportedID) + params:params]; +} + +- (NSDictionary *)readAttributeMaxPINCodeLengthWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeMaxPINCodeLengthID) + params:params]; +} + +- (NSDictionary *)readAttributeMinPINCodeLengthWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeMinPINCodeLengthID) + params:params]; +} + +- (NSDictionary *)readAttributeMaxRFIDCodeLengthWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeMaxRFIDCodeLengthID) + params:params]; +} + +- (NSDictionary *)readAttributeMinRFIDCodeLengthWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeMinRFIDCodeLengthID) + params:params]; +} + +- (NSDictionary *)readAttributeCredentialRulesSupportWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeCredentialRulesSupportID) + params:params]; +} + +- (NSDictionary *)readAttributeNumberOfCredentialsSupportedPerUserWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeNumberOfCredentialsSupportedPerUserID) + params:params]; +} + +- (NSDictionary *)readAttributeLanguageWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeLanguageID) + params:params]; +} + +- (void)writeAttributeLanguageWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeLanguageWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeLanguageWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeLanguageID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeLEDSettingsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeLEDSettingsID) + params:params]; +} + +- (void)writeAttributeLEDSettingsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeLEDSettingsWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeLEDSettingsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeLEDSettingsID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeAutoRelockTimeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeAutoRelockTimeID) + params:params]; +} + +- (void)writeAttributeAutoRelockTimeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeAutoRelockTimeWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeAutoRelockTimeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeAutoRelockTimeID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeSoundVolumeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeSoundVolumeID) + params:params]; +} + +- (void)writeAttributeSoundVolumeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeSoundVolumeWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeSoundVolumeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeSoundVolumeID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeOperatingModeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeOperatingModeID) + params:params]; +} + +- (void)writeAttributeOperatingModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeOperatingModeWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeOperatingModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeOperatingModeID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeSupportedOperatingModesWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeSupportedOperatingModesID) + params:params]; +} + +- (NSDictionary *)readAttributeDefaultConfigurationRegisterWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeDefaultConfigurationRegisterID) + params:params]; +} + +- (NSDictionary *)readAttributeEnableLocalProgrammingWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeEnableLocalProgrammingID) + params:params]; +} + +- (void)writeAttributeEnableLocalProgrammingWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeEnableLocalProgrammingWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeEnableLocalProgrammingWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeEnableLocalProgrammingID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeEnableOneTouchLockingWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeEnableOneTouchLockingID) + params:params]; +} + +- (void)writeAttributeEnableOneTouchLockingWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeEnableOneTouchLockingWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeEnableOneTouchLockingWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeEnableOneTouchLockingID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeEnableInsideStatusLEDWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeEnableInsideStatusLEDID) + params:params]; +} + +- (void)writeAttributeEnableInsideStatusLEDWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeEnableInsideStatusLEDWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeEnableInsideStatusLEDWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeEnableInsideStatusLEDID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeEnablePrivacyModeButtonWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeEnablePrivacyModeButtonID) + params:params]; +} + +- (void)writeAttributeEnablePrivacyModeButtonWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeEnablePrivacyModeButtonWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeEnablePrivacyModeButtonWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeEnablePrivacyModeButtonID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeLocalProgrammingFeaturesWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeLocalProgrammingFeaturesID) + params:params]; +} + +- (void)writeAttributeLocalProgrammingFeaturesWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeLocalProgrammingFeaturesWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeLocalProgrammingFeaturesWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeLocalProgrammingFeaturesID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeWrongCodeEntryLimitWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeWrongCodeEntryLimitID) + params:params]; +} + +- (void)writeAttributeWrongCodeEntryLimitWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeWrongCodeEntryLimitWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeWrongCodeEntryLimitWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeWrongCodeEntryLimitID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeUserCodeTemporaryDisableTimeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeUserCodeTemporaryDisableTimeID) + params:params]; +} + +- (void)writeAttributeUserCodeTemporaryDisableTimeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeUserCodeTemporaryDisableTimeWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeUserCodeTemporaryDisableTimeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeUserCodeTemporaryDisableTimeID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeSendPINOverTheAirWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeSendPINOverTheAirID) + params:params]; +} + +- (void)writeAttributeSendPINOverTheAirWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeSendPINOverTheAirWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeSendPINOverTheAirWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeSendPINOverTheAirID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeRequirePINforRemoteOperationWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeRequirePINforRemoteOperationID) + params:params]; +} + +- (void)writeAttributeRequirePINforRemoteOperationWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeRequirePINforRemoteOperationWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeRequirePINforRemoteOperationWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeRequirePINforRemoteOperationID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeExpiringUserTimeoutWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeExpiringUserTimeoutID) + params:params]; +} + +- (void)writeAttributeExpiringUserTimeoutWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeExpiringUserTimeoutWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeExpiringUserTimeoutWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeExpiringUserTimeoutID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterDoorLockID) + attributeId:@(MTRClusterDoorLockAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterWindowCovering + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)upOrOpenWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + [self upOrOpenWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completionHandler:completionHandler]; +} +- (void)upOrOpenWithParams:(MTRWindowCoveringClusterUpOrOpenParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + WindowCovering::Commands::UpOrOpen::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::WindowCoveringCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)downOrCloseWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + [self downOrCloseWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completionHandler:completionHandler]; +} +- (void)downOrCloseWithParams:(MTRWindowCoveringClusterDownOrCloseParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + WindowCovering::Commands::DownOrClose::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::WindowCoveringCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)stopMotionWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + [self stopMotionWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completionHandler:completionHandler]; +} +- (void)stopMotionWithParams:(MTRWindowCoveringClusterStopMotionParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + WindowCovering::Commands::StopMotion::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::WindowCoveringCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)goToLiftValueWithParams:(MTRWindowCoveringClusterGoToLiftValueParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + WindowCovering::Commands::GoToLiftValue::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.liftValue = params.liftValue.unsignedShortValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::WindowCoveringCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)goToLiftPercentageWithParams:(MTRWindowCoveringClusterGoToLiftPercentageParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + WindowCovering::Commands::GoToLiftPercentage::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.liftPercent100thsValue = params.liftPercent100thsValue.unsignedShortValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::WindowCoveringCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)goToTiltValueWithParams:(MTRWindowCoveringClusterGoToTiltValueParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + WindowCovering::Commands::GoToTiltValue::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.tiltValue = params.tiltValue.unsignedShortValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::WindowCoveringCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)goToTiltPercentageWithParams:(MTRWindowCoveringClusterGoToTiltPercentageParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + WindowCovering::Commands::GoToTiltPercentage::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.tiltPercent100thsValue = params.tiltPercent100thsValue.unsignedShortValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::WindowCoveringCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeTypeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWindowCoveringID) + attributeId:@(MTRClusterWindowCoveringAttributeTypeID) + params:params]; +} + +- (NSDictionary *)readAttributePhysicalClosedLimitLiftWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWindowCoveringID) + attributeId:@(MTRClusterWindowCoveringAttributePhysicalClosedLimitLiftID) + params:params]; +} + +- (NSDictionary *)readAttributePhysicalClosedLimitTiltWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWindowCoveringID) + attributeId:@(MTRClusterWindowCoveringAttributePhysicalClosedLimitTiltID) + params:params]; +} + +- (NSDictionary *)readAttributeCurrentPositionLiftWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWindowCoveringID) + attributeId:@(MTRClusterWindowCoveringAttributeCurrentPositionLiftID) + params:params]; +} + +- (NSDictionary *)readAttributeCurrentPositionTiltWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWindowCoveringID) + attributeId:@(MTRClusterWindowCoveringAttributeCurrentPositionTiltID) + params:params]; +} + +- (NSDictionary *)readAttributeNumberOfActuationsLiftWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWindowCoveringID) + attributeId:@(MTRClusterWindowCoveringAttributeNumberOfActuationsLiftID) + params:params]; +} + +- (NSDictionary *)readAttributeNumberOfActuationsTiltWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWindowCoveringID) + attributeId:@(MTRClusterWindowCoveringAttributeNumberOfActuationsTiltID) + params:params]; +} + +- (NSDictionary *)readAttributeConfigStatusWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWindowCoveringID) + attributeId:@(MTRClusterWindowCoveringAttributeConfigStatusID) + params:params]; +} + +- (NSDictionary *)readAttributeCurrentPositionLiftPercentageWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWindowCoveringID) + attributeId:@(MTRClusterWindowCoveringAttributeCurrentPositionLiftPercentageID) + params:params]; +} + +- (NSDictionary *)readAttributeCurrentPositionTiltPercentageWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWindowCoveringID) + attributeId:@(MTRClusterWindowCoveringAttributeCurrentPositionTiltPercentageID) + params:params]; +} + +- (NSDictionary *)readAttributeOperationalStatusWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWindowCoveringID) + attributeId:@(MTRClusterWindowCoveringAttributeOperationalStatusID) + params:params]; +} + +- (NSDictionary *)readAttributeTargetPositionLiftPercent100thsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWindowCoveringID) + attributeId:@(MTRClusterWindowCoveringAttributeTargetPositionLiftPercent100thsID) + params:params]; +} + +- (NSDictionary *)readAttributeTargetPositionTiltPercent100thsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWindowCoveringID) + attributeId:@(MTRClusterWindowCoveringAttributeTargetPositionTiltPercent100thsID) + params:params]; +} + +- (NSDictionary *)readAttributeEndProductTypeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWindowCoveringID) + attributeId:@(MTRClusterWindowCoveringAttributeEndProductTypeID) + params:params]; +} + +- (NSDictionary *)readAttributeCurrentPositionLiftPercent100thsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWindowCoveringID) + attributeId:@(MTRClusterWindowCoveringAttributeCurrentPositionLiftPercent100thsID) + params:params]; +} + +- (NSDictionary *)readAttributeCurrentPositionTiltPercent100thsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWindowCoveringID) + attributeId:@(MTRClusterWindowCoveringAttributeCurrentPositionTiltPercent100thsID) + params:params]; +} + +- (NSDictionary *)readAttributeInstalledOpenLimitLiftWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWindowCoveringID) + attributeId:@(MTRClusterWindowCoveringAttributeInstalledOpenLimitLiftID) + params:params]; +} + +- (NSDictionary *)readAttributeInstalledClosedLimitLiftWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWindowCoveringID) + attributeId:@(MTRClusterWindowCoveringAttributeInstalledClosedLimitLiftID) + params:params]; +} + +- (NSDictionary *)readAttributeInstalledOpenLimitTiltWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWindowCoveringID) + attributeId:@(MTRClusterWindowCoveringAttributeInstalledOpenLimitTiltID) + params:params]; +} + +- (NSDictionary *)readAttributeInstalledClosedLimitTiltWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWindowCoveringID) + attributeId:@(MTRClusterWindowCoveringAttributeInstalledClosedLimitTiltID) + params:params]; +} + +- (NSDictionary *)readAttributeModeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWindowCoveringID) + attributeId:@(MTRClusterWindowCoveringAttributeModeID) + params:params]; +} + +- (void)writeAttributeModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeModeWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWindowCoveringID) + attributeId:@(MTRClusterWindowCoveringAttributeModeID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeSafetyStatusWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWindowCoveringID) + attributeId:@(MTRClusterWindowCoveringAttributeSafetyStatusID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWindowCoveringID) + attributeId:@(MTRClusterWindowCoveringAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWindowCoveringID) + attributeId:@(MTRClusterWindowCoveringAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWindowCoveringID) + attributeId:@(MTRClusterWindowCoveringAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWindowCoveringID) + attributeId:@(MTRClusterWindowCoveringAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWindowCoveringID) + attributeId:@(MTRClusterWindowCoveringAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterBarrierControl + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)barrierControlGoToPercentWithParams:(MTRBarrierControlClusterBarrierControlGoToPercentParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + BarrierControl::Commands::BarrierControlGoToPercent::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.percentOpen = params.percentOpen.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::BarrierControlCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)barrierControlStopWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + [self barrierControlStopWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completionHandler:completionHandler]; +} +- (void)barrierControlStopWithParams:(MTRBarrierControlClusterBarrierControlStopParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + BarrierControl::Commands::BarrierControlStop::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::BarrierControlCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeBarrierMovingStateWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBarrierControlID) + attributeId:@(MTRClusterBarrierControlAttributeBarrierMovingStateID) + params:params]; +} + +- (NSDictionary *)readAttributeBarrierSafetyStatusWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBarrierControlID) + attributeId:@(MTRClusterBarrierControlAttributeBarrierSafetyStatusID) + params:params]; +} + +- (NSDictionary *)readAttributeBarrierCapabilitiesWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBarrierControlID) + attributeId:@(MTRClusterBarrierControlAttributeBarrierCapabilitiesID) + params:params]; +} + +- (NSDictionary *)readAttributeBarrierOpenEventsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBarrierControlID) + attributeId:@(MTRClusterBarrierControlAttributeBarrierOpenEventsID) + params:params]; +} + +- (void)writeAttributeBarrierOpenEventsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeBarrierOpenEventsWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeBarrierOpenEventsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBarrierControlID) + attributeId:@(MTRClusterBarrierControlAttributeBarrierOpenEventsID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeBarrierCloseEventsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBarrierControlID) + attributeId:@(MTRClusterBarrierControlAttributeBarrierCloseEventsID) + params:params]; +} + +- (void)writeAttributeBarrierCloseEventsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeBarrierCloseEventsWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeBarrierCloseEventsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBarrierControlID) + attributeId:@(MTRClusterBarrierControlAttributeBarrierCloseEventsID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeBarrierCommandOpenEventsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBarrierControlID) + attributeId:@(MTRClusterBarrierControlAttributeBarrierCommandOpenEventsID) + params:params]; +} + +- (void)writeAttributeBarrierCommandOpenEventsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeBarrierCommandOpenEventsWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeBarrierCommandOpenEventsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBarrierControlID) + attributeId:@(MTRClusterBarrierControlAttributeBarrierCommandOpenEventsID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeBarrierCommandCloseEventsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBarrierControlID) + attributeId:@(MTRClusterBarrierControlAttributeBarrierCommandCloseEventsID) + params:params]; +} + +- (void)writeAttributeBarrierCommandCloseEventsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeBarrierCommandCloseEventsWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeBarrierCommandCloseEventsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBarrierControlID) + attributeId:@(MTRClusterBarrierControlAttributeBarrierCommandCloseEventsID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeBarrierOpenPeriodWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBarrierControlID) + attributeId:@(MTRClusterBarrierControlAttributeBarrierOpenPeriodID) + params:params]; +} + +- (void)writeAttributeBarrierOpenPeriodWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeBarrierOpenPeriodWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeBarrierOpenPeriodWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBarrierControlID) + attributeId:@(MTRClusterBarrierControlAttributeBarrierOpenPeriodID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeBarrierClosePeriodWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBarrierControlID) + attributeId:@(MTRClusterBarrierControlAttributeBarrierClosePeriodID) + params:params]; +} + +- (void)writeAttributeBarrierClosePeriodWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeBarrierClosePeriodWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeBarrierClosePeriodWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBarrierControlID) + attributeId:@(MTRClusterBarrierControlAttributeBarrierClosePeriodID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeBarrierPositionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBarrierControlID) + attributeId:@(MTRClusterBarrierControlAttributeBarrierPositionID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBarrierControlID) + attributeId:@(MTRClusterBarrierControlAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBarrierControlID) + attributeId:@(MTRClusterBarrierControlAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBarrierControlID) + attributeId:@(MTRClusterBarrierControlAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBarrierControlID) + attributeId:@(MTRClusterBarrierControlAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBarrierControlID) + attributeId:@(MTRClusterBarrierControlAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterPumpConfigurationAndControl + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (NSDictionary *)readAttributeMaxPressureWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPumpConfigurationAndControlID) + attributeId:@(MTRClusterPumpConfigurationAndControlAttributeMaxPressureID) + params:params]; +} + +- (NSDictionary *)readAttributeMaxSpeedWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPumpConfigurationAndControlID) + attributeId:@(MTRClusterPumpConfigurationAndControlAttributeMaxSpeedID) + params:params]; +} + +- (NSDictionary *)readAttributeMaxFlowWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPumpConfigurationAndControlID) + attributeId:@(MTRClusterPumpConfigurationAndControlAttributeMaxFlowID) + params:params]; +} + +- (NSDictionary *)readAttributeMinConstPressureWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPumpConfigurationAndControlID) + attributeId:@(MTRClusterPumpConfigurationAndControlAttributeMinConstPressureID) + params:params]; +} + +- (NSDictionary *)readAttributeMaxConstPressureWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPumpConfigurationAndControlID) + attributeId:@(MTRClusterPumpConfigurationAndControlAttributeMaxConstPressureID) + params:params]; +} + +- (NSDictionary *)readAttributeMinCompPressureWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPumpConfigurationAndControlID) + attributeId:@(MTRClusterPumpConfigurationAndControlAttributeMinCompPressureID) + params:params]; +} + +- (NSDictionary *)readAttributeMaxCompPressureWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPumpConfigurationAndControlID) + attributeId:@(MTRClusterPumpConfigurationAndControlAttributeMaxCompPressureID) + params:params]; +} + +- (NSDictionary *)readAttributeMinConstSpeedWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPumpConfigurationAndControlID) + attributeId:@(MTRClusterPumpConfigurationAndControlAttributeMinConstSpeedID) + params:params]; +} + +- (NSDictionary *)readAttributeMaxConstSpeedWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPumpConfigurationAndControlID) + attributeId:@(MTRClusterPumpConfigurationAndControlAttributeMaxConstSpeedID) + params:params]; +} + +- (NSDictionary *)readAttributeMinConstFlowWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPumpConfigurationAndControlID) + attributeId:@(MTRClusterPumpConfigurationAndControlAttributeMinConstFlowID) + params:params]; +} + +- (NSDictionary *)readAttributeMaxConstFlowWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPumpConfigurationAndControlID) + attributeId:@(MTRClusterPumpConfigurationAndControlAttributeMaxConstFlowID) + params:params]; +} + +- (NSDictionary *)readAttributeMinConstTempWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPumpConfigurationAndControlID) + attributeId:@(MTRClusterPumpConfigurationAndControlAttributeMinConstTempID) + params:params]; +} + +- (NSDictionary *)readAttributeMaxConstTempWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPumpConfigurationAndControlID) + attributeId:@(MTRClusterPumpConfigurationAndControlAttributeMaxConstTempID) + params:params]; +} + +- (NSDictionary *)readAttributePumpStatusWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPumpConfigurationAndControlID) + attributeId:@(MTRClusterPumpConfigurationAndControlAttributePumpStatusID) + params:params]; +} + +- (NSDictionary *)readAttributeEffectiveOperationModeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPumpConfigurationAndControlID) + attributeId:@(MTRClusterPumpConfigurationAndControlAttributeEffectiveOperationModeID) + params:params]; +} + +- (NSDictionary *)readAttributeEffectiveControlModeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPumpConfigurationAndControlID) + attributeId:@(MTRClusterPumpConfigurationAndControlAttributeEffectiveControlModeID) + params:params]; +} + +- (NSDictionary *)readAttributeCapacityWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPumpConfigurationAndControlID) + attributeId:@(MTRClusterPumpConfigurationAndControlAttributeCapacityID) + params:params]; +} + +- (NSDictionary *)readAttributeSpeedWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPumpConfigurationAndControlID) + attributeId:@(MTRClusterPumpConfigurationAndControlAttributeSpeedID) + params:params]; +} + +- (NSDictionary *)readAttributeLifetimeRunningHoursWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPumpConfigurationAndControlID) + attributeId:@(MTRClusterPumpConfigurationAndControlAttributeLifetimeRunningHoursID) + params:params]; +} + +- (void)writeAttributeLifetimeRunningHoursWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeLifetimeRunningHoursWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeLifetimeRunningHoursWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPumpConfigurationAndControlID) + attributeId:@(MTRClusterPumpConfigurationAndControlAttributeLifetimeRunningHoursID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributePowerWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPumpConfigurationAndControlID) + attributeId:@(MTRClusterPumpConfigurationAndControlAttributePowerID) + params:params]; +} + +- (NSDictionary *)readAttributeLifetimeEnergyConsumedWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPumpConfigurationAndControlID) + attributeId:@(MTRClusterPumpConfigurationAndControlAttributeLifetimeEnergyConsumedID) + params:params]; +} + +- (void)writeAttributeLifetimeEnergyConsumedWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeLifetimeEnergyConsumedWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeLifetimeEnergyConsumedWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPumpConfigurationAndControlID) + attributeId:@(MTRClusterPumpConfigurationAndControlAttributeLifetimeEnergyConsumedID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeOperationModeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPumpConfigurationAndControlID) + attributeId:@(MTRClusterPumpConfigurationAndControlAttributeOperationModeID) + params:params]; +} + +- (void)writeAttributeOperationModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeOperationModeWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeOperationModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPumpConfigurationAndControlID) + attributeId:@(MTRClusterPumpConfigurationAndControlAttributeOperationModeID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeControlModeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPumpConfigurationAndControlID) + attributeId:@(MTRClusterPumpConfigurationAndControlAttributeControlModeID) + params:params]; +} + +- (void)writeAttributeControlModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeControlModeWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeControlModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPumpConfigurationAndControlID) + attributeId:@(MTRClusterPumpConfigurationAndControlAttributeControlModeID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPumpConfigurationAndControlID) + attributeId:@(MTRClusterPumpConfigurationAndControlAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPumpConfigurationAndControlID) + attributeId:@(MTRClusterPumpConfigurationAndControlAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPumpConfigurationAndControlID) + attributeId:@(MTRClusterPumpConfigurationAndControlAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPumpConfigurationAndControlID) + attributeId:@(MTRClusterPumpConfigurationAndControlAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPumpConfigurationAndControlID) + attributeId:@(MTRClusterPumpConfigurationAndControlAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterThermostat + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)setpointRaiseLowerWithParams:(MTRThermostatClusterSetpointRaiseLowerParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + Thermostat::Commands::SetpointRaiseLower::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.mode = static_cast>(params.mode.unsignedCharValue); + request.amount = params.amount.charValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ThermostatCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)setWeeklyScheduleWithParams:(MTRThermostatClusterSetWeeklyScheduleParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + Thermostat::Commands::SetWeeklySchedule::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.numberOfTransitionsForSequence = params.numberOfTransitionsForSequence.unsignedCharValue; + request.dayOfWeekForSequence = static_cast>( + params.dayOfWeekForSequence.unsignedCharValue); + request.modeForSequence = static_cast>( + params.modeForSequence.unsignedCharValue); + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (params.transitions.count != 0) { + auto * listHolder_0 = new ListHolder(params.transitions.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < params.transitions.count; ++i_0) { + if (![params.transitions[i_0] isKindOfClass:[MTRThermostatClusterThermostatScheduleTransition class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (MTRThermostatClusterThermostatScheduleTransition *) params.transitions[i_0]; + listHolder_0->mList[i_0].transitionTime = element_0.transitionTime.unsignedShortValue; + if (element_0.heatSetpoint == nil) { + listHolder_0->mList[i_0].heatSetpoint.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].heatSetpoint.SetNonNull(); + nonNullValue_2 = element_0.heatSetpoint.shortValue; + } + if (element_0.coolSetpoint == nil) { + listHolder_0->mList[i_0].coolSetpoint.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].coolSetpoint.SetNonNull(); + nonNullValue_2 = element_0.coolSetpoint.shortValue; + } + } + request.transitions = ListType_0(listHolder_0->mList, params.transitions.count); + } else { + request.transitions = ListType_0(); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ThermostatCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)getWeeklyScheduleWithParams:(MTRThermostatClusterGetWeeklyScheduleParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRThermostatClusterGetWeeklyScheduleResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRThermostatClusterGetWeeklyScheduleResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + Thermostat::Commands::GetWeeklySchedule::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.daysToReturn + = static_cast>(params.daysToReturn.unsignedCharValue); + request.modeToReturn + = static_cast>(params.modeToReturn.unsignedCharValue); + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ThermostatCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)clearWeeklyScheduleWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + [self clearWeeklyScheduleWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completionHandler:completionHandler]; +} +- (void)clearWeeklyScheduleWithParams:(MTRThermostatClusterClearWeeklyScheduleParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + Thermostat::Commands::ClearWeeklySchedule::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ThermostatCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeLocalTemperatureWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeLocalTemperatureID) + params:params]; +} + +- (NSDictionary *)readAttributeOutdoorTemperatureWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeOutdoorTemperatureID) + params:params]; +} + +- (NSDictionary *)readAttributeOccupancyWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeOccupancyID) + params:params]; +} + +- (NSDictionary *)readAttributeAbsMinHeatSetpointLimitWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeAbsMinHeatSetpointLimitID) + params:params]; +} + +- (NSDictionary *)readAttributeAbsMaxHeatSetpointLimitWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeAbsMaxHeatSetpointLimitID) + params:params]; +} + +- (NSDictionary *)readAttributeAbsMinCoolSetpointLimitWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeAbsMinCoolSetpointLimitID) + params:params]; +} + +- (NSDictionary *)readAttributeAbsMaxCoolSetpointLimitWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeAbsMaxCoolSetpointLimitID) + params:params]; +} + +- (NSDictionary *)readAttributePICoolingDemandWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributePICoolingDemandID) + params:params]; +} + +- (NSDictionary *)readAttributePIHeatingDemandWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributePIHeatingDemandID) + params:params]; +} + +- (NSDictionary *)readAttributeHVACSystemTypeConfigurationWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeHVACSystemTypeConfigurationID) + params:params]; +} + +- (void)writeAttributeHVACSystemTypeConfigurationWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeHVACSystemTypeConfigurationWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeHVACSystemTypeConfigurationWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeHVACSystemTypeConfigurationID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeLocalTemperatureCalibrationWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeLocalTemperatureCalibrationID) + params:params]; +} + +- (void)writeAttributeLocalTemperatureCalibrationWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeLocalTemperatureCalibrationWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeLocalTemperatureCalibrationWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeLocalTemperatureCalibrationID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeOccupiedCoolingSetpointWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeOccupiedCoolingSetpointID) + params:params]; +} + +- (void)writeAttributeOccupiedCoolingSetpointWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeOccupiedCoolingSetpointWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeOccupiedCoolingSetpointWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeOccupiedCoolingSetpointID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeOccupiedHeatingSetpointWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeOccupiedHeatingSetpointID) + params:params]; +} + +- (void)writeAttributeOccupiedHeatingSetpointWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeOccupiedHeatingSetpointWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeOccupiedHeatingSetpointWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeOccupiedHeatingSetpointID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeUnoccupiedCoolingSetpointWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeUnoccupiedCoolingSetpointID) + params:params]; +} + +- (void)writeAttributeUnoccupiedCoolingSetpointWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeUnoccupiedCoolingSetpointWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeUnoccupiedCoolingSetpointWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeUnoccupiedCoolingSetpointID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeUnoccupiedHeatingSetpointWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeUnoccupiedHeatingSetpointID) + params:params]; +} + +- (void)writeAttributeUnoccupiedHeatingSetpointWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeUnoccupiedHeatingSetpointWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeUnoccupiedHeatingSetpointWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeUnoccupiedHeatingSetpointID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeMinHeatSetpointLimitWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeMinHeatSetpointLimitID) + params:params]; +} + +- (void)writeAttributeMinHeatSetpointLimitWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeMinHeatSetpointLimitWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeMinHeatSetpointLimitWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeMinHeatSetpointLimitID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeMaxHeatSetpointLimitWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeMaxHeatSetpointLimitID) + params:params]; +} + +- (void)writeAttributeMaxHeatSetpointLimitWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeMaxHeatSetpointLimitWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeMaxHeatSetpointLimitWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeMaxHeatSetpointLimitID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeMinCoolSetpointLimitWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeMinCoolSetpointLimitID) + params:params]; +} + +- (void)writeAttributeMinCoolSetpointLimitWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeMinCoolSetpointLimitWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeMinCoolSetpointLimitWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeMinCoolSetpointLimitID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeMaxCoolSetpointLimitWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeMaxCoolSetpointLimitID) + params:params]; +} + +- (void)writeAttributeMaxCoolSetpointLimitWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeMaxCoolSetpointLimitWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeMaxCoolSetpointLimitWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeMaxCoolSetpointLimitID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeMinSetpointDeadBandWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeMinSetpointDeadBandID) + params:params]; +} + +- (void)writeAttributeMinSetpointDeadBandWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeMinSetpointDeadBandWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeMinSetpointDeadBandWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeMinSetpointDeadBandID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeRemoteSensingWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeRemoteSensingID) + params:params]; +} + +- (void)writeAttributeRemoteSensingWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeRemoteSensingWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeRemoteSensingWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeRemoteSensingID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeControlSequenceOfOperationWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeControlSequenceOfOperationID) + params:params]; +} + +- (void)writeAttributeControlSequenceOfOperationWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeControlSequenceOfOperationWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeControlSequenceOfOperationWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeControlSequenceOfOperationID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeSystemModeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeSystemModeID) + params:params]; +} + +- (void)writeAttributeSystemModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeSystemModeWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeSystemModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeSystemModeID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeThermostatRunningModeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeThermostatRunningModeID) + params:params]; +} + +- (NSDictionary *)readAttributeStartOfWeekWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeStartOfWeekID) + params:params]; +} + +- (NSDictionary *)readAttributeNumberOfWeeklyTransitionsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeNumberOfWeeklyTransitionsID) + params:params]; +} + +- (NSDictionary *)readAttributeNumberOfDailyTransitionsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeNumberOfDailyTransitionsID) + params:params]; +} + +- (NSDictionary *)readAttributeTemperatureSetpointHoldWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeTemperatureSetpointHoldID) + params:params]; +} + +- (void)writeAttributeTemperatureSetpointHoldWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeTemperatureSetpointHoldWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeTemperatureSetpointHoldWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeTemperatureSetpointHoldID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeTemperatureSetpointHoldDurationWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeTemperatureSetpointHoldDurationID) + params:params]; +} + +- (void)writeAttributeTemperatureSetpointHoldDurationWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeTemperatureSetpointHoldDurationWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeTemperatureSetpointHoldDurationWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeTemperatureSetpointHoldDurationID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeThermostatProgrammingOperationModeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeThermostatProgrammingOperationModeID) + params:params]; +} + +- (void)writeAttributeThermostatProgrammingOperationModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeThermostatProgrammingOperationModeWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeThermostatProgrammingOperationModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeThermostatProgrammingOperationModeID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeThermostatRunningStateWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeThermostatRunningStateID) + params:params]; +} + +- (NSDictionary *)readAttributeSetpointChangeSourceWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeSetpointChangeSourceID) + params:params]; +} + +- (NSDictionary *)readAttributeSetpointChangeAmountWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeSetpointChangeAmountID) + params:params]; +} + +- (NSDictionary *)readAttributeSetpointChangeSourceTimestampWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeSetpointChangeSourceTimestampID) + params:params]; +} + +- (NSDictionary *)readAttributeOccupiedSetbackWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeOccupiedSetbackID) + params:params]; +} + +- (void)writeAttributeOccupiedSetbackWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeOccupiedSetbackWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeOccupiedSetbackWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeOccupiedSetbackID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeOccupiedSetbackMinWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeOccupiedSetbackMinID) + params:params]; +} + +- (NSDictionary *)readAttributeOccupiedSetbackMaxWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeOccupiedSetbackMaxID) + params:params]; +} + +- (NSDictionary *)readAttributeUnoccupiedSetbackWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeUnoccupiedSetbackID) + params:params]; +} + +- (void)writeAttributeUnoccupiedSetbackWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeUnoccupiedSetbackWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeUnoccupiedSetbackWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeUnoccupiedSetbackID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeUnoccupiedSetbackMinWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeUnoccupiedSetbackMinID) + params:params]; +} + +- (NSDictionary *)readAttributeUnoccupiedSetbackMaxWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeUnoccupiedSetbackMaxID) + params:params]; +} + +- (NSDictionary *)readAttributeEmergencyHeatDeltaWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeEmergencyHeatDeltaID) + params:params]; +} + +- (void)writeAttributeEmergencyHeatDeltaWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeEmergencyHeatDeltaWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeEmergencyHeatDeltaWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeEmergencyHeatDeltaID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeACTypeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeACTypeID) + params:params]; +} + +- (void)writeAttributeACTypeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeACTypeWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeACTypeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeACTypeID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeACCapacityWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeACCapacityID) + params:params]; +} + +- (void)writeAttributeACCapacityWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeACCapacityWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeACCapacityWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeACCapacityID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeACRefrigerantTypeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeACRefrigerantTypeID) + params:params]; +} + +- (void)writeAttributeACRefrigerantTypeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeACRefrigerantTypeWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeACRefrigerantTypeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeACRefrigerantTypeID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeACCompressorTypeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeACCompressorTypeID) + params:params]; +} + +- (void)writeAttributeACCompressorTypeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeACCompressorTypeWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeACCompressorTypeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeACCompressorTypeID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeACErrorCodeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeACErrorCodeID) + params:params]; +} + +- (void)writeAttributeACErrorCodeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeACErrorCodeWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeACErrorCodeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeACErrorCodeID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeACLouverPositionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeACLouverPositionID) + params:params]; +} + +- (void)writeAttributeACLouverPositionWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeACLouverPositionWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeACLouverPositionWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeACLouverPositionID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeACCoilTemperatureWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeACCoilTemperatureID) + params:params]; +} + +- (NSDictionary *)readAttributeACCapacityformatWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeACCapacityformatID) + params:params]; +} + +- (void)writeAttributeACCapacityformatWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeACCapacityformatWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeACCapacityformatWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeACCapacityformatID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatID) + attributeId:@(MTRClusterThermostatAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterFanControl + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (NSDictionary *)readAttributeFanModeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFanControlID) + attributeId:@(MTRClusterFanControlAttributeFanModeID) + params:params]; +} + +- (void)writeAttributeFanModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeFanModeWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeFanModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFanControlID) + attributeId:@(MTRClusterFanControlAttributeFanModeID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeFanModeSequenceWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFanControlID) + attributeId:@(MTRClusterFanControlAttributeFanModeSequenceID) + params:params]; +} + +- (void)writeAttributeFanModeSequenceWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeFanModeSequenceWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeFanModeSequenceWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFanControlID) + attributeId:@(MTRClusterFanControlAttributeFanModeSequenceID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributePercentSettingWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFanControlID) + attributeId:@(MTRClusterFanControlAttributePercentSettingID) + params:params]; +} + +- (void)writeAttributePercentSettingWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributePercentSettingWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributePercentSettingWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFanControlID) + attributeId:@(MTRClusterFanControlAttributePercentSettingID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributePercentCurrentWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFanControlID) + attributeId:@(MTRClusterFanControlAttributePercentCurrentID) + params:params]; +} + +- (NSDictionary *)readAttributeSpeedMaxWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFanControlID) + attributeId:@(MTRClusterFanControlAttributeSpeedMaxID) + params:params]; +} + +- (NSDictionary *)readAttributeSpeedSettingWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFanControlID) + attributeId:@(MTRClusterFanControlAttributeSpeedSettingID) + params:params]; +} + +- (void)writeAttributeSpeedSettingWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeSpeedSettingWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeSpeedSettingWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFanControlID) + attributeId:@(MTRClusterFanControlAttributeSpeedSettingID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeSpeedCurrentWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFanControlID) + attributeId:@(MTRClusterFanControlAttributeSpeedCurrentID) + params:params]; +} + +- (NSDictionary *)readAttributeRockSupportWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFanControlID) + attributeId:@(MTRClusterFanControlAttributeRockSupportID) + params:params]; +} + +- (NSDictionary *)readAttributeRockSettingWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFanControlID) + attributeId:@(MTRClusterFanControlAttributeRockSettingID) + params:params]; +} + +- (void)writeAttributeRockSettingWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeRockSettingWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeRockSettingWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFanControlID) + attributeId:@(MTRClusterFanControlAttributeRockSettingID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeWindSupportWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFanControlID) + attributeId:@(MTRClusterFanControlAttributeWindSupportID) + params:params]; +} + +- (NSDictionary *)readAttributeWindSettingWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFanControlID) + attributeId:@(MTRClusterFanControlAttributeWindSettingID) + params:params]; +} + +- (void)writeAttributeWindSettingWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeWindSettingWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeWindSettingWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFanControlID) + attributeId:@(MTRClusterFanControlAttributeWindSettingID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFanControlID) + attributeId:@(MTRClusterFanControlAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFanControlID) + attributeId:@(MTRClusterFanControlAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFanControlID) + attributeId:@(MTRClusterFanControlAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFanControlID) + attributeId:@(MTRClusterFanControlAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFanControlID) + attributeId:@(MTRClusterFanControlAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterThermostatUserInterfaceConfiguration + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (NSDictionary *)readAttributeTemperatureDisplayModeWithParams:(MTRReadParams * _Nullable)params +{ + return + [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatUserInterfaceConfigurationID) + attributeId:@(MTRClusterThermostatUserInterfaceConfigurationAttributeTemperatureDisplayModeID) + params:params]; +} + +- (void)writeAttributeTemperatureDisplayModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeTemperatureDisplayModeWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeTemperatureDisplayModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatUserInterfaceConfigurationID) + attributeId:@(MTRClusterThermostatUserInterfaceConfigurationAttributeTemperatureDisplayModeID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeKeypadLockoutWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatUserInterfaceConfigurationID) + attributeId:@(MTRClusterThermostatUserInterfaceConfigurationAttributeKeypadLockoutID) + params:params]; +} + +- (void)writeAttributeKeypadLockoutWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeKeypadLockoutWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeKeypadLockoutWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatUserInterfaceConfigurationID) + attributeId:@(MTRClusterThermostatUserInterfaceConfigurationAttributeKeypadLockoutID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeScheduleProgrammingVisibilityWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device + readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatUserInterfaceConfigurationID) + attributeId:@(MTRClusterThermostatUserInterfaceConfigurationAttributeScheduleProgrammingVisibilityID) + params:params]; +} + +- (void)writeAttributeScheduleProgrammingVisibilityWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeScheduleProgrammingVisibilityWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeScheduleProgrammingVisibilityWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device + writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatUserInterfaceConfigurationID) + attributeId:@(MTRClusterThermostatUserInterfaceConfigurationAttributeScheduleProgrammingVisibilityID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatUserInterfaceConfigurationID) + attributeId:@(MTRClusterThermostatUserInterfaceConfigurationAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatUserInterfaceConfigurationID) + attributeId:@(MTRClusterThermostatUserInterfaceConfigurationAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatUserInterfaceConfigurationID) + attributeId:@(MTRClusterThermostatUserInterfaceConfigurationAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatUserInterfaceConfigurationID) + attributeId:@(MTRClusterThermostatUserInterfaceConfigurationAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterThermostatUserInterfaceConfigurationID) + attributeId:@(MTRClusterThermostatUserInterfaceConfigurationAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterColorControl + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)moveToHueWithParams:(MTRColorControlClusterMoveToHueParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + ColorControl::Commands::MoveToHue::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.hue = params.hue.unsignedCharValue; + request.direction + = static_cast>(params.direction.unsignedCharValue); + request.transitionTime = params.transitionTime.unsignedShortValue; + request.optionsMask = params.optionsMask.unsignedCharValue; + request.optionsOverride = params.optionsOverride.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ColorControlCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)moveHueWithParams:(MTRColorControlClusterMoveHueParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + ColorControl::Commands::MoveHue::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.moveMode + = static_cast>(params.moveMode.unsignedCharValue); + request.rate = params.rate.unsignedCharValue; + request.optionsMask = params.optionsMask.unsignedCharValue; + request.optionsOverride = params.optionsOverride.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ColorControlCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)stepHueWithParams:(MTRColorControlClusterStepHueParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + ColorControl::Commands::StepHue::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.stepMode + = static_cast>(params.stepMode.unsignedCharValue); + request.stepSize = params.stepSize.unsignedCharValue; + request.transitionTime = params.transitionTime.unsignedCharValue; + request.optionsMask = params.optionsMask.unsignedCharValue; + request.optionsOverride = params.optionsOverride.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ColorControlCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)moveToSaturationWithParams:(MTRColorControlClusterMoveToSaturationParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + ColorControl::Commands::MoveToSaturation::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.saturation = params.saturation.unsignedCharValue; + request.transitionTime = params.transitionTime.unsignedShortValue; + request.optionsMask = params.optionsMask.unsignedCharValue; + request.optionsOverride = params.optionsOverride.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ColorControlCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)moveSaturationWithParams:(MTRColorControlClusterMoveSaturationParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + ColorControl::Commands::MoveSaturation::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.moveMode + = static_cast>(params.moveMode.unsignedCharValue); + request.rate = params.rate.unsignedCharValue; + request.optionsMask = params.optionsMask.unsignedCharValue; + request.optionsOverride = params.optionsOverride.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ColorControlCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)stepSaturationWithParams:(MTRColorControlClusterStepSaturationParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + ColorControl::Commands::StepSaturation::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.stepMode + = static_cast>(params.stepMode.unsignedCharValue); + request.stepSize = params.stepSize.unsignedCharValue; + request.transitionTime = params.transitionTime.unsignedCharValue; + request.optionsMask = params.optionsMask.unsignedCharValue; + request.optionsOverride = params.optionsOverride.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ColorControlCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)moveToHueAndSaturationWithParams:(MTRColorControlClusterMoveToHueAndSaturationParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + ColorControl::Commands::MoveToHueAndSaturation::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.hue = params.hue.unsignedCharValue; + request.saturation = params.saturation.unsignedCharValue; + request.transitionTime = params.transitionTime.unsignedShortValue; + request.optionsMask = params.optionsMask.unsignedCharValue; + request.optionsOverride = params.optionsOverride.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ColorControlCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)moveToColorWithParams:(MTRColorControlClusterMoveToColorParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + ColorControl::Commands::MoveToColor::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.colorX = params.colorX.unsignedShortValue; + request.colorY = params.colorY.unsignedShortValue; + request.transitionTime = params.transitionTime.unsignedShortValue; + request.optionsMask = params.optionsMask.unsignedCharValue; + request.optionsOverride = params.optionsOverride.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ColorControlCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)moveColorWithParams:(MTRColorControlClusterMoveColorParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + ColorControl::Commands::MoveColor::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.rateX = params.rateX.shortValue; + request.rateY = params.rateY.shortValue; + request.optionsMask = params.optionsMask.unsignedCharValue; + request.optionsOverride = params.optionsOverride.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ColorControlCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)stepColorWithParams:(MTRColorControlClusterStepColorParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + ColorControl::Commands::StepColor::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.stepX = params.stepX.shortValue; + request.stepY = params.stepY.shortValue; + request.transitionTime = params.transitionTime.unsignedShortValue; + request.optionsMask = params.optionsMask.unsignedCharValue; + request.optionsOverride = params.optionsOverride.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ColorControlCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)moveToColorTemperatureWithParams:(MTRColorControlClusterMoveToColorTemperatureParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + ColorControl::Commands::MoveToColorTemperature::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.colorTemperature = params.colorTemperature.unsignedShortValue; + request.transitionTime = params.transitionTime.unsignedShortValue; + request.optionsMask = params.optionsMask.unsignedCharValue; + request.optionsOverride = params.optionsOverride.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ColorControlCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)enhancedMoveToHueWithParams:(MTRColorControlClusterEnhancedMoveToHueParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + ColorControl::Commands::EnhancedMoveToHue::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.enhancedHue = params.enhancedHue.unsignedShortValue; + request.direction + = static_cast>(params.direction.unsignedCharValue); + request.transitionTime = params.transitionTime.unsignedShortValue; + request.optionsMask = params.optionsMask.unsignedCharValue; + request.optionsOverride = params.optionsOverride.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ColorControlCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)enhancedMoveHueWithParams:(MTRColorControlClusterEnhancedMoveHueParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + ColorControl::Commands::EnhancedMoveHue::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.moveMode + = static_cast>(params.moveMode.unsignedCharValue); + request.rate = params.rate.unsignedShortValue; + request.optionsMask = params.optionsMask.unsignedCharValue; + request.optionsOverride = params.optionsOverride.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ColorControlCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)enhancedStepHueWithParams:(MTRColorControlClusterEnhancedStepHueParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + ColorControl::Commands::EnhancedStepHue::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.stepMode + = static_cast>(params.stepMode.unsignedCharValue); + request.stepSize = params.stepSize.unsignedShortValue; + request.transitionTime = params.transitionTime.unsignedShortValue; + request.optionsMask = params.optionsMask.unsignedCharValue; + request.optionsOverride = params.optionsOverride.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ColorControlCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)enhancedMoveToHueAndSaturationWithParams:(MTRColorControlClusterEnhancedMoveToHueAndSaturationParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + ColorControl::Commands::EnhancedMoveToHueAndSaturation::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.enhancedHue = params.enhancedHue.unsignedShortValue; + request.saturation = params.saturation.unsignedCharValue; + request.transitionTime = params.transitionTime.unsignedShortValue; + request.optionsMask = params.optionsMask.unsignedCharValue; + request.optionsOverride = params.optionsOverride.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ColorControlCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)colorLoopSetWithParams:(MTRColorControlClusterColorLoopSetParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + ColorControl::Commands::ColorLoopSet::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.updateFlags + = static_cast>(params.updateFlags.unsignedCharValue); + request.action = static_cast>(params.action.unsignedCharValue); + request.direction + = static_cast>(params.direction.unsignedCharValue); + request.time = params.time.unsignedShortValue; + request.startHue = params.startHue.unsignedShortValue; + request.optionsMask = params.optionsMask.unsignedCharValue; + request.optionsOverride = params.optionsOverride.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ColorControlCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)stopMoveStepWithParams:(MTRColorControlClusterStopMoveStepParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + ColorControl::Commands::StopMoveStep::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.optionsMask = params.optionsMask.unsignedCharValue; + request.optionsOverride = params.optionsOverride.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ColorControlCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)moveColorTemperatureWithParams:(MTRColorControlClusterMoveColorTemperatureParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + ColorControl::Commands::MoveColorTemperature::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.moveMode + = static_cast>(params.moveMode.unsignedCharValue); + request.rate = params.rate.unsignedShortValue; + request.colorTemperatureMinimumMireds = params.colorTemperatureMinimumMireds.unsignedShortValue; + request.colorTemperatureMaximumMireds = params.colorTemperatureMaximumMireds.unsignedShortValue; + request.optionsMask = params.optionsMask.unsignedCharValue; + request.optionsOverride = params.optionsOverride.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ColorControlCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)stepColorTemperatureWithParams:(MTRColorControlClusterStepColorTemperatureParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + ColorControl::Commands::StepColorTemperature::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.stepMode + = static_cast>(params.stepMode.unsignedCharValue); + request.stepSize = params.stepSize.unsignedShortValue; + request.transitionTime = params.transitionTime.unsignedShortValue; + request.colorTemperatureMinimumMireds = params.colorTemperatureMinimumMireds.unsignedShortValue; + request.colorTemperatureMaximumMireds = params.colorTemperatureMaximumMireds.unsignedShortValue; + request.optionsMask = params.optionsMask.unsignedCharValue; + request.optionsOverride = params.optionsOverride.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ColorControlCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeCurrentHueWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeCurrentHueID) + params:params]; +} + +- (NSDictionary *)readAttributeCurrentSaturationWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeCurrentSaturationID) + params:params]; +} + +- (NSDictionary *)readAttributeRemainingTimeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeRemainingTimeID) + params:params]; +} + +- (NSDictionary *)readAttributeCurrentXWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeCurrentXID) + params:params]; +} + +- (NSDictionary *)readAttributeCurrentYWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeCurrentYID) + params:params]; +} + +- (NSDictionary *)readAttributeDriftCompensationWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeDriftCompensationID) + params:params]; +} + +- (NSDictionary *)readAttributeCompensationTextWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeCompensationTextID) + params:params]; +} + +- (NSDictionary *)readAttributeColorTemperatureWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeColorTemperatureID) + params:params]; +} + +- (NSDictionary *)readAttributeColorModeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeColorModeID) + params:params]; +} + +- (NSDictionary *)readAttributeOptionsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeOptionsID) + params:params]; +} + +- (void)writeAttributeOptionsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeOptionsWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeOptionsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeOptionsID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeNumberOfPrimariesWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeNumberOfPrimariesID) + params:params]; +} + +- (NSDictionary *)readAttributePrimary1XWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributePrimary1XID) + params:params]; +} + +- (NSDictionary *)readAttributePrimary1YWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributePrimary1YID) + params:params]; +} + +- (NSDictionary *)readAttributePrimary1IntensityWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributePrimary1IntensityID) + params:params]; +} + +- (NSDictionary *)readAttributePrimary2XWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributePrimary2XID) + params:params]; +} + +- (NSDictionary *)readAttributePrimary2YWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributePrimary2YID) + params:params]; +} + +- (NSDictionary *)readAttributePrimary2IntensityWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributePrimary2IntensityID) + params:params]; +} + +- (NSDictionary *)readAttributePrimary3XWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributePrimary3XID) + params:params]; +} + +- (NSDictionary *)readAttributePrimary3YWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributePrimary3YID) + params:params]; +} + +- (NSDictionary *)readAttributePrimary3IntensityWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributePrimary3IntensityID) + params:params]; +} + +- (NSDictionary *)readAttributePrimary4XWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributePrimary4XID) + params:params]; +} + +- (NSDictionary *)readAttributePrimary4YWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributePrimary4YID) + params:params]; +} + +- (NSDictionary *)readAttributePrimary4IntensityWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributePrimary4IntensityID) + params:params]; +} + +- (NSDictionary *)readAttributePrimary5XWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributePrimary5XID) + params:params]; +} + +- (NSDictionary *)readAttributePrimary5YWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributePrimary5YID) + params:params]; +} + +- (NSDictionary *)readAttributePrimary5IntensityWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributePrimary5IntensityID) + params:params]; +} + +- (NSDictionary *)readAttributePrimary6XWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributePrimary6XID) + params:params]; +} + +- (NSDictionary *)readAttributePrimary6YWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributePrimary6YID) + params:params]; +} + +- (NSDictionary *)readAttributePrimary6IntensityWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributePrimary6IntensityID) + params:params]; +} + +- (NSDictionary *)readAttributeWhitePointXWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeWhitePointXID) + params:params]; +} + +- (void)writeAttributeWhitePointXWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeWhitePointXWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeWhitePointXWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeWhitePointXID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeWhitePointYWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeWhitePointYID) + params:params]; +} + +- (void)writeAttributeWhitePointYWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeWhitePointYWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeWhitePointYWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeWhitePointYID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeColorPointRXWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeColorPointRXID) + params:params]; +} + +- (void)writeAttributeColorPointRXWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeColorPointRXWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeColorPointRXWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeColorPointRXID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeColorPointRYWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeColorPointRYID) + params:params]; +} + +- (void)writeAttributeColorPointRYWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeColorPointRYWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeColorPointRYWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeColorPointRYID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeColorPointRIntensityWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeColorPointRIntensityID) + params:params]; +} + +- (void)writeAttributeColorPointRIntensityWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeColorPointRIntensityWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeColorPointRIntensityWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeColorPointRIntensityID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeColorPointGXWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeColorPointGXID) + params:params]; +} + +- (void)writeAttributeColorPointGXWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeColorPointGXWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeColorPointGXWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeColorPointGXID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeColorPointGYWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeColorPointGYID) + params:params]; +} + +- (void)writeAttributeColorPointGYWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeColorPointGYWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeColorPointGYWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeColorPointGYID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeColorPointGIntensityWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeColorPointGIntensityID) + params:params]; +} + +- (void)writeAttributeColorPointGIntensityWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeColorPointGIntensityWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeColorPointGIntensityWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeColorPointGIntensityID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeColorPointBXWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeColorPointBXID) + params:params]; +} + +- (void)writeAttributeColorPointBXWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeColorPointBXWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeColorPointBXWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeColorPointBXID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeColorPointBYWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeColorPointBYID) + params:params]; +} + +- (void)writeAttributeColorPointBYWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeColorPointBYWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeColorPointBYWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeColorPointBYID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeColorPointBIntensityWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeColorPointBIntensityID) + params:params]; +} + +- (void)writeAttributeColorPointBIntensityWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeColorPointBIntensityWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeColorPointBIntensityWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeColorPointBIntensityID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeEnhancedCurrentHueWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeEnhancedCurrentHueID) + params:params]; +} + +- (NSDictionary *)readAttributeEnhancedColorModeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeEnhancedColorModeID) + params:params]; +} + +- (NSDictionary *)readAttributeColorLoopActiveWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeColorLoopActiveID) + params:params]; +} + +- (NSDictionary *)readAttributeColorLoopDirectionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeColorLoopDirectionID) + params:params]; +} + +- (NSDictionary *)readAttributeColorLoopTimeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeColorLoopTimeID) + params:params]; +} + +- (NSDictionary *)readAttributeColorLoopStartEnhancedHueWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeColorLoopStartEnhancedHueID) + params:params]; +} + +- (NSDictionary *)readAttributeColorLoopStoredEnhancedHueWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeColorLoopStoredEnhancedHueID) + params:params]; +} + +- (NSDictionary *)readAttributeColorCapabilitiesWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeColorCapabilitiesID) + params:params]; +} + +- (NSDictionary *)readAttributeColorTempPhysicalMinMiredsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeColorTempPhysicalMinMiredsID) + params:params]; +} + +- (NSDictionary *)readAttributeColorTempPhysicalMaxMiredsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeColorTempPhysicalMaxMiredsID) + params:params]; +} + +- (NSDictionary *)readAttributeCoupleColorTempToLevelMinMiredsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeCoupleColorTempToLevelMinMiredsID) + params:params]; +} + +- (NSDictionary *)readAttributeStartUpColorTemperatureMiredsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeStartUpColorTemperatureMiredsID) + params:params]; +} + +- (void)writeAttributeStartUpColorTemperatureMiredsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeStartUpColorTemperatureMiredsWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeStartUpColorTemperatureMiredsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeStartUpColorTemperatureMiredsID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterColorControlID) + attributeId:@(MTRClusterColorControlAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterBallastConfiguration + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (NSDictionary *)readAttributePhysicalMinLevelWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBallastConfigurationID) + attributeId:@(MTRClusterBallastConfigurationAttributePhysicalMinLevelID) + params:params]; +} + +- (NSDictionary *)readAttributePhysicalMaxLevelWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBallastConfigurationID) + attributeId:@(MTRClusterBallastConfigurationAttributePhysicalMaxLevelID) + params:params]; +} + +- (NSDictionary *)readAttributeBallastStatusWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBallastConfigurationID) + attributeId:@(MTRClusterBallastConfigurationAttributeBallastStatusID) + params:params]; +} + +- (NSDictionary *)readAttributeMinLevelWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBallastConfigurationID) + attributeId:@(MTRClusterBallastConfigurationAttributeMinLevelID) + params:params]; +} + +- (void)writeAttributeMinLevelWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeMinLevelWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeMinLevelWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBallastConfigurationID) + attributeId:@(MTRClusterBallastConfigurationAttributeMinLevelID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeMaxLevelWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBallastConfigurationID) + attributeId:@(MTRClusterBallastConfigurationAttributeMaxLevelID) + params:params]; +} + +- (void)writeAttributeMaxLevelWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeMaxLevelWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeMaxLevelWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBallastConfigurationID) + attributeId:@(MTRClusterBallastConfigurationAttributeMaxLevelID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeIntrinsicBalanceFactorWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBallastConfigurationID) + attributeId:@(MTRClusterBallastConfigurationAttributeIntrinsicBalanceFactorID) + params:params]; +} + +- (void)writeAttributeIntrinsicBalanceFactorWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeIntrinsicBalanceFactorWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeIntrinsicBalanceFactorWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBallastConfigurationID) + attributeId:@(MTRClusterBallastConfigurationAttributeIntrinsicBalanceFactorID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeBallastFactorAdjustmentWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBallastConfigurationID) + attributeId:@(MTRClusterBallastConfigurationAttributeBallastFactorAdjustmentID) + params:params]; +} + +- (void)writeAttributeBallastFactorAdjustmentWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeBallastFactorAdjustmentWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeBallastFactorAdjustmentWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBallastConfigurationID) + attributeId:@(MTRClusterBallastConfigurationAttributeBallastFactorAdjustmentID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeLampQuantityWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBallastConfigurationID) + attributeId:@(MTRClusterBallastConfigurationAttributeLampQuantityID) + params:params]; +} + +- (NSDictionary *)readAttributeLampTypeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBallastConfigurationID) + attributeId:@(MTRClusterBallastConfigurationAttributeLampTypeID) + params:params]; +} + +- (void)writeAttributeLampTypeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeLampTypeWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeLampTypeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBallastConfigurationID) + attributeId:@(MTRClusterBallastConfigurationAttributeLampTypeID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeLampManufacturerWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBallastConfigurationID) + attributeId:@(MTRClusterBallastConfigurationAttributeLampManufacturerID) + params:params]; +} + +- (void)writeAttributeLampManufacturerWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeLampManufacturerWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeLampManufacturerWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBallastConfigurationID) + attributeId:@(MTRClusterBallastConfigurationAttributeLampManufacturerID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeLampRatedHoursWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBallastConfigurationID) + attributeId:@(MTRClusterBallastConfigurationAttributeLampRatedHoursID) + params:params]; +} + +- (void)writeAttributeLampRatedHoursWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeLampRatedHoursWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeLampRatedHoursWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBallastConfigurationID) + attributeId:@(MTRClusterBallastConfigurationAttributeLampRatedHoursID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeLampBurnHoursWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBallastConfigurationID) + attributeId:@(MTRClusterBallastConfigurationAttributeLampBurnHoursID) + params:params]; +} + +- (void)writeAttributeLampBurnHoursWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeLampBurnHoursWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeLampBurnHoursWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBallastConfigurationID) + attributeId:@(MTRClusterBallastConfigurationAttributeLampBurnHoursID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeLampAlarmModeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBallastConfigurationID) + attributeId:@(MTRClusterBallastConfigurationAttributeLampAlarmModeID) + params:params]; +} + +- (void)writeAttributeLampAlarmModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeLampAlarmModeWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeLampAlarmModeWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBallastConfigurationID) + attributeId:@(MTRClusterBallastConfigurationAttributeLampAlarmModeID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeLampBurnHoursTripPointWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBallastConfigurationID) + attributeId:@(MTRClusterBallastConfigurationAttributeLampBurnHoursTripPointID) + params:params]; +} + +- (void)writeAttributeLampBurnHoursTripPointWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeLampBurnHoursTripPointWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeLampBurnHoursTripPointWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBallastConfigurationID) + attributeId:@(MTRClusterBallastConfigurationAttributeLampBurnHoursTripPointID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBallastConfigurationID) + attributeId:@(MTRClusterBallastConfigurationAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBallastConfigurationID) + attributeId:@(MTRClusterBallastConfigurationAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBallastConfigurationID) + attributeId:@(MTRClusterBallastConfigurationAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBallastConfigurationID) + attributeId:@(MTRClusterBallastConfigurationAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterBallastConfigurationID) + attributeId:@(MTRClusterBallastConfigurationAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterIlluminanceMeasurement + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (NSDictionary *)readAttributeMeasuredValueWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterIlluminanceMeasurementID) + attributeId:@(MTRClusterIlluminanceMeasurementAttributeMeasuredValueID) + params:params]; +} + +- (NSDictionary *)readAttributeMinMeasuredValueWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterIlluminanceMeasurementID) + attributeId:@(MTRClusterIlluminanceMeasurementAttributeMinMeasuredValueID) + params:params]; +} + +- (NSDictionary *)readAttributeMaxMeasuredValueWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterIlluminanceMeasurementID) + attributeId:@(MTRClusterIlluminanceMeasurementAttributeMaxMeasuredValueID) + params:params]; +} + +- (NSDictionary *)readAttributeToleranceWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterIlluminanceMeasurementID) + attributeId:@(MTRClusterIlluminanceMeasurementAttributeToleranceID) + params:params]; +} + +- (NSDictionary *)readAttributeLightSensorTypeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterIlluminanceMeasurementID) + attributeId:@(MTRClusterIlluminanceMeasurementAttributeLightSensorTypeID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterIlluminanceMeasurementID) + attributeId:@(MTRClusterIlluminanceMeasurementAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterIlluminanceMeasurementID) + attributeId:@(MTRClusterIlluminanceMeasurementAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterIlluminanceMeasurementID) + attributeId:@(MTRClusterIlluminanceMeasurementAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterIlluminanceMeasurementID) + attributeId:@(MTRClusterIlluminanceMeasurementAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterIlluminanceMeasurementID) + attributeId:@(MTRClusterIlluminanceMeasurementAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterTemperatureMeasurement + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (NSDictionary *)readAttributeMeasuredValueWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTemperatureMeasurementID) + attributeId:@(MTRClusterTemperatureMeasurementAttributeMeasuredValueID) + params:params]; +} + +- (NSDictionary *)readAttributeMinMeasuredValueWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTemperatureMeasurementID) + attributeId:@(MTRClusterTemperatureMeasurementAttributeMinMeasuredValueID) + params:params]; +} + +- (NSDictionary *)readAttributeMaxMeasuredValueWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTemperatureMeasurementID) + attributeId:@(MTRClusterTemperatureMeasurementAttributeMaxMeasuredValueID) + params:params]; +} + +- (NSDictionary *)readAttributeToleranceWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTemperatureMeasurementID) + attributeId:@(MTRClusterTemperatureMeasurementAttributeToleranceID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTemperatureMeasurementID) + attributeId:@(MTRClusterTemperatureMeasurementAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTemperatureMeasurementID) + attributeId:@(MTRClusterTemperatureMeasurementAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTemperatureMeasurementID) + attributeId:@(MTRClusterTemperatureMeasurementAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTemperatureMeasurementID) + attributeId:@(MTRClusterTemperatureMeasurementAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTemperatureMeasurementID) + attributeId:@(MTRClusterTemperatureMeasurementAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterPressureMeasurement + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (NSDictionary *)readAttributeMeasuredValueWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPressureMeasurementID) + attributeId:@(MTRClusterPressureMeasurementAttributeMeasuredValueID) + params:params]; +} + +- (NSDictionary *)readAttributeMinMeasuredValueWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPressureMeasurementID) + attributeId:@(MTRClusterPressureMeasurementAttributeMinMeasuredValueID) + params:params]; +} + +- (NSDictionary *)readAttributeMaxMeasuredValueWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPressureMeasurementID) + attributeId:@(MTRClusterPressureMeasurementAttributeMaxMeasuredValueID) + params:params]; +} + +- (NSDictionary *)readAttributeToleranceWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPressureMeasurementID) + attributeId:@(MTRClusterPressureMeasurementAttributeToleranceID) + params:params]; +} + +- (NSDictionary *)readAttributeScaledValueWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPressureMeasurementID) + attributeId:@(MTRClusterPressureMeasurementAttributeScaledValueID) + params:params]; +} + +- (NSDictionary *)readAttributeMinScaledValueWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPressureMeasurementID) + attributeId:@(MTRClusterPressureMeasurementAttributeMinScaledValueID) + params:params]; +} + +- (NSDictionary *)readAttributeMaxScaledValueWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPressureMeasurementID) + attributeId:@(MTRClusterPressureMeasurementAttributeMaxScaledValueID) + params:params]; +} + +- (NSDictionary *)readAttributeScaledToleranceWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPressureMeasurementID) + attributeId:@(MTRClusterPressureMeasurementAttributeScaledToleranceID) + params:params]; +} + +- (NSDictionary *)readAttributeScaleWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPressureMeasurementID) + attributeId:@(MTRClusterPressureMeasurementAttributeScaleID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPressureMeasurementID) + attributeId:@(MTRClusterPressureMeasurementAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPressureMeasurementID) + attributeId:@(MTRClusterPressureMeasurementAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPressureMeasurementID) + attributeId:@(MTRClusterPressureMeasurementAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPressureMeasurementID) + attributeId:@(MTRClusterPressureMeasurementAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterPressureMeasurementID) + attributeId:@(MTRClusterPressureMeasurementAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterFlowMeasurement + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (NSDictionary *)readAttributeMeasuredValueWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFlowMeasurementID) + attributeId:@(MTRClusterFlowMeasurementAttributeMeasuredValueID) + params:params]; +} + +- (NSDictionary *)readAttributeMinMeasuredValueWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFlowMeasurementID) + attributeId:@(MTRClusterFlowMeasurementAttributeMinMeasuredValueID) + params:params]; +} + +- (NSDictionary *)readAttributeMaxMeasuredValueWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFlowMeasurementID) + attributeId:@(MTRClusterFlowMeasurementAttributeMaxMeasuredValueID) + params:params]; +} + +- (NSDictionary *)readAttributeToleranceWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFlowMeasurementID) + attributeId:@(MTRClusterFlowMeasurementAttributeToleranceID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFlowMeasurementID) + attributeId:@(MTRClusterFlowMeasurementAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFlowMeasurementID) + attributeId:@(MTRClusterFlowMeasurementAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFlowMeasurementID) + attributeId:@(MTRClusterFlowMeasurementAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFlowMeasurementID) + attributeId:@(MTRClusterFlowMeasurementAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterFlowMeasurementID) + attributeId:@(MTRClusterFlowMeasurementAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterRelativeHumidityMeasurement + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (NSDictionary *)readAttributeMeasuredValueWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterRelativeHumidityMeasurementID) + attributeId:@(MTRClusterRelativeHumidityMeasurementAttributeMeasuredValueID) + params:params]; +} + +- (NSDictionary *)readAttributeMinMeasuredValueWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterRelativeHumidityMeasurementID) + attributeId:@(MTRClusterRelativeHumidityMeasurementAttributeMinMeasuredValueID) + params:params]; +} + +- (NSDictionary *)readAttributeMaxMeasuredValueWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterRelativeHumidityMeasurementID) + attributeId:@(MTRClusterRelativeHumidityMeasurementAttributeMaxMeasuredValueID) + params:params]; +} + +- (NSDictionary *)readAttributeToleranceWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterRelativeHumidityMeasurementID) + attributeId:@(MTRClusterRelativeHumidityMeasurementAttributeToleranceID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterRelativeHumidityMeasurementID) + attributeId:@(MTRClusterRelativeHumidityMeasurementAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterRelativeHumidityMeasurementID) + attributeId:@(MTRClusterRelativeHumidityMeasurementAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterRelativeHumidityMeasurementID) + attributeId:@(MTRClusterRelativeHumidityMeasurementAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterRelativeHumidityMeasurementID) + attributeId:@(MTRClusterRelativeHumidityMeasurementAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterRelativeHumidityMeasurementID) + attributeId:@(MTRClusterRelativeHumidityMeasurementAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterOccupancySensing + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (NSDictionary *)readAttributeOccupancyWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOccupancySensingID) + attributeId:@(MTRClusterOccupancySensingAttributeOccupancyID) + params:params]; +} + +- (NSDictionary *)readAttributeOccupancySensorTypeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOccupancySensingID) + attributeId:@(MTRClusterOccupancySensingAttributeOccupancySensorTypeID) + params:params]; +} + +- (NSDictionary *)readAttributeOccupancySensorTypeBitmapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOccupancySensingID) + attributeId:@(MTRClusterOccupancySensingAttributeOccupancySensorTypeBitmapID) + params:params]; +} + +- (NSDictionary *)readAttributePirOccupiedToUnoccupiedDelayWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOccupancySensingID) + attributeId:@(MTRClusterOccupancySensingAttributePirOccupiedToUnoccupiedDelayID) + params:params]; +} + +- (void)writeAttributePirOccupiedToUnoccupiedDelayWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributePirOccupiedToUnoccupiedDelayWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributePirOccupiedToUnoccupiedDelayWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOccupancySensingID) + attributeId:@(MTRClusterOccupancySensingAttributePirOccupiedToUnoccupiedDelayID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributePirUnoccupiedToOccupiedDelayWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOccupancySensingID) + attributeId:@(MTRClusterOccupancySensingAttributePirUnoccupiedToOccupiedDelayID) + params:params]; +} + +- (void)writeAttributePirUnoccupiedToOccupiedDelayWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributePirUnoccupiedToOccupiedDelayWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributePirUnoccupiedToOccupiedDelayWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOccupancySensingID) + attributeId:@(MTRClusterOccupancySensingAttributePirUnoccupiedToOccupiedDelayID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributePirUnoccupiedToOccupiedThresholdWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOccupancySensingID) + attributeId:@(MTRClusterOccupancySensingAttributePirUnoccupiedToOccupiedThresholdID) + params:params]; +} + +- (void)writeAttributePirUnoccupiedToOccupiedThresholdWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributePirUnoccupiedToOccupiedThresholdWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributePirUnoccupiedToOccupiedThresholdWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOccupancySensingID) + attributeId:@(MTRClusterOccupancySensingAttributePirUnoccupiedToOccupiedThresholdID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeUltrasonicOccupiedToUnoccupiedDelayWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOccupancySensingID) + attributeId:@(MTRClusterOccupancySensingAttributeUltrasonicOccupiedToUnoccupiedDelayID) + params:params]; +} + +- (void)writeAttributeUltrasonicOccupiedToUnoccupiedDelayWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeUltrasonicOccupiedToUnoccupiedDelayWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeUltrasonicOccupiedToUnoccupiedDelayWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOccupancySensingID) + attributeId:@(MTRClusterOccupancySensingAttributeUltrasonicOccupiedToUnoccupiedDelayID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeUltrasonicUnoccupiedToOccupiedDelayWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOccupancySensingID) + attributeId:@(MTRClusterOccupancySensingAttributeUltrasonicUnoccupiedToOccupiedDelayID) + params:params]; +} + +- (void)writeAttributeUltrasonicUnoccupiedToOccupiedDelayWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeUltrasonicUnoccupiedToOccupiedDelayWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeUltrasonicUnoccupiedToOccupiedDelayWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOccupancySensingID) + attributeId:@(MTRClusterOccupancySensingAttributeUltrasonicUnoccupiedToOccupiedDelayID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeUltrasonicUnoccupiedToOccupiedThresholdWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOccupancySensingID) + attributeId:@(MTRClusterOccupancySensingAttributeUltrasonicUnoccupiedToOccupiedThresholdID) + params:params]; +} + +- (void)writeAttributeUltrasonicUnoccupiedToOccupiedThresholdWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeUltrasonicUnoccupiedToOccupiedThresholdWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeUltrasonicUnoccupiedToOccupiedThresholdWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOccupancySensingID) + attributeId:@(MTRClusterOccupancySensingAttributeUltrasonicUnoccupiedToOccupiedThresholdID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributePhysicalContactOccupiedToUnoccupiedDelayWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOccupancySensingID) + attributeId:@(MTRClusterOccupancySensingAttributePhysicalContactOccupiedToUnoccupiedDelayID) + params:params]; +} + +- (void)writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOccupancySensingID) + attributeId:@(MTRClusterOccupancySensingAttributePhysicalContactOccupiedToUnoccupiedDelayID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributePhysicalContactUnoccupiedToOccupiedDelayWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOccupancySensingID) + attributeId:@(MTRClusterOccupancySensingAttributePhysicalContactUnoccupiedToOccupiedDelayID) + params:params]; +} + +- (void)writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOccupancySensingID) + attributeId:@(MTRClusterOccupancySensingAttributePhysicalContactUnoccupiedToOccupiedDelayID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributePhysicalContactUnoccupiedToOccupiedThresholdWithParams: + (MTRReadParams * _Nullable)params +{ + return [self.device + readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOccupancySensingID) + attributeId:@(MTRClusterOccupancySensingAttributePhysicalContactUnoccupiedToOccupiedThresholdID) + params:params]; +} + +- (void)writeAttributePhysicalContactUnoccupiedToOccupiedThresholdWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributePhysicalContactUnoccupiedToOccupiedThresholdWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributePhysicalContactUnoccupiedToOccupiedThresholdWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOccupancySensingID) + attributeId:@(MTRClusterOccupancySensingAttributePhysicalContactUnoccupiedToOccupiedThresholdID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOccupancySensingID) + attributeId:@(MTRClusterOccupancySensingAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOccupancySensingID) + attributeId:@(MTRClusterOccupancySensingAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOccupancySensingID) + attributeId:@(MTRClusterOccupancySensingAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOccupancySensingID) + attributeId:@(MTRClusterOccupancySensingAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterOccupancySensingID) + attributeId:@(MTRClusterOccupancySensingAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterWakeOnLan + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (NSDictionary *)readAttributeMACAddressWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWakeOnLanID) + attributeId:@(MTRClusterWakeOnLanAttributeMACAddressID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWakeOnLanID) + attributeId:@(MTRClusterWakeOnLanAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWakeOnLanID) + attributeId:@(MTRClusterWakeOnLanAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWakeOnLanID) + attributeId:@(MTRClusterWakeOnLanAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWakeOnLanID) + attributeId:@(MTRClusterWakeOnLanAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterWakeOnLanID) + attributeId:@(MTRClusterWakeOnLanAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterChannel + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)changeChannelWithParams:(MTRChannelClusterChangeChannelParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRChannelClusterChangeChannelResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRChannelClusterChangeChannelResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + Channel::Commands::ChangeChannel::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.match = [self asCharSpan:params.match]; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ChannelCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)changeChannelByNumberWithParams:(MTRChannelClusterChangeChannelByNumberParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + Channel::Commands::ChangeChannelByNumber::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.majorNumber = params.majorNumber.unsignedShortValue; + request.minorNumber = params.minorNumber.unsignedShortValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ChannelCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)skipChannelWithParams:(MTRChannelClusterSkipChannelParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + Channel::Commands::SkipChannel::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.count = params.count.unsignedShortValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ChannelCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeChannelListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterChannelID) + attributeId:@(MTRClusterChannelAttributeChannelListID) + params:params]; +} + +- (NSDictionary *)readAttributeLineupWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterChannelID) + attributeId:@(MTRClusterChannelAttributeLineupID) + params:params]; +} + +- (NSDictionary *)readAttributeCurrentChannelWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterChannelID) + attributeId:@(MTRClusterChannelAttributeCurrentChannelID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterChannelID) + attributeId:@(MTRClusterChannelAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterChannelID) + attributeId:@(MTRClusterChannelAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterChannelID) + attributeId:@(MTRClusterChannelAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterChannelID) + attributeId:@(MTRClusterChannelAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterChannelID) + attributeId:@(MTRClusterChannelAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterTargetNavigator + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)navigateTargetWithParams:(MTRTargetNavigatorClusterNavigateTargetParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRTargetNavigatorClusterNavigateTargetResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRTargetNavigatorClusterNavigateTargetResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + TargetNavigator::Commands::NavigateTarget::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.target = params.target.unsignedCharValue; + if (params.data != nil) { + auto & definedValue_0 = request.data.Emplace(); + definedValue_0 = [self asCharSpan:params.data]; + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::TargetNavigatorCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeTargetListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTargetNavigatorID) + attributeId:@(MTRClusterTargetNavigatorAttributeTargetListID) + params:params]; +} + +- (NSDictionary *)readAttributeCurrentTargetWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTargetNavigatorID) + attributeId:@(MTRClusterTargetNavigatorAttributeCurrentTargetID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTargetNavigatorID) + attributeId:@(MTRClusterTargetNavigatorAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTargetNavigatorID) + attributeId:@(MTRClusterTargetNavigatorAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTargetNavigatorID) + attributeId:@(MTRClusterTargetNavigatorAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTargetNavigatorID) + attributeId:@(MTRClusterTargetNavigatorAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTargetNavigatorID) + attributeId:@(MTRClusterTargetNavigatorAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterMediaPlayback + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)playWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + [self playWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completionHandler:completionHandler]; +} +- (void)playWithParams:(MTRMediaPlaybackClusterPlayParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + MediaPlayback::Commands::Play::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::MediaPlaybackCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)pauseWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + [self pauseWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completionHandler:completionHandler]; +} +- (void)pauseWithParams:(MTRMediaPlaybackClusterPauseParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + MediaPlayback::Commands::Pause::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::MediaPlaybackCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)stopPlaybackWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + [self stopPlaybackWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completionHandler:completionHandler]; +} +- (void)stopPlaybackWithParams:(MTRMediaPlaybackClusterStopPlaybackParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + MediaPlayback::Commands::StopPlayback::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::MediaPlaybackCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)startOverWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + [self startOverWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completionHandler:completionHandler]; +} +- (void)startOverWithParams:(MTRMediaPlaybackClusterStartOverParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + MediaPlayback::Commands::StartOver::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::MediaPlaybackCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)previousWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + [self previousWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completionHandler:completionHandler]; +} +- (void)previousWithParams:(MTRMediaPlaybackClusterPreviousParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + MediaPlayback::Commands::Previous::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::MediaPlaybackCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)nextWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + [self nextWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completionHandler:completionHandler]; +} +- (void)nextWithParams:(MTRMediaPlaybackClusterNextParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + MediaPlayback::Commands::Next::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::MediaPlaybackCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)rewindWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + [self rewindWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completionHandler:completionHandler]; +} +- (void)rewindWithParams:(MTRMediaPlaybackClusterRewindParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + MediaPlayback::Commands::Rewind::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::MediaPlaybackCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)fastForwardWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + [self fastForwardWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completionHandler:completionHandler]; +} +- (void)fastForwardWithParams:(MTRMediaPlaybackClusterFastForwardParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + MediaPlayback::Commands::FastForward::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::MediaPlaybackCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)skipForwardWithParams:(MTRMediaPlaybackClusterSkipForwardParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + MediaPlayback::Commands::SkipForward::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.deltaPositionMilliseconds = params.deltaPositionMilliseconds.unsignedLongLongValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::MediaPlaybackCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)skipBackwardWithParams:(MTRMediaPlaybackClusterSkipBackwardParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + MediaPlayback::Commands::SkipBackward::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.deltaPositionMilliseconds = params.deltaPositionMilliseconds.unsignedLongLongValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::MediaPlaybackCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)seekWithParams:(MTRMediaPlaybackClusterSeekParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + MediaPlayback::Commands::Seek::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.position = params.position.unsignedLongLongValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::MediaPlaybackCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeCurrentStateWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterMediaPlaybackID) + attributeId:@(MTRClusterMediaPlaybackAttributeCurrentStateID) + params:params]; +} + +- (NSDictionary *)readAttributeStartTimeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterMediaPlaybackID) + attributeId:@(MTRClusterMediaPlaybackAttributeStartTimeID) + params:params]; +} + +- (NSDictionary *)readAttributeDurationWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterMediaPlaybackID) + attributeId:@(MTRClusterMediaPlaybackAttributeDurationID) + params:params]; +} + +- (NSDictionary *)readAttributeSampledPositionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterMediaPlaybackID) + attributeId:@(MTRClusterMediaPlaybackAttributeSampledPositionID) + params:params]; +} + +- (NSDictionary *)readAttributePlaybackSpeedWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterMediaPlaybackID) + attributeId:@(MTRClusterMediaPlaybackAttributePlaybackSpeedID) + params:params]; +} + +- (NSDictionary *)readAttributeSeekRangeEndWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterMediaPlaybackID) + attributeId:@(MTRClusterMediaPlaybackAttributeSeekRangeEndID) + params:params]; +} + +- (NSDictionary *)readAttributeSeekRangeStartWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterMediaPlaybackID) + attributeId:@(MTRClusterMediaPlaybackAttributeSeekRangeStartID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterMediaPlaybackID) + attributeId:@(MTRClusterMediaPlaybackAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterMediaPlaybackID) + attributeId:@(MTRClusterMediaPlaybackAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterMediaPlaybackID) + attributeId:@(MTRClusterMediaPlaybackAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterMediaPlaybackID) + attributeId:@(MTRClusterMediaPlaybackAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterMediaPlaybackID) + attributeId:@(MTRClusterMediaPlaybackAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterMediaInput + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)selectInputWithParams:(MTRMediaInputClusterSelectInputParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + MediaInput::Commands::SelectInput::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.index = params.index.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::MediaInputCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)showInputStatusWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + [self showInputStatusWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completionHandler:completionHandler]; +} +- (void)showInputStatusWithParams:(MTRMediaInputClusterShowInputStatusParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + MediaInput::Commands::ShowInputStatus::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::MediaInputCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)hideInputStatusWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + [self hideInputStatusWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completionHandler:completionHandler]; +} +- (void)hideInputStatusWithParams:(MTRMediaInputClusterHideInputStatusParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + MediaInput::Commands::HideInputStatus::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::MediaInputCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)renameInputWithParams:(MTRMediaInputClusterRenameInputParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + MediaInput::Commands::RenameInput::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.index = params.index.unsignedCharValue; + request.name = [self asCharSpan:params.name]; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::MediaInputCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeInputListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterMediaInputID) + attributeId:@(MTRClusterMediaInputAttributeInputListID) + params:params]; +} + +- (NSDictionary *)readAttributeCurrentInputWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterMediaInputID) + attributeId:@(MTRClusterMediaInputAttributeCurrentInputID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterMediaInputID) + attributeId:@(MTRClusterMediaInputAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterMediaInputID) + attributeId:@(MTRClusterMediaInputAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterMediaInputID) + attributeId:@(MTRClusterMediaInputAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterMediaInputID) + attributeId:@(MTRClusterMediaInputAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterMediaInputID) + attributeId:@(MTRClusterMediaInputAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterLowPower + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)sleepWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + [self sleepWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completionHandler:completionHandler]; +} +- (void)sleepWithParams:(MTRLowPowerClusterSleepParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + LowPower::Commands::Sleep::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::LowPowerCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLowPowerID) + attributeId:@(MTRClusterLowPowerAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLowPowerID) + attributeId:@(MTRClusterLowPowerAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLowPowerID) + attributeId:@(MTRClusterLowPowerAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLowPowerID) + attributeId:@(MTRClusterLowPowerAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterLowPowerID) + attributeId:@(MTRClusterLowPowerAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterKeypadInput + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)sendKeyWithParams:(MTRKeypadInputClusterSendKeyParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRKeypadInputClusterSendKeyResponseParams * _Nullable data, NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRKeypadInputClusterSendKeyResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + KeypadInput::Commands::SendKey::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.keyCode = static_cast>(params.keyCode.unsignedCharValue); + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::KeypadInputCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterKeypadInputID) + attributeId:@(MTRClusterKeypadInputAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterKeypadInputID) + attributeId:@(MTRClusterKeypadInputAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterKeypadInputID) + attributeId:@(MTRClusterKeypadInputAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterKeypadInputID) + attributeId:@(MTRClusterKeypadInputAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterKeypadInputID) + attributeId:@(MTRClusterKeypadInputAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterContentLauncher + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)launchContentWithParams:(MTRContentLauncherClusterLaunchContentParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRContentLauncherClusterLaunchResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRContentLauncherClusterLaunchResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + ContentLauncher::Commands::LaunchContent::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + { + using ListType_1 = std::remove_reference_t; + using ListMemberType_1 = ListMemberTypeGetter::Type; + if (params.search.parameterList.count != 0) { + auto * listHolder_1 = new ListHolder(params.search.parameterList.count); + if (listHolder_1 == nullptr || listHolder_1->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_1); + for (size_t i_1 = 0; i_1 < params.search.parameterList.count; ++i_1) { + if (![params.search.parameterList[i_1] isKindOfClass:[MTRContentLauncherClusterParameter class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_1 = (MTRContentLauncherClusterParameter *) params.search.parameterList[i_1]; + listHolder_1->mList[i_1].type + = static_castmList[i_1].type)>>( + element_1.type.unsignedCharValue); + listHolder_1->mList[i_1].value = [self asCharSpan:element_1.value]; + if (element_1.externalIDList != nil) { + auto & definedValue_3 = listHolder_1->mList[i_1].externalIDList.Emplace(); + { + using ListType_4 = std::remove_reference_t; + using ListMemberType_4 = ListMemberTypeGetter::Type; + if (element_1.externalIDList.count != 0) { + auto * listHolder_4 = new ListHolder(element_1.externalIDList.count); + if (listHolder_4 == nullptr || listHolder_4->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_4); + for (size_t i_4 = 0; i_4 < element_1.externalIDList.count; ++i_4) { + if (![element_1.externalIDList[i_4] + isKindOfClass:[MTRContentLauncherClusterAdditionalInfo class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_4 + = (MTRContentLauncherClusterAdditionalInfo *) element_1.externalIDList[i_4]; + listHolder_4->mList[i_4].name = [self asCharSpan:element_4.name]; + listHolder_4->mList[i_4].value = [self asCharSpan:element_4.value]; + } + definedValue_3 = ListType_4(listHolder_4->mList, element_1.externalIDList.count); + } else { + definedValue_3 = ListType_4(); + } + } + } + } + request.search.parameterList = ListType_1(listHolder_1->mList, params.search.parameterList.count); + } else { + request.search.parameterList = ListType_1(); + } + } + request.autoPlay = params.autoPlay.boolValue; + if (params.data != nil) { + auto & definedValue_0 = request.data.Emplace(); + definedValue_0 = [self asCharSpan:params.data]; + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ContentLauncherCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)launchURLWithParams:(MTRContentLauncherClusterLaunchURLParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRContentLauncherClusterLaunchResponseParams * _Nullable data, NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRContentLauncherClusterLaunchResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + ContentLauncher::Commands::LaunchURL::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.contentURL = [self asCharSpan:params.contentURL]; + if (params.displayString != nil) { + auto & definedValue_0 = request.displayString.Emplace(); + definedValue_0 = [self asCharSpan:params.displayString]; + } + if (params.brandingInformation != nil) { + auto & definedValue_0 = request.brandingInformation.Emplace(); + definedValue_0.providerName = [self asCharSpan:params.brandingInformation.providerName]; + if (params.brandingInformation.background != nil) { + auto & definedValue_2 = definedValue_0.background.Emplace(); + if (params.brandingInformation.background.imageUrl != nil) { + auto & definedValue_4 = definedValue_2.imageUrl.Emplace(); + definedValue_4 = [self asCharSpan:params.brandingInformation.background.imageUrl]; + } + if (params.brandingInformation.background.color != nil) { + auto & definedValue_4 = definedValue_2.color.Emplace(); + definedValue_4 = [self asCharSpan:params.brandingInformation.background.color]; + } + if (params.brandingInformation.background.size != nil) { + auto & definedValue_4 = definedValue_2.size.Emplace(); + definedValue_4.width = params.brandingInformation.background.size.width.doubleValue; + definedValue_4.height = params.brandingInformation.background.size.height.doubleValue; + definedValue_4.metric = static_cast>( + params.brandingInformation.background.size.metric.unsignedCharValue); + } + } + if (params.brandingInformation.logo != nil) { + auto & definedValue_2 = definedValue_0.logo.Emplace(); + if (params.brandingInformation.logo.imageUrl != nil) { + auto & definedValue_4 = definedValue_2.imageUrl.Emplace(); + definedValue_4 = [self asCharSpan:params.brandingInformation.logo.imageUrl]; + } + if (params.brandingInformation.logo.color != nil) { + auto & definedValue_4 = definedValue_2.color.Emplace(); + definedValue_4 = [self asCharSpan:params.brandingInformation.logo.color]; + } + if (params.brandingInformation.logo.size != nil) { + auto & definedValue_4 = definedValue_2.size.Emplace(); + definedValue_4.width = params.brandingInformation.logo.size.width.doubleValue; + definedValue_4.height = params.brandingInformation.logo.size.height.doubleValue; + definedValue_4.metric = static_cast>( + params.brandingInformation.logo.size.metric.unsignedCharValue); + } + } + if (params.brandingInformation.progressBar != nil) { + auto & definedValue_2 = definedValue_0.progressBar.Emplace(); + if (params.brandingInformation.progressBar.imageUrl != nil) { + auto & definedValue_4 = definedValue_2.imageUrl.Emplace(); + definedValue_4 = [self asCharSpan:params.brandingInformation.progressBar.imageUrl]; + } + if (params.brandingInformation.progressBar.color != nil) { + auto & definedValue_4 = definedValue_2.color.Emplace(); + definedValue_4 = [self asCharSpan:params.brandingInformation.progressBar.color]; + } + if (params.brandingInformation.progressBar.size != nil) { + auto & definedValue_4 = definedValue_2.size.Emplace(); + definedValue_4.width = params.brandingInformation.progressBar.size.width.doubleValue; + definedValue_4.height = params.brandingInformation.progressBar.size.height.doubleValue; + definedValue_4.metric = static_cast>( + params.brandingInformation.progressBar.size.metric.unsignedCharValue); + } + } + if (params.brandingInformation.splash != nil) { + auto & definedValue_2 = definedValue_0.splash.Emplace(); + if (params.brandingInformation.splash.imageUrl != nil) { + auto & definedValue_4 = definedValue_2.imageUrl.Emplace(); + definedValue_4 = [self asCharSpan:params.brandingInformation.splash.imageUrl]; + } + if (params.brandingInformation.splash.color != nil) { + auto & definedValue_4 = definedValue_2.color.Emplace(); + definedValue_4 = [self asCharSpan:params.brandingInformation.splash.color]; + } + if (params.brandingInformation.splash.size != nil) { + auto & definedValue_4 = definedValue_2.size.Emplace(); + definedValue_4.width = params.brandingInformation.splash.size.width.doubleValue; + definedValue_4.height = params.brandingInformation.splash.size.height.doubleValue; + definedValue_4.metric = static_cast>( + params.brandingInformation.splash.size.metric.unsignedCharValue); + } + } + if (params.brandingInformation.waterMark != nil) { + auto & definedValue_2 = definedValue_0.waterMark.Emplace(); + if (params.brandingInformation.waterMark.imageUrl != nil) { + auto & definedValue_4 = definedValue_2.imageUrl.Emplace(); + definedValue_4 = [self asCharSpan:params.brandingInformation.waterMark.imageUrl]; + } + if (params.brandingInformation.waterMark.color != nil) { + auto & definedValue_4 = definedValue_2.color.Emplace(); + definedValue_4 = [self asCharSpan:params.brandingInformation.waterMark.color]; + } + if (params.brandingInformation.waterMark.size != nil) { + auto & definedValue_4 = definedValue_2.size.Emplace(); + definedValue_4.width = params.brandingInformation.waterMark.size.width.doubleValue; + definedValue_4.height = params.brandingInformation.waterMark.size.height.doubleValue; + definedValue_4.metric = static_cast>( + params.brandingInformation.waterMark.size.metric.unsignedCharValue); + } + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ContentLauncherCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeAcceptHeaderWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterContentLauncherID) + attributeId:@(MTRClusterContentLauncherAttributeAcceptHeaderID) + params:params]; +} + +- (NSDictionary *)readAttributeSupportedStreamingProtocolsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterContentLauncherID) + attributeId:@(MTRClusterContentLauncherAttributeSupportedStreamingProtocolsID) + params:params]; +} + +- (void)writeAttributeSupportedStreamingProtocolsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeSupportedStreamingProtocolsWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeSupportedStreamingProtocolsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterContentLauncherID) + attributeId:@(MTRClusterContentLauncherAttributeSupportedStreamingProtocolsID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterContentLauncherID) + attributeId:@(MTRClusterContentLauncherAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterContentLauncherID) + attributeId:@(MTRClusterContentLauncherAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterContentLauncherID) + attributeId:@(MTRClusterContentLauncherAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterContentLauncherID) + attributeId:@(MTRClusterContentLauncherAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterContentLauncherID) + attributeId:@(MTRClusterContentLauncherAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterAudioOutput + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)selectOutputWithParams:(MTRAudioOutputClusterSelectOutputParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + AudioOutput::Commands::SelectOutput::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.index = params.index.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::AudioOutputCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)renameOutputWithParams:(MTRAudioOutputClusterRenameOutputParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + AudioOutput::Commands::RenameOutput::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.index = params.index.unsignedCharValue; + request.name = [self asCharSpan:params.name]; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::AudioOutputCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeOutputListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterAudioOutputID) + attributeId:@(MTRClusterAudioOutputAttributeOutputListID) + params:params]; +} + +- (NSDictionary *)readAttributeCurrentOutputWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterAudioOutputID) + attributeId:@(MTRClusterAudioOutputAttributeCurrentOutputID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterAudioOutputID) + attributeId:@(MTRClusterAudioOutputAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterAudioOutputID) + attributeId:@(MTRClusterAudioOutputAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterAudioOutputID) + attributeId:@(MTRClusterAudioOutputAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterAudioOutputID) + attributeId:@(MTRClusterAudioOutputAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterAudioOutputID) + attributeId:@(MTRClusterAudioOutputAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterApplicationLauncher + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)launchAppWithParams:(MTRApplicationLauncherClusterLaunchAppParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRApplicationLauncherClusterLauncherResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + ApplicationLauncher::Commands::LaunchApp::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.application.catalogVendorId = params.application.catalogVendorId.unsignedShortValue; + request.application.applicationId = [self asCharSpan:params.application.applicationId]; + if (params.data != nil) { + auto & definedValue_0 = request.data.Emplace(); + definedValue_0 = [self asByteSpan:params.data]; + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ApplicationLauncherCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)stopAppWithParams:(MTRApplicationLauncherClusterStopAppParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRApplicationLauncherClusterLauncherResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + ApplicationLauncher::Commands::StopApp::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.application.catalogVendorId = params.application.catalogVendorId.unsignedShortValue; + request.application.applicationId = [self asCharSpan:params.application.applicationId]; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ApplicationLauncherCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)hideAppWithParams:(MTRApplicationLauncherClusterHideAppParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRApplicationLauncherClusterLauncherResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + ApplicationLauncher::Commands::HideApp::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.application.catalogVendorId = params.application.catalogVendorId.unsignedShortValue; + request.application.applicationId = [self asCharSpan:params.application.applicationId]; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ApplicationLauncherCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeCatalogListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterApplicationLauncherID) + attributeId:@(MTRClusterApplicationLauncherAttributeCatalogListID) + params:params]; +} + +- (NSDictionary *)readAttributeCurrentAppWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterApplicationLauncherID) + attributeId:@(MTRClusterApplicationLauncherAttributeCurrentAppID) + params:params]; +} + +- (void)writeAttributeCurrentAppWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeCurrentAppWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeCurrentAppWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterApplicationLauncherID) + attributeId:@(MTRClusterApplicationLauncherAttributeCurrentAppID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterApplicationLauncherID) + attributeId:@(MTRClusterApplicationLauncherAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterApplicationLauncherID) + attributeId:@(MTRClusterApplicationLauncherAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterApplicationLauncherID) + attributeId:@(MTRClusterApplicationLauncherAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterApplicationLauncherID) + attributeId:@(MTRClusterApplicationLauncherAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterApplicationLauncherID) + attributeId:@(MTRClusterApplicationLauncherAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterApplicationBasic + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (NSDictionary *)readAttributeVendorNameWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterApplicationBasicID) + attributeId:@(MTRClusterApplicationBasicAttributeVendorNameID) + params:params]; +} + +- (NSDictionary *)readAttributeVendorIDWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterApplicationBasicID) + attributeId:@(MTRClusterApplicationBasicAttributeVendorIDID) + params:params]; +} + +- (NSDictionary *)readAttributeApplicationNameWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterApplicationBasicID) + attributeId:@(MTRClusterApplicationBasicAttributeApplicationNameID) + params:params]; +} + +- (NSDictionary *)readAttributeProductIDWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterApplicationBasicID) + attributeId:@(MTRClusterApplicationBasicAttributeProductIDID) + params:params]; +} + +- (NSDictionary *)readAttributeApplicationWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterApplicationBasicID) + attributeId:@(MTRClusterApplicationBasicAttributeApplicationID) + params:params]; +} + +- (NSDictionary *)readAttributeStatusWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterApplicationBasicID) + attributeId:@(MTRClusterApplicationBasicAttributeStatusID) + params:params]; +} + +- (NSDictionary *)readAttributeApplicationVersionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterApplicationBasicID) + attributeId:@(MTRClusterApplicationBasicAttributeApplicationVersionID) + params:params]; +} + +- (NSDictionary *)readAttributeAllowedVendorListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterApplicationBasicID) + attributeId:@(MTRClusterApplicationBasicAttributeAllowedVendorListID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterApplicationBasicID) + attributeId:@(MTRClusterApplicationBasicAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterApplicationBasicID) + attributeId:@(MTRClusterApplicationBasicAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterApplicationBasicID) + attributeId:@(MTRClusterApplicationBasicAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterApplicationBasicID) + attributeId:@(MTRClusterApplicationBasicAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterApplicationBasicID) + attributeId:@(MTRClusterApplicationBasicAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterAccountLogin + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)getSetupPINWithParams:(MTRAccountLoginClusterGetSetupPINParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRAccountLoginClusterGetSetupPINResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRAccountLoginClusterGetSetupPINResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + AccountLogin::Commands::GetSetupPIN::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + if (!timedInvokeTimeoutMs.HasValue()) { + timedInvokeTimeoutMs.SetValue(10000); + } + request.tempAccountIdentifier = [self asCharSpan:params.tempAccountIdentifier]; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::AccountLoginCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)loginWithParams:(MTRAccountLoginClusterLoginParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + AccountLogin::Commands::Login::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + if (!timedInvokeTimeoutMs.HasValue()) { + timedInvokeTimeoutMs.SetValue(10000); + } + request.tempAccountIdentifier = [self asCharSpan:params.tempAccountIdentifier]; + request.setupPIN = [self asCharSpan:params.setupPIN]; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::AccountLoginCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)logoutWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + [self logoutWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completionHandler:completionHandler]; +} +- (void)logoutWithParams:(MTRAccountLoginClusterLogoutParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + AccountLogin::Commands::Logout::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + if (!timedInvokeTimeoutMs.HasValue()) { + timedInvokeTimeoutMs.SetValue(10000); + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::AccountLoginCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterAccountLoginID) + attributeId:@(MTRClusterAccountLoginAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterAccountLoginID) + attributeId:@(MTRClusterAccountLoginAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterAccountLoginID) + attributeId:@(MTRClusterAccountLoginAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterAccountLoginID) + attributeId:@(MTRClusterAccountLoginAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterAccountLoginID) + attributeId:@(MTRClusterAccountLoginAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterElectricalMeasurement + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)getProfileInfoCommandWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + [self getProfileInfoCommandWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completionHandler:completionHandler]; +} +- (void)getProfileInfoCommandWithParams:(MTRElectricalMeasurementClusterGetProfileInfoCommandParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + ElectricalMeasurement::Commands::GetProfileInfoCommand::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ElectricalMeasurementCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)getMeasurementProfileCommandWithParams:(MTRElectricalMeasurementClusterGetMeasurementProfileCommandParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + ElectricalMeasurement::Commands::GetMeasurementProfileCommand::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.attributeId = params.attributeId.unsignedShortValue; + request.startTime = params.startTime.unsignedIntValue; + request.numberOfIntervals = params.numberOfIntervals.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::ElectricalMeasurementCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeMeasurementTypeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeMeasurementTypeID) + params:params]; +} + +- (NSDictionary *)readAttributeDcVoltageWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeDcVoltageID) + params:params]; +} + +- (NSDictionary *)readAttributeDcVoltageMinWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeDcVoltageMinID) + params:params]; +} + +- (NSDictionary *)readAttributeDcVoltageMaxWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeDcVoltageMaxID) + params:params]; +} + +- (NSDictionary *)readAttributeDcCurrentWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeDcCurrentID) + params:params]; +} + +- (NSDictionary *)readAttributeDcCurrentMinWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeDcCurrentMinID) + params:params]; +} + +- (NSDictionary *)readAttributeDcCurrentMaxWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeDcCurrentMaxID) + params:params]; +} + +- (NSDictionary *)readAttributeDcPowerWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeDcPowerID) + params:params]; +} + +- (NSDictionary *)readAttributeDcPowerMinWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeDcPowerMinID) + params:params]; +} + +- (NSDictionary *)readAttributeDcPowerMaxWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeDcPowerMaxID) + params:params]; +} + +- (NSDictionary *)readAttributeDcVoltageMultiplierWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeDcVoltageMultiplierID) + params:params]; +} + +- (NSDictionary *)readAttributeDcVoltageDivisorWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeDcVoltageDivisorID) + params:params]; +} + +- (NSDictionary *)readAttributeDcCurrentMultiplierWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeDcCurrentMultiplierID) + params:params]; +} + +- (NSDictionary *)readAttributeDcCurrentDivisorWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeDcCurrentDivisorID) + params:params]; +} + +- (NSDictionary *)readAttributeDcPowerMultiplierWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeDcPowerMultiplierID) + params:params]; +} + +- (NSDictionary *)readAttributeDcPowerDivisorWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeDcPowerDivisorID) + params:params]; +} + +- (NSDictionary *)readAttributeAcFrequencyWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeAcFrequencyID) + params:params]; +} + +- (NSDictionary *)readAttributeAcFrequencyMinWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeAcFrequencyMinID) + params:params]; +} + +- (NSDictionary *)readAttributeAcFrequencyMaxWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeAcFrequencyMaxID) + params:params]; +} + +- (NSDictionary *)readAttributeNeutralCurrentWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeNeutralCurrentID) + params:params]; +} + +- (NSDictionary *)readAttributeTotalActivePowerWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeTotalActivePowerID) + params:params]; +} + +- (NSDictionary *)readAttributeTotalReactivePowerWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeTotalReactivePowerID) + params:params]; +} + +- (NSDictionary *)readAttributeTotalApparentPowerWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeTotalApparentPowerID) + params:params]; +} + +- (NSDictionary *)readAttributeMeasured1stHarmonicCurrentWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeMeasured1stHarmonicCurrentID) + params:params]; +} + +- (NSDictionary *)readAttributeMeasured3rdHarmonicCurrentWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeMeasured3rdHarmonicCurrentID) + params:params]; +} + +- (NSDictionary *)readAttributeMeasured5thHarmonicCurrentWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeMeasured5thHarmonicCurrentID) + params:params]; +} + +- (NSDictionary *)readAttributeMeasured7thHarmonicCurrentWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeMeasured7thHarmonicCurrentID) + params:params]; +} + +- (NSDictionary *)readAttributeMeasured9thHarmonicCurrentWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeMeasured9thHarmonicCurrentID) + params:params]; +} + +- (NSDictionary *)readAttributeMeasured11thHarmonicCurrentWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeMeasured11thHarmonicCurrentID) + params:params]; +} + +- (NSDictionary *)readAttributeMeasuredPhase1stHarmonicCurrentWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeMeasuredPhase1stHarmonicCurrentID) + params:params]; +} + +- (NSDictionary *)readAttributeMeasuredPhase3rdHarmonicCurrentWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeMeasuredPhase3rdHarmonicCurrentID) + params:params]; +} + +- (NSDictionary *)readAttributeMeasuredPhase5thHarmonicCurrentWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeMeasuredPhase5thHarmonicCurrentID) + params:params]; +} + +- (NSDictionary *)readAttributeMeasuredPhase7thHarmonicCurrentWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeMeasuredPhase7thHarmonicCurrentID) + params:params]; +} + +- (NSDictionary *)readAttributeMeasuredPhase9thHarmonicCurrentWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeMeasuredPhase9thHarmonicCurrentID) + params:params]; +} + +- (NSDictionary *)readAttributeMeasuredPhase11thHarmonicCurrentWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeMeasuredPhase11thHarmonicCurrentID) + params:params]; +} + +- (NSDictionary *)readAttributeAcFrequencyMultiplierWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeAcFrequencyMultiplierID) + params:params]; +} + +- (NSDictionary *)readAttributeAcFrequencyDivisorWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeAcFrequencyDivisorID) + params:params]; +} + +- (NSDictionary *)readAttributePowerMultiplierWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributePowerMultiplierID) + params:params]; +} + +- (NSDictionary *)readAttributePowerDivisorWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributePowerDivisorID) + params:params]; +} + +- (NSDictionary *)readAttributeHarmonicCurrentMultiplierWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeHarmonicCurrentMultiplierID) + params:params]; +} + +- (NSDictionary *)readAttributePhaseHarmonicCurrentMultiplierWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributePhaseHarmonicCurrentMultiplierID) + params:params]; +} + +- (NSDictionary *)readAttributeInstantaneousVoltageWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeInstantaneousVoltageID) + params:params]; +} + +- (NSDictionary *)readAttributeInstantaneousLineCurrentWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeInstantaneousLineCurrentID) + params:params]; +} + +- (NSDictionary *)readAttributeInstantaneousActiveCurrentWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeInstantaneousActiveCurrentID) + params:params]; +} + +- (NSDictionary *)readAttributeInstantaneousReactiveCurrentWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeInstantaneousReactiveCurrentID) + params:params]; +} + +- (NSDictionary *)readAttributeInstantaneousPowerWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeInstantaneousPowerID) + params:params]; +} + +- (NSDictionary *)readAttributeRmsVoltageWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsVoltageID) + params:params]; +} + +- (NSDictionary *)readAttributeRmsVoltageMinWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsVoltageMinID) + params:params]; +} + +- (NSDictionary *)readAttributeRmsVoltageMaxWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsVoltageMaxID) + params:params]; +} + +- (NSDictionary *)readAttributeRmsCurrentWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsCurrentID) + params:params]; +} + +- (NSDictionary *)readAttributeRmsCurrentMinWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsCurrentMinID) + params:params]; +} + +- (NSDictionary *)readAttributeRmsCurrentMaxWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsCurrentMaxID) + params:params]; +} + +- (NSDictionary *)readAttributeActivePowerWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeActivePowerID) + params:params]; +} + +- (NSDictionary *)readAttributeActivePowerMinWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeActivePowerMinID) + params:params]; +} + +- (NSDictionary *)readAttributeActivePowerMaxWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeActivePowerMaxID) + params:params]; +} + +- (NSDictionary *)readAttributeReactivePowerWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeReactivePowerID) + params:params]; +} + +- (NSDictionary *)readAttributeApparentPowerWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeApparentPowerID) + params:params]; +} + +- (NSDictionary *)readAttributePowerFactorWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributePowerFactorID) + params:params]; +} + +- (NSDictionary *)readAttributeAverageRmsVoltageMeasurementPeriodWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeAverageRmsVoltageMeasurementPeriodID) + params:params]; +} + +- (void)writeAttributeAverageRmsVoltageMeasurementPeriodWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeAverageRmsVoltageMeasurementPeriodWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeAverageRmsVoltageMeasurementPeriodWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeAverageRmsVoltageMeasurementPeriodID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeAverageRmsUnderVoltageCounterWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeAverageRmsUnderVoltageCounterID) + params:params]; +} + +- (void)writeAttributeAverageRmsUnderVoltageCounterWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeAverageRmsUnderVoltageCounterWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeAverageRmsUnderVoltageCounterWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeAverageRmsUnderVoltageCounterID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeRmsExtremeOverVoltagePeriodWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsExtremeOverVoltagePeriodID) + params:params]; +} + +- (void)writeAttributeRmsExtremeOverVoltagePeriodWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeRmsExtremeOverVoltagePeriodWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeRmsExtremeOverVoltagePeriodWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsExtremeOverVoltagePeriodID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeRmsExtremeUnderVoltagePeriodWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsExtremeUnderVoltagePeriodID) + params:params]; +} + +- (void)writeAttributeRmsExtremeUnderVoltagePeriodWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeRmsExtremeUnderVoltagePeriodWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeRmsExtremeUnderVoltagePeriodWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsExtremeUnderVoltagePeriodID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeRmsVoltageSagPeriodWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsVoltageSagPeriodID) + params:params]; +} + +- (void)writeAttributeRmsVoltageSagPeriodWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeRmsVoltageSagPeriodWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeRmsVoltageSagPeriodWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsVoltageSagPeriodID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeRmsVoltageSwellPeriodWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsVoltageSwellPeriodID) + params:params]; +} + +- (void)writeAttributeRmsVoltageSwellPeriodWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeRmsVoltageSwellPeriodWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeRmsVoltageSwellPeriodWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsVoltageSwellPeriodID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeAcVoltageMultiplierWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeAcVoltageMultiplierID) + params:params]; +} + +- (NSDictionary *)readAttributeAcVoltageDivisorWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeAcVoltageDivisorID) + params:params]; +} + +- (NSDictionary *)readAttributeAcCurrentMultiplierWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeAcCurrentMultiplierID) + params:params]; +} + +- (NSDictionary *)readAttributeAcCurrentDivisorWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeAcCurrentDivisorID) + params:params]; +} + +- (NSDictionary *)readAttributeAcPowerMultiplierWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeAcPowerMultiplierID) + params:params]; +} + +- (NSDictionary *)readAttributeAcPowerDivisorWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeAcPowerDivisorID) + params:params]; +} + +- (NSDictionary *)readAttributeOverloadAlarmsMaskWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeOverloadAlarmsMaskID) + params:params]; +} + +- (void)writeAttributeOverloadAlarmsMaskWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeOverloadAlarmsMaskWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeOverloadAlarmsMaskWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeOverloadAlarmsMaskID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeVoltageOverloadWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeVoltageOverloadID) + params:params]; +} + +- (NSDictionary *)readAttributeCurrentOverloadWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeCurrentOverloadID) + params:params]; +} + +- (NSDictionary *)readAttributeAcOverloadAlarmsMaskWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeAcOverloadAlarmsMaskID) + params:params]; +} + +- (void)writeAttributeAcOverloadAlarmsMaskWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeAcOverloadAlarmsMaskWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeAcOverloadAlarmsMaskWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeAcOverloadAlarmsMaskID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeAcVoltageOverloadWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeAcVoltageOverloadID) + params:params]; +} + +- (NSDictionary *)readAttributeAcCurrentOverloadWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeAcCurrentOverloadID) + params:params]; +} + +- (NSDictionary *)readAttributeAcActivePowerOverloadWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeAcActivePowerOverloadID) + params:params]; +} + +- (NSDictionary *)readAttributeAcReactivePowerOverloadWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeAcReactivePowerOverloadID) + params:params]; +} + +- (NSDictionary *)readAttributeAverageRmsOverVoltageWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeAverageRmsOverVoltageID) + params:params]; +} + +- (NSDictionary *)readAttributeAverageRmsUnderVoltageWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeAverageRmsUnderVoltageID) + params:params]; +} + +- (NSDictionary *)readAttributeRmsExtremeOverVoltageWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsExtremeOverVoltageID) + params:params]; +} + +- (NSDictionary *)readAttributeRmsExtremeUnderVoltageWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsExtremeUnderVoltageID) + params:params]; +} + +- (NSDictionary *)readAttributeRmsVoltageSagWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsVoltageSagID) + params:params]; +} + +- (NSDictionary *)readAttributeRmsVoltageSwellWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsVoltageSwellID) + params:params]; +} + +- (NSDictionary *)readAttributeLineCurrentPhaseBWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeLineCurrentPhaseBID) + params:params]; +} + +- (NSDictionary *)readAttributeActiveCurrentPhaseBWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeActiveCurrentPhaseBID) + params:params]; +} + +- (NSDictionary *)readAttributeReactiveCurrentPhaseBWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeReactiveCurrentPhaseBID) + params:params]; +} + +- (NSDictionary *)readAttributeRmsVoltagePhaseBWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsVoltagePhaseBID) + params:params]; +} + +- (NSDictionary *)readAttributeRmsVoltageMinPhaseBWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsVoltageMinPhaseBID) + params:params]; +} + +- (NSDictionary *)readAttributeRmsVoltageMaxPhaseBWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsVoltageMaxPhaseBID) + params:params]; +} + +- (NSDictionary *)readAttributeRmsCurrentPhaseBWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsCurrentPhaseBID) + params:params]; +} + +- (NSDictionary *)readAttributeRmsCurrentMinPhaseBWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsCurrentMinPhaseBID) + params:params]; +} + +- (NSDictionary *)readAttributeRmsCurrentMaxPhaseBWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsCurrentMaxPhaseBID) + params:params]; +} + +- (NSDictionary *)readAttributeActivePowerPhaseBWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeActivePowerPhaseBID) + params:params]; +} + +- (NSDictionary *)readAttributeActivePowerMinPhaseBWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeActivePowerMinPhaseBID) + params:params]; +} + +- (NSDictionary *)readAttributeActivePowerMaxPhaseBWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeActivePowerMaxPhaseBID) + params:params]; +} + +- (NSDictionary *)readAttributeReactivePowerPhaseBWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeReactivePowerPhaseBID) + params:params]; +} + +- (NSDictionary *)readAttributeApparentPowerPhaseBWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeApparentPowerPhaseBID) + params:params]; +} + +- (NSDictionary *)readAttributePowerFactorPhaseBWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributePowerFactorPhaseBID) + params:params]; +} + +- (NSDictionary *)readAttributeAverageRmsVoltageMeasurementPeriodPhaseBWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device + readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeAverageRmsVoltageMeasurementPeriodPhaseBID) + params:params]; +} + +- (NSDictionary *)readAttributeAverageRmsOverVoltageCounterPhaseBWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeAverageRmsOverVoltageCounterPhaseBID) + params:params]; +} + +- (NSDictionary *)readAttributeAverageRmsUnderVoltageCounterPhaseBWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeAverageRmsUnderVoltageCounterPhaseBID) + params:params]; +} + +- (NSDictionary *)readAttributeRmsExtremeOverVoltagePeriodPhaseBWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsExtremeOverVoltagePeriodPhaseBID) + params:params]; +} + +- (NSDictionary *)readAttributeRmsExtremeUnderVoltagePeriodPhaseBWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsExtremeUnderVoltagePeriodPhaseBID) + params:params]; +} + +- (NSDictionary *)readAttributeRmsVoltageSagPeriodPhaseBWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsVoltageSagPeriodPhaseBID) + params:params]; +} + +- (NSDictionary *)readAttributeRmsVoltageSwellPeriodPhaseBWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsVoltageSwellPeriodPhaseBID) + params:params]; +} + +- (NSDictionary *)readAttributeLineCurrentPhaseCWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeLineCurrentPhaseCID) + params:params]; +} + +- (NSDictionary *)readAttributeActiveCurrentPhaseCWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeActiveCurrentPhaseCID) + params:params]; +} + +- (NSDictionary *)readAttributeReactiveCurrentPhaseCWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeReactiveCurrentPhaseCID) + params:params]; +} + +- (NSDictionary *)readAttributeRmsVoltagePhaseCWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsVoltagePhaseCID) + params:params]; +} + +- (NSDictionary *)readAttributeRmsVoltageMinPhaseCWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsVoltageMinPhaseCID) + params:params]; +} + +- (NSDictionary *)readAttributeRmsVoltageMaxPhaseCWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsVoltageMaxPhaseCID) + params:params]; +} + +- (NSDictionary *)readAttributeRmsCurrentPhaseCWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsCurrentPhaseCID) + params:params]; +} + +- (NSDictionary *)readAttributeRmsCurrentMinPhaseCWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsCurrentMinPhaseCID) + params:params]; +} + +- (NSDictionary *)readAttributeRmsCurrentMaxPhaseCWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsCurrentMaxPhaseCID) + params:params]; +} + +- (NSDictionary *)readAttributeActivePowerPhaseCWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeActivePowerPhaseCID) + params:params]; +} + +- (NSDictionary *)readAttributeActivePowerMinPhaseCWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeActivePowerMinPhaseCID) + params:params]; +} + +- (NSDictionary *)readAttributeActivePowerMaxPhaseCWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeActivePowerMaxPhaseCID) + params:params]; +} + +- (NSDictionary *)readAttributeReactivePowerPhaseCWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeReactivePowerPhaseCID) + params:params]; +} + +- (NSDictionary *)readAttributeApparentPowerPhaseCWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeApparentPowerPhaseCID) + params:params]; +} + +- (NSDictionary *)readAttributePowerFactorPhaseCWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributePowerFactorPhaseCID) + params:params]; +} + +- (NSDictionary *)readAttributeAverageRmsVoltageMeasurementPeriodPhaseCWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device + readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeAverageRmsVoltageMeasurementPeriodPhaseCID) + params:params]; +} + +- (NSDictionary *)readAttributeAverageRmsOverVoltageCounterPhaseCWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeAverageRmsOverVoltageCounterPhaseCID) + params:params]; +} + +- (NSDictionary *)readAttributeAverageRmsUnderVoltageCounterPhaseCWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeAverageRmsUnderVoltageCounterPhaseCID) + params:params]; +} + +- (NSDictionary *)readAttributeRmsExtremeOverVoltagePeriodPhaseCWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsExtremeOverVoltagePeriodPhaseCID) + params:params]; +} + +- (NSDictionary *)readAttributeRmsExtremeUnderVoltagePeriodPhaseCWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsExtremeUnderVoltagePeriodPhaseCID) + params:params]; +} + +- (NSDictionary *)readAttributeRmsVoltageSagPeriodPhaseCWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsVoltageSagPeriodPhaseCID) + params:params]; +} + +- (NSDictionary *)readAttributeRmsVoltageSwellPeriodPhaseCWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeRmsVoltageSwellPeriodPhaseCID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterElectricalMeasurementID) + attributeId:@(MTRClusterElectricalMeasurementAttributeClusterRevisionID) + params:params]; +} + +@end + +@implementation MTRClusterTestCluster + +- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = endpoint; + _device = device; + } + return self; +} + +- (void)testWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + [self testWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completionHandler:completionHandler]; +} +- (void)testWithParams:(MTRTestClusterClusterTestParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + TestCluster::Commands::Test::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::TestClusterCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)testNotHandledWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + [self testNotHandledWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completionHandler:completionHandler]; +} +- (void)testNotHandledWithParams:(MTRTestClusterClusterTestNotHandledParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + TestCluster::Commands::TestNotHandled::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::TestClusterCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)testSpecificWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRTestClusterClusterTestSpecificResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + [self testSpecificWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completionHandler:completionHandler]; +} +- (void)testSpecificWithParams:(MTRTestClusterClusterTestSpecificParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRTestClusterClusterTestSpecificResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRTestClusterClusterTestSpecificResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + TestCluster::Commands::TestSpecific::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::TestClusterCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)testUnknownCommandWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + [self testUnknownCommandWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completionHandler:completionHandler]; +} +- (void)testUnknownCommandWithParams:(MTRTestClusterClusterTestUnknownCommandParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + TestCluster::Commands::TestUnknownCommand::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::TestClusterCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)testAddArgumentsWithParams:(MTRTestClusterClusterTestAddArgumentsParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRTestClusterClusterTestAddArgumentsResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRTestClusterClusterTestAddArgumentsResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + TestCluster::Commands::TestAddArguments::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.arg1 = params.arg1.unsignedCharValue; + request.arg2 = params.arg2.unsignedCharValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::TestClusterCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)testSimpleArgumentRequestWithParams:(MTRTestClusterClusterTestSimpleArgumentRequestParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRTestClusterClusterTestSimpleArgumentResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRTestClusterClusterTestSimpleArgumentResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + TestCluster::Commands::TestSimpleArgumentRequest::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.arg1 = params.arg1.boolValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::TestClusterCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)testStructArrayArgumentRequestWithParams:(MTRTestClusterClusterTestStructArrayArgumentRequestParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRTestClusterClusterTestStructArrayArgumentResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRTestClusterClusterTestStructArrayArgumentResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + TestCluster::Commands::TestStructArrayArgumentRequest::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (params.arg1.count != 0) { + auto * listHolder_0 = new ListHolder(params.arg1.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < params.arg1.count; ++i_0) { + if (![params.arg1[i_0] isKindOfClass:[MTRTestClusterClusterNestedStructList class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (MTRTestClusterClusterNestedStructList *) params.arg1[i_0]; + listHolder_0->mList[i_0].a = element_0.a.unsignedCharValue; + listHolder_0->mList[i_0].b = element_0.b.boolValue; + listHolder_0->mList[i_0].c.a = element_0.c.a.unsignedCharValue; + listHolder_0->mList[i_0].c.b = element_0.c.b.boolValue; + listHolder_0->mList[i_0].c.c + = static_castmList[i_0].c.c)>>( + element_0.c.c.unsignedCharValue); + listHolder_0->mList[i_0].c.d = [self asByteSpan:element_0.c.d]; + listHolder_0->mList[i_0].c.e = [self asCharSpan:element_0.c.e]; + listHolder_0->mList[i_0].c.f + = static_castmList[i_0].c.f)>>( + element_0.c.f.unsignedCharValue); + listHolder_0->mList[i_0].c.g = element_0.c.g.floatValue; + listHolder_0->mList[i_0].c.h = element_0.c.h.doubleValue; + { + using ListType_2 = std::remove_reference_tmList[i_0].d)>; + using ListMemberType_2 = ListMemberTypeGetter::Type; + if (element_0.d.count != 0) { + auto * listHolder_2 = new ListHolder(element_0.d.count); + if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_2); + for (size_t i_2 = 0; i_2 < element_0.d.count; ++i_2) { + if (![element_0.d[i_2] isKindOfClass:[MTRTestClusterClusterSimpleStruct class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_2 = (MTRTestClusterClusterSimpleStruct *) element_0.d[i_2]; + listHolder_2->mList[i_2].a = element_2.a.unsignedCharValue; + listHolder_2->mList[i_2].b = element_2.b.boolValue; + listHolder_2->mList[i_2].c + = static_castmList[i_2].c)>>( + element_2.c.unsignedCharValue); + listHolder_2->mList[i_2].d = [self asByteSpan:element_2.d]; + listHolder_2->mList[i_2].e = [self asCharSpan:element_2.e]; + listHolder_2->mList[i_2].f + = static_castmList[i_2].f)>>( + element_2.f.unsignedCharValue); + listHolder_2->mList[i_2].g = element_2.g.floatValue; + listHolder_2->mList[i_2].h = element_2.h.doubleValue; + } + listHolder_0->mList[i_0].d = ListType_2(listHolder_2->mList, element_0.d.count); + } else { + listHolder_0->mList[i_0].d = ListType_2(); + } + } + { + using ListType_2 = std::remove_reference_tmList[i_0].e)>; + using ListMemberType_2 = ListMemberTypeGetter::Type; + if (element_0.e.count != 0) { + auto * listHolder_2 = new ListHolder(element_0.e.count); + if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_2); + for (size_t i_2 = 0; i_2 < element_0.e.count; ++i_2) { + if (![element_0.e[i_2] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_2 = (NSNumber *) element_0.e[i_2]; + listHolder_2->mList[i_2] = element_2.unsignedIntValue; + } + listHolder_0->mList[i_0].e = ListType_2(listHolder_2->mList, element_0.e.count); + } else { + listHolder_0->mList[i_0].e = ListType_2(); + } + } + { + using ListType_2 = std::remove_reference_tmList[i_0].f)>; + using ListMemberType_2 = ListMemberTypeGetter::Type; + if (element_0.f.count != 0) { + auto * listHolder_2 = new ListHolder(element_0.f.count); + if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_2); + for (size_t i_2 = 0; i_2 < element_0.f.count; ++i_2) { + if (![element_0.f[i_2] isKindOfClass:[NSData class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_2 = (NSData *) element_0.f[i_2]; + listHolder_2->mList[i_2] = [self asByteSpan:element_2]; + } + listHolder_0->mList[i_0].f = ListType_2(listHolder_2->mList, element_0.f.count); + } else { + listHolder_0->mList[i_0].f = ListType_2(); + } + } + { + using ListType_2 = std::remove_reference_tmList[i_0].g)>; + using ListMemberType_2 = ListMemberTypeGetter::Type; + if (element_0.g.count != 0) { + auto * listHolder_2 = new ListHolder(element_0.g.count); + if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_2); + for (size_t i_2 = 0; i_2 < element_0.g.count; ++i_2) { + if (![element_0.g[i_2] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_2 = (NSNumber *) element_0.g[i_2]; + listHolder_2->mList[i_2] = element_2.unsignedCharValue; + } + listHolder_0->mList[i_0].g = ListType_2(listHolder_2->mList, element_0.g.count); + } else { + listHolder_0->mList[i_0].g = ListType_2(); + } + } + } + request.arg1 = ListType_0(listHolder_0->mList, params.arg1.count); + } else { + request.arg1 = ListType_0(); + } + } + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (params.arg2.count != 0) { + auto * listHolder_0 = new ListHolder(params.arg2.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < params.arg2.count; ++i_0) { + if (![params.arg2[i_0] isKindOfClass:[MTRTestClusterClusterSimpleStruct class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (MTRTestClusterClusterSimpleStruct *) params.arg2[i_0]; + listHolder_0->mList[i_0].a = element_0.a.unsignedCharValue; + listHolder_0->mList[i_0].b = element_0.b.boolValue; + listHolder_0->mList[i_0].c = static_castmList[i_0].c)>>( + element_0.c.unsignedCharValue); + listHolder_0->mList[i_0].d = [self asByteSpan:element_0.d]; + listHolder_0->mList[i_0].e = [self asCharSpan:element_0.e]; + listHolder_0->mList[i_0].f = static_castmList[i_0].f)>>( + element_0.f.unsignedCharValue); + listHolder_0->mList[i_0].g = element_0.g.floatValue; + listHolder_0->mList[i_0].h = element_0.h.doubleValue; + } + request.arg2 = ListType_0(listHolder_0->mList, params.arg2.count); + } else { + request.arg2 = ListType_0(); + } + } + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (params.arg3.count != 0) { + auto * listHolder_0 = new ListHolder(params.arg3.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < params.arg3.count; ++i_0) { + if (![params.arg3[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) params.arg3[i_0]; + listHolder_0->mList[i_0] = static_castmList[i_0])>>( + element_0.unsignedCharValue); + } + request.arg3 = ListType_0(listHolder_0->mList, params.arg3.count); + } else { + request.arg3 = ListType_0(); + } + } + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (params.arg4.count != 0) { + auto * listHolder_0 = new ListHolder(params.arg4.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < params.arg4.count; ++i_0) { + if (![params.arg4[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) params.arg4[i_0]; + listHolder_0->mList[i_0] = element_0.boolValue; + } + request.arg4 = ListType_0(listHolder_0->mList, params.arg4.count); + } else { + request.arg4 = ListType_0(); + } + } + request.arg5 = static_cast>(params.arg5.unsignedCharValue); + request.arg6 = params.arg6.boolValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::TestClusterCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)testStructArgumentRequestWithParams:(MTRTestClusterClusterTestStructArgumentRequestParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRTestClusterClusterBooleanResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRTestClusterClusterBooleanResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + TestCluster::Commands::TestStructArgumentRequest::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.arg1.a = params.arg1.a.unsignedCharValue; + request.arg1.b = params.arg1.b.boolValue; + request.arg1.c = static_cast>(params.arg1.c.unsignedCharValue); + request.arg1.d = [self asByteSpan:params.arg1.d]; + request.arg1.e = [self asCharSpan:params.arg1.e]; + request.arg1.f = static_cast>(params.arg1.f.unsignedCharValue); + request.arg1.g = params.arg1.g.floatValue; + request.arg1.h = params.arg1.h.doubleValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::TestClusterCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)testNestedStructArgumentRequestWithParams:(MTRTestClusterClusterTestNestedStructArgumentRequestParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRTestClusterClusterBooleanResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRTestClusterClusterBooleanResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + TestCluster::Commands::TestNestedStructArgumentRequest::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.arg1.a = params.arg1.a.unsignedCharValue; + request.arg1.b = params.arg1.b.boolValue; + request.arg1.c.a = params.arg1.c.a.unsignedCharValue; + request.arg1.c.b = params.arg1.c.b.boolValue; + request.arg1.c.c + = static_cast>(params.arg1.c.c.unsignedCharValue); + request.arg1.c.d = [self asByteSpan:params.arg1.c.d]; + request.arg1.c.e = [self asCharSpan:params.arg1.c.e]; + request.arg1.c.f + = static_cast>(params.arg1.c.f.unsignedCharValue); + request.arg1.c.g = params.arg1.c.g.floatValue; + request.arg1.c.h = params.arg1.c.h.doubleValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::TestClusterCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)testListStructArgumentRequestWithParams:(MTRTestClusterClusterTestListStructArgumentRequestParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRTestClusterClusterBooleanResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRTestClusterClusterBooleanResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + TestCluster::Commands::TestListStructArgumentRequest::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (params.arg1.count != 0) { + auto * listHolder_0 = new ListHolder(params.arg1.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < params.arg1.count; ++i_0) { + if (![params.arg1[i_0] isKindOfClass:[MTRTestClusterClusterSimpleStruct class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (MTRTestClusterClusterSimpleStruct *) params.arg1[i_0]; + listHolder_0->mList[i_0].a = element_0.a.unsignedCharValue; + listHolder_0->mList[i_0].b = element_0.b.boolValue; + listHolder_0->mList[i_0].c = static_castmList[i_0].c)>>( + element_0.c.unsignedCharValue); + listHolder_0->mList[i_0].d = [self asByteSpan:element_0.d]; + listHolder_0->mList[i_0].e = [self asCharSpan:element_0.e]; + listHolder_0->mList[i_0].f = static_castmList[i_0].f)>>( + element_0.f.unsignedCharValue); + listHolder_0->mList[i_0].g = element_0.g.floatValue; + listHolder_0->mList[i_0].h = element_0.h.doubleValue; + } + request.arg1 = ListType_0(listHolder_0->mList, params.arg1.count); + } else { + request.arg1 = ListType_0(); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::TestClusterCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)testListInt8UArgumentRequestWithParams:(MTRTestClusterClusterTestListInt8UArgumentRequestParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRTestClusterClusterBooleanResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRTestClusterClusterBooleanResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + TestCluster::Commands::TestListInt8UArgumentRequest::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (params.arg1.count != 0) { + auto * listHolder_0 = new ListHolder(params.arg1.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < params.arg1.count; ++i_0) { + if (![params.arg1[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) params.arg1[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedCharValue; + } + request.arg1 = ListType_0(listHolder_0->mList, params.arg1.count); + } else { + request.arg1 = ListType_0(); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::TestClusterCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)testNestedStructListArgumentRequestWithParams:(MTRTestClusterClusterTestNestedStructListArgumentRequestParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRTestClusterClusterBooleanResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRTestClusterClusterBooleanResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + TestCluster::Commands::TestNestedStructListArgumentRequest::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.arg1.a = params.arg1.a.unsignedCharValue; + request.arg1.b = params.arg1.b.boolValue; + request.arg1.c.a = params.arg1.c.a.unsignedCharValue; + request.arg1.c.b = params.arg1.c.b.boolValue; + request.arg1.c.c + = static_cast>(params.arg1.c.c.unsignedCharValue); + request.arg1.c.d = [self asByteSpan:params.arg1.c.d]; + request.arg1.c.e = [self asCharSpan:params.arg1.c.e]; + request.arg1.c.f + = static_cast>(params.arg1.c.f.unsignedCharValue); + request.arg1.c.g = params.arg1.c.g.floatValue; + request.arg1.c.h = params.arg1.c.h.doubleValue; + { + using ListType_1 = std::remove_reference_t; + using ListMemberType_1 = ListMemberTypeGetter::Type; + if (params.arg1.d.count != 0) { + auto * listHolder_1 = new ListHolder(params.arg1.d.count); + if (listHolder_1 == nullptr || listHolder_1->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_1); + for (size_t i_1 = 0; i_1 < params.arg1.d.count; ++i_1) { + if (![params.arg1.d[i_1] isKindOfClass:[MTRTestClusterClusterSimpleStruct class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_1 = (MTRTestClusterClusterSimpleStruct *) params.arg1.d[i_1]; + listHolder_1->mList[i_1].a = element_1.a.unsignedCharValue; + listHolder_1->mList[i_1].b = element_1.b.boolValue; + listHolder_1->mList[i_1].c = static_castmList[i_1].c)>>( + element_1.c.unsignedCharValue); + listHolder_1->mList[i_1].d = [self asByteSpan:element_1.d]; + listHolder_1->mList[i_1].e = [self asCharSpan:element_1.e]; + listHolder_1->mList[i_1].f = static_castmList[i_1].f)>>( + element_1.f.unsignedCharValue); + listHolder_1->mList[i_1].g = element_1.g.floatValue; + listHolder_1->mList[i_1].h = element_1.h.doubleValue; + } + request.arg1.d = ListType_1(listHolder_1->mList, params.arg1.d.count); + } else { + request.arg1.d = ListType_1(); + } + } + { + using ListType_1 = std::remove_reference_t; + using ListMemberType_1 = ListMemberTypeGetter::Type; + if (params.arg1.e.count != 0) { + auto * listHolder_1 = new ListHolder(params.arg1.e.count); + if (listHolder_1 == nullptr || listHolder_1->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_1); + for (size_t i_1 = 0; i_1 < params.arg1.e.count; ++i_1) { + if (![params.arg1.e[i_1] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_1 = (NSNumber *) params.arg1.e[i_1]; + listHolder_1->mList[i_1] = element_1.unsignedIntValue; + } + request.arg1.e = ListType_1(listHolder_1->mList, params.arg1.e.count); + } else { + request.arg1.e = ListType_1(); + } + } + { + using ListType_1 = std::remove_reference_t; + using ListMemberType_1 = ListMemberTypeGetter::Type; + if (params.arg1.f.count != 0) { + auto * listHolder_1 = new ListHolder(params.arg1.f.count); + if (listHolder_1 == nullptr || listHolder_1->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_1); + for (size_t i_1 = 0; i_1 < params.arg1.f.count; ++i_1) { + if (![params.arg1.f[i_1] isKindOfClass:[NSData class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_1 = (NSData *) params.arg1.f[i_1]; + listHolder_1->mList[i_1] = [self asByteSpan:element_1]; + } + request.arg1.f = ListType_1(listHolder_1->mList, params.arg1.f.count); + } else { + request.arg1.f = ListType_1(); + } + } + { + using ListType_1 = std::remove_reference_t; + using ListMemberType_1 = ListMemberTypeGetter::Type; + if (params.arg1.g.count != 0) { + auto * listHolder_1 = new ListHolder(params.arg1.g.count); + if (listHolder_1 == nullptr || listHolder_1->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_1); + for (size_t i_1 = 0; i_1 < params.arg1.g.count; ++i_1) { + if (![params.arg1.g[i_1] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_1 = (NSNumber *) params.arg1.g[i_1]; + listHolder_1->mList[i_1] = element_1.unsignedCharValue; + } + request.arg1.g = ListType_1(listHolder_1->mList, params.arg1.g.count); + } else { + request.arg1.g = ListType_1(); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::TestClusterCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)testListNestedStructListArgumentRequestWithParams: + (MTRTestClusterClusterTestListNestedStructListArgumentRequestParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRTestClusterClusterBooleanResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRTestClusterClusterBooleanResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + TestCluster::Commands::TestListNestedStructListArgumentRequest::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (params.arg1.count != 0) { + auto * listHolder_0 = new ListHolder(params.arg1.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < params.arg1.count; ++i_0) { + if (![params.arg1[i_0] isKindOfClass:[MTRTestClusterClusterNestedStructList class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (MTRTestClusterClusterNestedStructList *) params.arg1[i_0]; + listHolder_0->mList[i_0].a = element_0.a.unsignedCharValue; + listHolder_0->mList[i_0].b = element_0.b.boolValue; + listHolder_0->mList[i_0].c.a = element_0.c.a.unsignedCharValue; + listHolder_0->mList[i_0].c.b = element_0.c.b.boolValue; + listHolder_0->mList[i_0].c.c + = static_castmList[i_0].c.c)>>( + element_0.c.c.unsignedCharValue); + listHolder_0->mList[i_0].c.d = [self asByteSpan:element_0.c.d]; + listHolder_0->mList[i_0].c.e = [self asCharSpan:element_0.c.e]; + listHolder_0->mList[i_0].c.f + = static_castmList[i_0].c.f)>>( + element_0.c.f.unsignedCharValue); + listHolder_0->mList[i_0].c.g = element_0.c.g.floatValue; + listHolder_0->mList[i_0].c.h = element_0.c.h.doubleValue; + { + using ListType_2 = std::remove_reference_tmList[i_0].d)>; + using ListMemberType_2 = ListMemberTypeGetter::Type; + if (element_0.d.count != 0) { + auto * listHolder_2 = new ListHolder(element_0.d.count); + if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_2); + for (size_t i_2 = 0; i_2 < element_0.d.count; ++i_2) { + if (![element_0.d[i_2] isKindOfClass:[MTRTestClusterClusterSimpleStruct class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_2 = (MTRTestClusterClusterSimpleStruct *) element_0.d[i_2]; + listHolder_2->mList[i_2].a = element_2.a.unsignedCharValue; + listHolder_2->mList[i_2].b = element_2.b.boolValue; + listHolder_2->mList[i_2].c + = static_castmList[i_2].c)>>( + element_2.c.unsignedCharValue); + listHolder_2->mList[i_2].d = [self asByteSpan:element_2.d]; + listHolder_2->mList[i_2].e = [self asCharSpan:element_2.e]; + listHolder_2->mList[i_2].f + = static_castmList[i_2].f)>>( + element_2.f.unsignedCharValue); + listHolder_2->mList[i_2].g = element_2.g.floatValue; + listHolder_2->mList[i_2].h = element_2.h.doubleValue; + } + listHolder_0->mList[i_0].d = ListType_2(listHolder_2->mList, element_0.d.count); + } else { + listHolder_0->mList[i_0].d = ListType_2(); + } + } + { + using ListType_2 = std::remove_reference_tmList[i_0].e)>; + using ListMemberType_2 = ListMemberTypeGetter::Type; + if (element_0.e.count != 0) { + auto * listHolder_2 = new ListHolder(element_0.e.count); + if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_2); + for (size_t i_2 = 0; i_2 < element_0.e.count; ++i_2) { + if (![element_0.e[i_2] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_2 = (NSNumber *) element_0.e[i_2]; + listHolder_2->mList[i_2] = element_2.unsignedIntValue; + } + listHolder_0->mList[i_0].e = ListType_2(listHolder_2->mList, element_0.e.count); + } else { + listHolder_0->mList[i_0].e = ListType_2(); + } + } + { + using ListType_2 = std::remove_reference_tmList[i_0].f)>; + using ListMemberType_2 = ListMemberTypeGetter::Type; + if (element_0.f.count != 0) { + auto * listHolder_2 = new ListHolder(element_0.f.count); + if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_2); + for (size_t i_2 = 0; i_2 < element_0.f.count; ++i_2) { + if (![element_0.f[i_2] isKindOfClass:[NSData class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_2 = (NSData *) element_0.f[i_2]; + listHolder_2->mList[i_2] = [self asByteSpan:element_2]; + } + listHolder_0->mList[i_0].f = ListType_2(listHolder_2->mList, element_0.f.count); + } else { + listHolder_0->mList[i_0].f = ListType_2(); + } + } + { + using ListType_2 = std::remove_reference_tmList[i_0].g)>; + using ListMemberType_2 = ListMemberTypeGetter::Type; + if (element_0.g.count != 0) { + auto * listHolder_2 = new ListHolder(element_0.g.count); + if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_2); + for (size_t i_2 = 0; i_2 < element_0.g.count; ++i_2) { + if (![element_0.g[i_2] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_2 = (NSNumber *) element_0.g[i_2]; + listHolder_2->mList[i_2] = element_2.unsignedCharValue; + } + listHolder_0->mList[i_0].g = ListType_2(listHolder_2->mList, element_0.g.count); + } else { + listHolder_0->mList[i_0].g = ListType_2(); + } + } + } + request.arg1 = ListType_0(listHolder_0->mList, params.arg1.count); + } else { + request.arg1 = ListType_0(); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::TestClusterCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)testListInt8UReverseRequestWithParams:(MTRTestClusterClusterTestListInt8UReverseRequestParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRTestClusterClusterTestListInt8UReverseResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRTestClusterClusterTestListInt8UReverseResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + TestCluster::Commands::TestListInt8UReverseRequest::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (params.arg1.count != 0) { + auto * listHolder_0 = new ListHolder(params.arg1.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < params.arg1.count; ++i_0) { + if (![params.arg1[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) params.arg1[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedCharValue; + } + request.arg1 = ListType_0(listHolder_0->mList, params.arg1.count); + } else { + request.arg1 = ListType_0(); + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::TestClusterCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)testEnumsRequestWithParams:(MTRTestClusterClusterTestEnumsRequestParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRTestClusterClusterTestEnumsResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRTestClusterClusterTestEnumsResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + TestCluster::Commands::TestEnumsRequest::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.arg1 = static_cast>(params.arg1.unsignedShortValue); + request.arg2 = static_cast>(params.arg2.unsignedCharValue); + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::TestClusterCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)testNullableOptionalRequestWithParams:(MTRTestClusterClusterTestNullableOptionalRequestParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRTestClusterClusterTestNullableOptionalResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRTestClusterClusterTestNullableOptionalResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + TestCluster::Commands::TestNullableOptionalRequest::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + if (params != nil) { + if (params.arg1 != nil) { + auto & definedValue_0 = request.arg1.Emplace(); + if (params.arg1 == nil) { + definedValue_0.SetNull(); + } else { + auto & nonNullValue_1 = definedValue_0.SetNonNull(); + nonNullValue_1 = params.arg1.unsignedCharValue; + } + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::TestClusterCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)testComplexNullableOptionalRequestWithParams:(MTRTestClusterClusterTestComplexNullableOptionalRequestParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)(MTRTestClusterClusterTestComplexNullableOptionalResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRTestClusterClusterTestComplexNullableOptionalResponseCallbackBridge(self.callbackQueue, baseDevice, + completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + TestCluster::Commands::TestComplexNullableOptionalRequest::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + if (params.nullableInt == nil) { + request.nullableInt.SetNull(); + } else { + auto & nonNullValue_0 = request.nullableInt.SetNonNull(); + nonNullValue_0 = params.nullableInt.unsignedShortValue; + } + if (params.optionalInt != nil) { + auto & definedValue_0 = request.optionalInt.Emplace(); + definedValue_0 = params.optionalInt.unsignedShortValue; + } + if (params.nullableOptionalInt != nil) { + auto & definedValue_0 = request.nullableOptionalInt.Emplace(); + if (params.nullableOptionalInt == nil) { + definedValue_0.SetNull(); + } else { + auto & nonNullValue_1 = definedValue_0.SetNonNull(); + nonNullValue_1 = params.nullableOptionalInt.unsignedShortValue; + } + } + if (params.nullableString == nil) { + request.nullableString.SetNull(); + } else { + auto & nonNullValue_0 = request.nullableString.SetNonNull(); + nonNullValue_0 = [self asCharSpan:params.nullableString]; + } + if (params.optionalString != nil) { + auto & definedValue_0 = request.optionalString.Emplace(); + definedValue_0 = [self asCharSpan:params.optionalString]; + } + if (params.nullableOptionalString != nil) { + auto & definedValue_0 = request.nullableOptionalString.Emplace(); + if (params.nullableOptionalString == nil) { + definedValue_0.SetNull(); + } else { + auto & nonNullValue_1 = definedValue_0.SetNonNull(); + nonNullValue_1 = [self asCharSpan:params.nullableOptionalString]; + } + } + if (params.nullableStruct == nil) { + request.nullableStruct.SetNull(); + } else { + auto & nonNullValue_0 = request.nullableStruct.SetNonNull(); + nonNullValue_0.a = params.nullableStruct.a.unsignedCharValue; + nonNullValue_0.b = params.nullableStruct.b.boolValue; + nonNullValue_0.c = static_cast>( + params.nullableStruct.c.unsignedCharValue); + nonNullValue_0.d = [self asByteSpan:params.nullableStruct.d]; + nonNullValue_0.e = [self asCharSpan:params.nullableStruct.e]; + nonNullValue_0.f = static_cast>( + params.nullableStruct.f.unsignedCharValue); + nonNullValue_0.g = params.nullableStruct.g.floatValue; + nonNullValue_0.h = params.nullableStruct.h.doubleValue; + } + if (params.optionalStruct != nil) { + auto & definedValue_0 = request.optionalStruct.Emplace(); + definedValue_0.a = params.optionalStruct.a.unsignedCharValue; + definedValue_0.b = params.optionalStruct.b.boolValue; + definedValue_0.c = static_cast>( + params.optionalStruct.c.unsignedCharValue); + definedValue_0.d = [self asByteSpan:params.optionalStruct.d]; + definedValue_0.e = [self asCharSpan:params.optionalStruct.e]; + definedValue_0.f = static_cast>( + params.optionalStruct.f.unsignedCharValue); + definedValue_0.g = params.optionalStruct.g.floatValue; + definedValue_0.h = params.optionalStruct.h.doubleValue; + } + if (params.nullableOptionalStruct != nil) { + auto & definedValue_0 = request.nullableOptionalStruct.Emplace(); + if (params.nullableOptionalStruct == nil) { + definedValue_0.SetNull(); + } else { + auto & nonNullValue_1 = definedValue_0.SetNonNull(); + nonNullValue_1.a = params.nullableOptionalStruct.a.unsignedCharValue; + nonNullValue_1.b = params.nullableOptionalStruct.b.boolValue; + nonNullValue_1.c = static_cast>( + params.nullableOptionalStruct.c.unsignedCharValue); + nonNullValue_1.d = [self asByteSpan:params.nullableOptionalStruct.d]; + nonNullValue_1.e = [self asCharSpan:params.nullableOptionalStruct.e]; + nonNullValue_1.f = static_cast>( + params.nullableOptionalStruct.f.unsignedCharValue); + nonNullValue_1.g = params.nullableOptionalStruct.g.floatValue; + nonNullValue_1.h = params.nullableOptionalStruct.h.doubleValue; + } + } + if (params.nullableList == nil) { + request.nullableList.SetNull(); + } else { + auto & nonNullValue_0 = request.nullableList.SetNonNull(); + { + using ListType_1 = std::remove_reference_t; + using ListMemberType_1 = ListMemberTypeGetter::Type; + if (params.nullableList.count != 0) { + auto * listHolder_1 = new ListHolder(params.nullableList.count); + if (listHolder_1 == nullptr || listHolder_1->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_1); + for (size_t i_1 = 0; i_1 < params.nullableList.count; ++i_1) { + if (![params.nullableList[i_1] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_1 = (NSNumber *) params.nullableList[i_1]; + listHolder_1->mList[i_1] = static_castmList[i_1])>>( + element_1.unsignedCharValue); + } + nonNullValue_0 = ListType_1(listHolder_1->mList, params.nullableList.count); + } else { + nonNullValue_0 = ListType_1(); + } + } + } + if (params.optionalList != nil) { + auto & definedValue_0 = request.optionalList.Emplace(); + { + using ListType_1 = std::remove_reference_t; + using ListMemberType_1 = ListMemberTypeGetter::Type; + if (params.optionalList.count != 0) { + auto * listHolder_1 = new ListHolder(params.optionalList.count); + if (listHolder_1 == nullptr || listHolder_1->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_1); + for (size_t i_1 = 0; i_1 < params.optionalList.count; ++i_1) { + if (![params.optionalList[i_1] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_1 = (NSNumber *) params.optionalList[i_1]; + listHolder_1->mList[i_1] = static_castmList[i_1])>>( + element_1.unsignedCharValue); + } + definedValue_0 = ListType_1(listHolder_1->mList, params.optionalList.count); + } else { + definedValue_0 = ListType_1(); + } + } + } + if (params.nullableOptionalList != nil) { + auto & definedValue_0 = request.nullableOptionalList.Emplace(); + if (params.nullableOptionalList == nil) { + definedValue_0.SetNull(); + } else { + auto & nonNullValue_1 = definedValue_0.SetNonNull(); + { + using ListType_2 = std::remove_reference_t; + using ListMemberType_2 = ListMemberTypeGetter::Type; + if (params.nullableOptionalList.count != 0) { + auto * listHolder_2 = new ListHolder(params.nullableOptionalList.count); + if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_2); + for (size_t i_2 = 0; i_2 < params.nullableOptionalList.count; ++i_2) { + if (![params.nullableOptionalList[i_2] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_2 = (NSNumber *) params.nullableOptionalList[i_2]; + listHolder_2->mList[i_2] + = static_castmList[i_2])>>( + element_2.unsignedCharValue); + } + nonNullValue_1 = ListType_2(listHolder_2->mList, params.nullableOptionalList.count); + } else { + nonNullValue_1 = ListType_2(); + } + } + } + } + + auto successFn + = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::TestClusterCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)simpleStructEchoRequestWithParams:(MTRTestClusterClusterSimpleStructEchoRequestParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRTestClusterClusterSimpleStructResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRTestClusterClusterSimpleStructResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + TestCluster::Commands::SimpleStructEchoRequest::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.arg1.a = params.arg1.a.unsignedCharValue; + request.arg1.b = params.arg1.b.boolValue; + request.arg1.c = static_cast>(params.arg1.c.unsignedCharValue); + request.arg1.d = [self asByteSpan:params.arg1.d]; + request.arg1.e = [self asCharSpan:params.arg1.e]; + request.arg1.f = static_cast>(params.arg1.f.unsignedCharValue); + request.arg1.g = params.arg1.g.floatValue; + request.arg1.h = params.arg1.h.doubleValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::TestClusterCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)timedInvokeRequestWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + [self timedInvokeRequestWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completionHandler:completionHandler]; +} +- (void)timedInvokeRequestWithParams:(MTRTestClusterClusterTimedInvokeRequestParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + TestCluster::Commands::TimedInvokeRequest::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + if (!timedInvokeTimeoutMs.HasValue()) { + timedInvokeTimeoutMs.SetValue(10000); + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::TestClusterCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)testSimpleOptionalArgumentRequestWithParams:(MTRTestClusterClusterTestSimpleOptionalArgumentRequestParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(StatusCompletion)completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRCommandSuccessCallbackBridge( + self.callbackQueue, baseDevice, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + TestCluster::Commands::TestSimpleOptionalArgumentRequest::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + if (params != nil) { + if (params.arg1 != nil) { + auto & definedValue_0 = request.arg1.Emplace(); + definedValue_0 = params.arg1.boolValue; + } + } + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::TestClusterCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)testEmitTestEventRequestWithParams:(MTRTestClusterClusterTestEmitTestEventRequestParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler:(void (^)(MTRTestClusterClusterTestEmitTestEventResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRTestClusterClusterTestEmitTestEventResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + TestCluster::Commands::TestEmitTestEventRequest::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.arg1 = params.arg1.unsignedCharValue; + request.arg2 = static_cast>(params.arg2.unsignedCharValue); + request.arg3 = params.arg3.boolValue; + + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::TestClusterCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (void)testEmitTestFabricScopedEventRequestWithParams:(MTRTestClusterClusterTestEmitTestFabricScopedEventRequestParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completionHandler: + (void (^)( + MTRTestClusterClusterTestEmitTestFabricScopedEventResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + // Make a copy of params before we go async. + params = [params copy]; + [self.device connectAndPerformAsync:^(MTRBaseDevice * baseDevice) { + new MTRTestClusterClusterTestEmitTestFabricScopedEventResponseCallbackBridge(self.callbackQueue, baseDevice, + completionHandler, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + TestCluster::Commands::TestEmitTestFabricScopedEventRequest::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + request.arg1 = params.arg1.unsignedCharValue; + + auto successFn + = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + chip::Controller::TestClusterCluster cppCluster(exchangeManager, session, self->_endpoint); + return cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); + }]; + + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; +} + +- (NSDictionary *)readAttributeBooleanWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeBooleanID) + params:params]; +} + +- (void)writeAttributeBooleanWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeBooleanWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeBooleanWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeBooleanID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeBitmap8WithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeBitmap8ID) + params:params]; +} + +- (void)writeAttributeBitmap8WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeBitmap8WithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeBitmap8WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeBitmap8ID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeBitmap16WithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeBitmap16ID) + params:params]; +} + +- (void)writeAttributeBitmap16WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeBitmap16WithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeBitmap16WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeBitmap16ID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeBitmap32WithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeBitmap32ID) + params:params]; +} + +- (void)writeAttributeBitmap32WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeBitmap32WithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeBitmap32WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeBitmap32ID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeBitmap64WithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeBitmap64ID) + params:params]; +} + +- (void)writeAttributeBitmap64WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeBitmap64WithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeBitmap64WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeBitmap64ID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeInt8uWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeInt8uID) + params:params]; +} + +- (void)writeAttributeInt8uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeInt8uWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeInt8uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeInt8uID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeInt16uWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeInt16uID) + params:params]; +} + +- (void)writeAttributeInt16uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeInt16uWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeInt16uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeInt16uID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeInt24uWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeInt24uID) + params:params]; +} + +- (void)writeAttributeInt24uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeInt24uWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeInt24uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeInt24uID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeInt32uWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeInt32uID) + params:params]; +} + +- (void)writeAttributeInt32uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeInt32uWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeInt32uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeInt32uID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeInt40uWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeInt40uID) + params:params]; +} + +- (void)writeAttributeInt40uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeInt40uWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeInt40uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeInt40uID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeInt48uWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeInt48uID) + params:params]; +} + +- (void)writeAttributeInt48uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeInt48uWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeInt48uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeInt48uID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeInt56uWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeInt56uID) + params:params]; +} + +- (void)writeAttributeInt56uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeInt56uWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeInt56uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeInt56uID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeInt64uWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeInt64uID) + params:params]; +} + +- (void)writeAttributeInt64uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeInt64uWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeInt64uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeInt64uID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeInt8sWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeInt8sID) + params:params]; +} + +- (void)writeAttributeInt8sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeInt8sWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeInt8sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeInt8sID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeInt16sWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeInt16sID) + params:params]; +} + +- (void)writeAttributeInt16sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeInt16sWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeInt16sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeInt16sID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeInt24sWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeInt24sID) + params:params]; +} + +- (void)writeAttributeInt24sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeInt24sWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeInt24sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeInt24sID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeInt32sWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeInt32sID) + params:params]; +} + +- (void)writeAttributeInt32sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeInt32sWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeInt32sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeInt32sID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeInt40sWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeInt40sID) + params:params]; +} + +- (void)writeAttributeInt40sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeInt40sWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeInt40sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeInt40sID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeInt48sWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeInt48sID) + params:params]; +} + +- (void)writeAttributeInt48sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeInt48sWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeInt48sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeInt48sID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeInt56sWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeInt56sID) + params:params]; +} + +- (void)writeAttributeInt56sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeInt56sWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeInt56sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeInt56sID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeInt64sWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeInt64sID) + params:params]; +} + +- (void)writeAttributeInt64sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeInt64sWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeInt64sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeInt64sID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeEnum8WithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeEnum8ID) + params:params]; +} + +- (void)writeAttributeEnum8WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeEnum8WithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeEnum8WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeEnum8ID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeEnum16WithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeEnum16ID) + params:params]; +} + +- (void)writeAttributeEnum16WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeEnum16WithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeEnum16WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeEnum16ID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeFloatSingleWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeFloatSingleID) + params:params]; +} + +- (void)writeAttributeFloatSingleWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeFloatSingleWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeFloatSingleWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeFloatSingleID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeFloatDoubleWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeFloatDoubleID) + params:params]; +} + +- (void)writeAttributeFloatDoubleWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeFloatDoubleWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeFloatDoubleWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeFloatDoubleID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeOctetStringWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeOctetStringID) + params:params]; +} + +- (void)writeAttributeOctetStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeOctetStringWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeOctetStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeOctetStringID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeListInt8uWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeListInt8uID) + params:params]; +} + +- (void)writeAttributeListInt8uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeListInt8uWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeListInt8uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeListInt8uID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeListOctetStringWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeListOctetStringID) + params:params]; +} + +- (void)writeAttributeListOctetStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeListOctetStringWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeListOctetStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeListOctetStringID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeListStructOctetStringWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeListStructOctetStringID) + params:params]; +} + +- (void)writeAttributeListStructOctetStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeListStructOctetStringWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeListStructOctetStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeListStructOctetStringID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeLongOctetStringWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeLongOctetStringID) + params:params]; +} + +- (void)writeAttributeLongOctetStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeLongOctetStringWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeLongOctetStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeLongOctetStringID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeCharStringWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeCharStringID) + params:params]; +} + +- (void)writeAttributeCharStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeCharStringWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeCharStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeCharStringID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeLongCharStringWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeLongCharStringID) + params:params]; +} + +- (void)writeAttributeLongCharStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeLongCharStringWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeLongCharStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeLongCharStringID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeEpochUsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeEpochUsID) + params:params]; +} + +- (void)writeAttributeEpochUsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeEpochUsWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeEpochUsWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeEpochUsID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeEpochSWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeEpochSID) + params:params]; +} + +- (void)writeAttributeEpochSWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeEpochSWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeEpochSWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeEpochSID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeVendorIdWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeVendorIdID) + params:params]; +} + +- (void)writeAttributeVendorIdWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeVendorIdWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeVendorIdWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeVendorIdID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeListNullablesAndOptionalsStructWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeListNullablesAndOptionalsStructID) + params:params]; +} + +- (void)writeAttributeListNullablesAndOptionalsStructWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeListNullablesAndOptionalsStructWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeListNullablesAndOptionalsStructWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeListNullablesAndOptionalsStructID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeEnumAttrWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeEnumAttrID) + params:params]; +} + +- (void)writeAttributeEnumAttrWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeEnumAttrWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeEnumAttrWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeEnumAttrID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeStructAttrWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeStructAttrID) + params:params]; +} + +- (void)writeAttributeStructAttrWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeStructAttrWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeStructAttrWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeStructAttrID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeRangeRestrictedInt8uWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeRangeRestrictedInt8uID) + params:params]; +} + +- (void)writeAttributeRangeRestrictedInt8uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeRangeRestrictedInt8uWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeRangeRestrictedInt8uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeRangeRestrictedInt8uID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeRangeRestrictedInt8sWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeRangeRestrictedInt8sID) + params:params]; +} + +- (void)writeAttributeRangeRestrictedInt8sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeRangeRestrictedInt8sWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeRangeRestrictedInt8sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeRangeRestrictedInt8sID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeRangeRestrictedInt16uWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeRangeRestrictedInt16uID) + params:params]; +} + +- (void)writeAttributeRangeRestrictedInt16uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeRangeRestrictedInt16uWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeRangeRestrictedInt16uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeRangeRestrictedInt16uID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeRangeRestrictedInt16sWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeRangeRestrictedInt16sID) + params:params]; +} + +- (void)writeAttributeRangeRestrictedInt16sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeRangeRestrictedInt16sWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeRangeRestrictedInt16sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeRangeRestrictedInt16sID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeListLongOctetStringWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeListLongOctetStringID) + params:params]; +} + +- (void)writeAttributeListLongOctetStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeListLongOctetStringWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeListLongOctetStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeListLongOctetStringID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeListFabricScopedWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeListFabricScopedID) + params:params]; +} + +- (void)writeAttributeListFabricScopedWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeListFabricScopedWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeListFabricScopedWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeListFabricScopedID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeTimedWriteBooleanWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeTimedWriteBooleanID) + params:params]; +} + +- (void)writeAttributeTimedWriteBooleanWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeTimedWriteBooleanWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeTimedWriteBooleanWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeTimedWriteBooleanID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeGeneralErrorBooleanWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeGeneralErrorBooleanID) + params:params]; +} + +- (void)writeAttributeGeneralErrorBooleanWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeGeneralErrorBooleanWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeGeneralErrorBooleanWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeGeneralErrorBooleanID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeClusterErrorBooleanWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeClusterErrorBooleanID) + params:params]; +} + +- (void)writeAttributeClusterErrorBooleanWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeClusterErrorBooleanWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeClusterErrorBooleanWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeClusterErrorBooleanID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeUnsupportedWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeUnsupportedID) + params:params]; +} + +- (void)writeAttributeUnsupportedWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeUnsupportedWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeUnsupportedWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeUnsupportedID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeNullableBooleanWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableBooleanID) + params:params]; +} + +- (void)writeAttributeNullableBooleanWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableBooleanWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNullableBooleanWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableBooleanID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeNullableBitmap8WithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableBitmap8ID) + params:params]; +} + +- (void)writeAttributeNullableBitmap8WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableBitmap8WithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNullableBitmap8WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableBitmap8ID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeNullableBitmap16WithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableBitmap16ID) + params:params]; +} + +- (void)writeAttributeNullableBitmap16WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableBitmap16WithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNullableBitmap16WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableBitmap16ID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeNullableBitmap32WithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableBitmap32ID) + params:params]; +} + +- (void)writeAttributeNullableBitmap32WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableBitmap32WithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNullableBitmap32WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableBitmap32ID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeNullableBitmap64WithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableBitmap64ID) + params:params]; +} + +- (void)writeAttributeNullableBitmap64WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableBitmap64WithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNullableBitmap64WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableBitmap64ID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeNullableInt8uWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableInt8uID) + params:params]; +} + +- (void)writeAttributeNullableInt8uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableInt8uWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNullableInt8uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableInt8uID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeNullableInt16uWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableInt16uID) + params:params]; +} + +- (void)writeAttributeNullableInt16uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableInt16uWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNullableInt16uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableInt16uID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeNullableInt24uWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableInt24uID) + params:params]; +} + +- (void)writeAttributeNullableInt24uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableInt24uWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNullableInt24uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableInt24uID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeNullableInt32uWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableInt32uID) + params:params]; +} + +- (void)writeAttributeNullableInt32uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableInt32uWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNullableInt32uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableInt32uID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeNullableInt40uWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableInt40uID) + params:params]; +} + +- (void)writeAttributeNullableInt40uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableInt40uWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNullableInt40uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableInt40uID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeNullableInt48uWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableInt48uID) + params:params]; +} + +- (void)writeAttributeNullableInt48uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableInt48uWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNullableInt48uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableInt48uID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeNullableInt56uWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableInt56uID) + params:params]; +} + +- (void)writeAttributeNullableInt56uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableInt56uWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNullableInt56uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableInt56uID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeNullableInt64uWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableInt64uID) + params:params]; +} + +- (void)writeAttributeNullableInt64uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableInt64uWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNullableInt64uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableInt64uID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeNullableInt8sWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableInt8sID) + params:params]; +} + +- (void)writeAttributeNullableInt8sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableInt8sWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNullableInt8sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableInt8sID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeNullableInt16sWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableInt16sID) + params:params]; +} + +- (void)writeAttributeNullableInt16sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableInt16sWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNullableInt16sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableInt16sID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeNullableInt24sWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableInt24sID) + params:params]; +} + +- (void)writeAttributeNullableInt24sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableInt24sWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNullableInt24sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableInt24sID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeNullableInt32sWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableInt32sID) + params:params]; +} + +- (void)writeAttributeNullableInt32sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableInt32sWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNullableInt32sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableInt32sID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeNullableInt40sWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableInt40sID) + params:params]; +} + +- (void)writeAttributeNullableInt40sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableInt40sWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNullableInt40sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableInt40sID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeNullableInt48sWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableInt48sID) + params:params]; +} + +- (void)writeAttributeNullableInt48sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableInt48sWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNullableInt48sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableInt48sID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeNullableInt56sWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableInt56sID) + params:params]; +} + +- (void)writeAttributeNullableInt56sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableInt56sWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNullableInt56sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableInt56sID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeNullableInt64sWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableInt64sID) + params:params]; +} + +- (void)writeAttributeNullableInt64sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableInt64sWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNullableInt64sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableInt64sID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeNullableEnum8WithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableEnum8ID) + params:params]; +} + +- (void)writeAttributeNullableEnum8WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableEnum8WithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNullableEnum8WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableEnum8ID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeNullableEnum16WithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableEnum16ID) + params:params]; +} + +- (void)writeAttributeNullableEnum16WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableEnum16WithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNullableEnum16WithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableEnum16ID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeNullableFloatSingleWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableFloatSingleID) + params:params]; +} + +- (void)writeAttributeNullableFloatSingleWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableFloatSingleWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNullableFloatSingleWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableFloatSingleID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeNullableFloatDoubleWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableFloatDoubleID) + params:params]; +} + +- (void)writeAttributeNullableFloatDoubleWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableFloatDoubleWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNullableFloatDoubleWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableFloatDoubleID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeNullableOctetStringWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableOctetStringID) + params:params]; +} + +- (void)writeAttributeNullableOctetStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableOctetStringWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNullableOctetStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableOctetStringID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeNullableCharStringWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableCharStringID) + params:params]; +} + +- (void)writeAttributeNullableCharStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableCharStringWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNullableCharStringWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableCharStringID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeNullableEnumAttrWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableEnumAttrID) + params:params]; +} + +- (void)writeAttributeNullableEnumAttrWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableEnumAttrWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNullableEnumAttrWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableEnumAttrID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeNullableStructWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableStructID) + params:params]; +} + +- (void)writeAttributeNullableStructWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableStructWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNullableStructWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableStructID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeNullableRangeRestrictedInt8uWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableRangeRestrictedInt8uID) + params:params]; +} + +- (void)writeAttributeNullableRangeRestrictedInt8uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableRangeRestrictedInt8uWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeNullableRangeRestrictedInt8uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableRangeRestrictedInt8uID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeNullableRangeRestrictedInt8sWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableRangeRestrictedInt8sID) + params:params]; +} + +- (void)writeAttributeNullableRangeRestrictedInt8sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableRangeRestrictedInt8sWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeNullableRangeRestrictedInt8sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableRangeRestrictedInt8sID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeNullableRangeRestrictedInt16uWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableRangeRestrictedInt16uID) + params:params]; +} + +- (void)writeAttributeNullableRangeRestrictedInt16uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableRangeRestrictedInt16uWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeNullableRangeRestrictedInt16uWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableRangeRestrictedInt16uID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeNullableRangeRestrictedInt16sWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableRangeRestrictedInt16sID) + params:params]; +} + +- (void)writeAttributeNullableRangeRestrictedInt16sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableRangeRestrictedInt16sWithValue:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + params:nil]; +} +- (void)writeAttributeNullableRangeRestrictedInt16sWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * waitTimeInMs = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeNullableRangeRestrictedInt16sID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:waitTimeInMs]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointId:@(_endpoint) + clusterId:@(MTRClusterTestClusterID) + attributeId:@(MTRClusterTestClusterAttributeClusterRevisionID) + params:params]; +} + +@end + +// NOLINTEND(clang-analyzer-cplusplus.NewDeleteLeaks) diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters_internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters_internal.h new file mode 100644 index 00000000000000..40e9861d3abb0b --- /dev/null +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters_internal.h @@ -0,0 +1,352 @@ +/* + * + * 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 + +#import +#import + +#import "MTRClusters.h" +#import "MTRDevice.h" +#import "MTRDevice_Internal.h" + +#include + +@interface MTRClusterIdentify () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterGroups () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterScenes () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterOnOff () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterOnOffSwitchConfiguration () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterLevelControl () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterBinaryInputBasic () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterDescriptor () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterBinding () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterAccessControl () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterBridgedActions () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterBasic () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterOtaSoftwareUpdateProvider () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterOtaSoftwareUpdateRequestor () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterLocalizationConfiguration () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterTimeFormatLocalization () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterUnitLocalization () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterPowerSourceConfiguration () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterPowerSource () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterGeneralCommissioning () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterNetworkCommissioning () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterDiagnosticLogs () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterGeneralDiagnostics () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterSoftwareDiagnostics () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterThreadNetworkDiagnostics () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterWiFiNetworkDiagnostics () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterEthernetNetworkDiagnostics () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterBridgedDeviceBasic () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterSwitch () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterAdministratorCommissioning () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterOperationalCredentials () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterGroupKeyManagement () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterFixedLabel () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterUserLabel () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterBooleanState () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterModeSelect () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterDoorLock () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterWindowCovering () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterBarrierControl () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterPumpConfigurationAndControl () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterThermostat () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterFanControl () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterThermostatUserInterfaceConfiguration () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterColorControl () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterBallastConfiguration () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterIlluminanceMeasurement () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterTemperatureMeasurement () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterPressureMeasurement () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterFlowMeasurement () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterRelativeHumidityMeasurement () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterOccupancySensing () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterWakeOnLan () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterChannel () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterTargetNavigator () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterMediaPlayback () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterMediaInput () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterLowPower () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterKeypadInput () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterContentLauncher () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterAudioOutput () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterApplicationLauncher () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterApplicationBasic () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterAccountLogin () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterElectricalMeasurement () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + +@interface MTRClusterTestCluster () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end diff --git a/src/darwin/Framework/CHIPTests/MTRAsyncCallbackQueueTests.m b/src/darwin/Framework/CHIPTests/MTRAsyncCallbackQueueTests.m new file mode 100644 index 00000000000000..8467f792c1f344 --- /dev/null +++ b/src/darwin/Framework/CHIPTests/MTRAsyncCallbackQueueTests.m @@ -0,0 +1,149 @@ +/** + * 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. + */ + +#import + +// system dependencies +#import + +#import "MTRAsyncCallbackWorkQueue_Internal.h" + +@interface MTRAsyncCallbackQueueTests : XCTestCase + +@end + +@implementation MTRAsyncCallbackQueueTests + +- (void)testRunItem +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Work item called"]; + + MTRAsyncCallbackWorkQueue * workQueue = [[MTRAsyncCallbackWorkQueue alloc] initWithContext:nil queue:dispatch_get_main_queue()]; + + MTRAsyncCallbackQueueWorkItem * workItem1 = + [[MTRAsyncCallbackQueueWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; + __block int counter = 0; + MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * _Nonnull device, NSUInteger retryCount) { + counter++; + [expectation fulfill]; + [workItem1 endWork]; + }; + workItem1.readyHandler = readyHandler; + workItem1.cancelHandler = ^{ + }; + [workQueue enqueueWorkItem:workItem1]; + + [self waitForExpectationsWithTimeout:5 handler:nil]; + + // see that it only ran once + XCTAssertEqual(counter, 1); +} + +- (void)testRunItemsSerialized +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Work item called in order"]; + + MTRAsyncCallbackWorkQueue * workQueue = [[MTRAsyncCallbackWorkQueue alloc] initWithContext:nil queue:dispatch_get_main_queue()]; + + MTRAsyncCallbackQueueWorkItem * workItem1 = + [[MTRAsyncCallbackQueueWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; + __block int counter = 0; + MTRAsyncCallbackReadyHandler readyHandler1 = ^(MTRDevice * _Nonnull device, NSUInteger retryCount) { + NSLog(@"Item 1 called with counter %d", counter); + sleep(1); + counter++; + NSLog(@"Item 1 woke after sleep with counter %d", counter); + [workItem1 endWork]; + }; + workItem1.readyHandler = readyHandler1; + workItem1.cancelHandler = ^{ + }; + [workQueue enqueueWorkItem:workItem1]; + + MTRAsyncCallbackQueueWorkItem * workItem2 = + [[MTRAsyncCallbackQueueWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; + MTRAsyncCallbackReadyHandler readyHandler2 = ^(MTRDevice * _Nonnull device, NSUInteger retryCount) { + // expect this to have waited until workItem1's sleep(1) finished and incremented counter + NSLog(@"Item 2 called with counter %d", counter); + if (counter == 1) { + [expectation fulfill]; + } + [workItem2 endWork]; + }; + workItem2.readyHandler = readyHandler2; + workItem2.cancelHandler = ^{ + }; + [workQueue enqueueWorkItem:workItem2]; + + NSLog(@"2Items start wait %@", [NSDate date]); + [self waitForExpectationsWithTimeout:5 handler:nil]; + NSLog(@"2Items finished wait %@", [NSDate date]); + + // see that workItem1 only ran once + XCTAssertEqual(counter, 1); +} + +- (void)testRunItemsRetry +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Work item called in order"]; + + MTRAsyncCallbackWorkQueue * workQueue = [[MTRAsyncCallbackWorkQueue alloc] initWithContext:nil queue:dispatch_get_main_queue()]; + + MTRAsyncCallbackQueueWorkItem * workItem1 = + [[MTRAsyncCallbackQueueWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; + __block int counter = 0; + MTRAsyncCallbackReadyHandler readyHandler1 = ^(MTRDevice * _Nonnull device, NSUInteger retryCount) { + NSLog(@"Item 1 called with counter %d retryCount %lu", counter, (unsigned long) retryCount); + sleep(1); + counter++; + NSLog(@"Item 1 woke after sleep with counter %d", counter); + + if (retryCount) { + // only end after retried once + [workItem1 endWork]; + } else { + [workItem1 retryWork]; + } + }; + workItem1.readyHandler = readyHandler1; + workItem1.cancelHandler = ^{ + }; + [workQueue enqueueWorkItem:workItem1]; + + MTRAsyncCallbackQueueWorkItem * workItem2 = + [[MTRAsyncCallbackQueueWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; + MTRAsyncCallbackReadyHandler readyHandler2 = ^(MTRDevice * _Nonnull device, NSUInteger retryCount) { + // expect this to have waited until workItem1's sleep(1) finished and incremented counter twice + NSLog(@"Item 2 called with counter %d", counter); + if (counter == 2) { + [expectation fulfill]; + } + [workItem2 endWork]; + }; + workItem2.readyHandler = readyHandler2; + workItem2.cancelHandler = ^{ + }; + [workQueue enqueueWorkItem:workItem2]; + + NSLog(@"2Items start wait %@", [NSDate date]); + [self waitForExpectationsWithTimeout:5 handler:nil]; + NSLog(@"2Items finished wait %@", [NSDate date]); + + // see that workItem1 ran twice after the retry + XCTAssertEqual(counter, 2); +} + +@end diff --git a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m index ee9e61a22d06c9..60e732f125524c 100644 --- a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m +++ b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m @@ -1249,7 +1249,7 @@ - (void)testSignedInteger NSLog(@"Conversion input: %@\nOutput: %@", input, output); XCTAssertNotNil(output); XCTAssertTrue([output isKindOfClass:[NSDictionary class]]); - XCTAssertTrue([output isEqualTo:input]); + XCTAssertTrue([output isEqual:input]); } - (void)testSignedInteger64Bits @@ -1260,7 +1260,7 @@ - (void)testSignedInteger64Bits NSLog(@"Conversion input: %@\nOutput: %@", input, output); XCTAssertNotNil(output); XCTAssertTrue([output isKindOfClass:[NSDictionary class]]); - XCTAssertTrue([output isEqualTo:input]); + XCTAssertTrue([output isEqual:input]); } - (void)testUnsignedInteger @@ -1271,7 +1271,7 @@ - (void)testUnsignedInteger NSLog(@"Conversion input: %@\nOutput: %@", input, output); XCTAssertNotNil(output); XCTAssertTrue([output isKindOfClass:[NSDictionary class]]); - XCTAssertTrue([output isEqualTo:input]); + XCTAssertTrue([output isEqual:input]); } - (void)testUnsignedInteger64Bits @@ -1282,7 +1282,7 @@ - (void)testUnsignedInteger64Bits NSLog(@"Conversion input: %@\nOutput: %@", input, output); XCTAssertNotNil(output); XCTAssertTrue([output isKindOfClass:[NSDictionary class]]); - XCTAssertTrue([output isEqualTo:input]); + XCTAssertTrue([output isEqual:input]); } - (void)testBoolean @@ -1293,7 +1293,7 @@ - (void)testBoolean NSLog(@"Conversion input: %@\nOutput: %@", input, output); XCTAssertNotNil(output); XCTAssertTrue([output isKindOfClass:[NSDictionary class]]); - XCTAssertTrue([output isEqualTo:input]); + XCTAssertTrue([output isEqual:input]); } - (void)testUTF8String @@ -1303,7 +1303,7 @@ - (void)testUTF8String NSLog(@"Conversion input: %@\nOutput: %@", input, output); XCTAssertNotNil(output); XCTAssertTrue([output isKindOfClass:[NSDictionary class]]); - XCTAssertTrue([output isEqualTo:input]); + XCTAssertTrue([output isEqual:input]); } - (void)testOctetString @@ -1315,7 +1315,7 @@ - (void)testOctetString NSLog(@"Conversion input: %@\nOutput: %@", input, output); XCTAssertNotNil(output); XCTAssertTrue([output isKindOfClass:[NSDictionary class]]); - XCTAssertTrue([output isEqualTo:input]); + XCTAssertTrue([output isEqual:input]); } - (void)testFloat @@ -1349,7 +1349,7 @@ - (void)testNull NSLog(@"Conversion input: %@\nOutput: %@", input, output); XCTAssertNotNil(output); XCTAssertTrue([output isKindOfClass:[NSDictionary class]]); - XCTAssertTrue([output isEqualTo:input]); + XCTAssertTrue([output isEqual:input]); } - (void)testStructure @@ -1371,7 +1371,7 @@ - (void)testStructure XCTAssertNotNil(output); XCTAssertTrue([output isKindOfClass:[NSDictionary class]]); - XCTAssertTrue([output isEqualTo:inputValue]); + XCTAssertTrue([output isEqual:inputValue]); } - (void)testArray @@ -1385,7 +1385,7 @@ - (void)testArray NSLog(@"Conversion input: %@\nOutput: %@", inputValue, output); XCTAssertNotNil(output); XCTAssertTrue([output isKindOfClass:[NSDictionary class]]); - XCTAssertTrue([output isEqualTo:inputValue]); + XCTAssertTrue([output isEqual:inputValue]); } @end diff --git a/src/darwin/Framework/CHIPTests/MTRXPCProtocolTests.m b/src/darwin/Framework/CHIPTests/MTRXPCProtocolTests.m index c029f9479b7dd2..3b93b4e046ba01 100644 --- a/src/darwin/Framework/CHIPTests/MTRXPCProtocolTests.m +++ b/src/darwin/Framework/CHIPTests/MTRXPCProtocolTests.m @@ -378,7 +378,7 @@ - (void)testReadAttributeSuccess NSLog(@"Read value: %@", value); XCTAssertNotNil(value); XCTAssertNil(error); - XCTAssertTrue([myValues isEqualTo:value]); + XCTAssertTrue([myValues isEqual:value]); [responseExpectation fulfill]; self.xpcDisconnectExpectation = [self expectationWithDescription:@"XPC Disconnected"]; @@ -440,7 +440,7 @@ - (void)testReadAttributeWithParamsSuccess NSLog(@"Read value: %@", value); XCTAssertNotNil(value); XCTAssertNil(error); - XCTAssertTrue([myValues isEqualTo:value]); + XCTAssertTrue([myValues isEqual:value]); [responseExpectation fulfill]; self.xpcDisconnectExpectation = [self expectationWithDescription:@"XPC Disconnected"]; @@ -531,7 +531,7 @@ - (void)testWriteAttributeSuccess XCTAssertEqual([endpointId unsignedShortValue], [myEndpointId unsignedShortValue]); XCTAssertEqual([clusterId unsignedLongValue], [myClusterId unsignedLongValue]); XCTAssertEqual([attributeId unsignedLongValue], [myAttributeId unsignedLongValue]); - XCTAssertTrue([value isEqualTo:myValue]); + XCTAssertTrue([value isEqual:myValue]); XCTAssertNil(timedWriteTimeout); [callExpectation fulfill]; completion([MTRDeviceController encodeXPCResponseValues:myResults], nil); @@ -553,7 +553,7 @@ - (void)testWriteAttributeSuccess NSLog(@"Write response: %@", value); XCTAssertNotNil(value); XCTAssertNil(error); - XCTAssertTrue([myResults isEqualTo:value]); + XCTAssertTrue([myResults isEqual:value]); [responseExpectation fulfill]; self.xpcDisconnectExpectation = [self expectationWithDescription:@"XPC Disconnected"]; @@ -593,7 +593,7 @@ - (void)testTimedWriteAttributeSuccess XCTAssertEqual([endpointId unsignedShortValue], [myEndpointId unsignedShortValue]); XCTAssertEqual([clusterId unsignedLongValue], [myClusterId unsignedLongValue]); XCTAssertEqual([attributeId unsignedLongValue], [myAttributeId unsignedLongValue]); - XCTAssertTrue([value isEqualTo:myValue]); + XCTAssertTrue([value isEqual:myValue]); XCTAssertNotNil(timedWriteTimeout); XCTAssertEqual([timedWriteTimeout unsignedShortValue], [myTimedWriteTimeout unsignedShortValue]); [callExpectation fulfill]; @@ -616,7 +616,7 @@ - (void)testTimedWriteAttributeSuccess NSLog(@"Write response: %@", value); XCTAssertNotNil(value); XCTAssertNil(error); - XCTAssertTrue([myResults isEqualTo:value]); + XCTAssertTrue([myResults isEqual:value]); [responseExpectation fulfill]; self.xpcDisconnectExpectation = [self expectationWithDescription:@"XPC Disconnected"]; @@ -650,7 +650,7 @@ - (void)testWriteAttributeFailure XCTAssertEqual([endpointId unsignedShortValue], [myEndpointId unsignedShortValue]); XCTAssertEqual([clusterId unsignedLongValue], [myClusterId unsignedLongValue]); XCTAssertEqual([attributeId unsignedLongValue], [myAttributeId unsignedLongValue]); - XCTAssertTrue([value isEqualTo:myValue]); + XCTAssertTrue([value isEqual:myValue]); XCTAssertNil(timedWriteTimeout); [callExpectation fulfill]; completion(nil, myError); @@ -710,7 +710,7 @@ - (void)testInvokeCommandSuccess XCTAssertEqual([endpointId unsignedShortValue], [myEndpointId unsignedShortValue]); XCTAssertEqual([clusterId unsignedLongValue], [myClusterId unsignedLongValue]); XCTAssertEqual([commandId unsignedLongValue], [myCommandId unsignedLongValue]); - XCTAssertTrue([commandFields isEqualTo:myFields]); + XCTAssertTrue([commandFields isEqual:myFields]); XCTAssertNil(timedInvokeTimeout); [callExpectation fulfill]; completion([MTRDeviceController encodeXPCResponseValues:myResults], nil); @@ -732,7 +732,7 @@ - (void)testInvokeCommandSuccess NSLog(@"Command response: %@", value); XCTAssertNotNil(value); XCTAssertNil(error); - XCTAssertTrue([myResults isEqualTo:value]); + XCTAssertTrue([myResults isEqual:value]); [responseExpectation fulfill]; self.xpcDisconnectExpectation = [self expectationWithDescription:@"XPC Disconnected"]; @@ -772,7 +772,7 @@ - (void)testTimedInvokeCommandSuccess XCTAssertEqual([endpointId unsignedShortValue], [myEndpointId unsignedShortValue]); XCTAssertEqual([clusterId unsignedLongValue], [myClusterId unsignedLongValue]); XCTAssertEqual([commandId unsignedLongValue], [myCommandId unsignedLongValue]); - XCTAssertTrue([commandFields isEqualTo:myFields]); + XCTAssertTrue([commandFields isEqual:myFields]); XCTAssertNotNil(timedInvokeTimeout); XCTAssertEqual([timedInvokeTimeout unsignedShortValue], [myTimedInvokeTimeout unsignedShortValue]); [callExpectation fulfill]; @@ -795,7 +795,7 @@ - (void)testTimedInvokeCommandSuccess NSLog(@"Command response: %@", value); XCTAssertNotNil(value); XCTAssertNil(error); - XCTAssertTrue([myResults isEqualTo:value]); + XCTAssertTrue([myResults isEqual:value]); [responseExpectation fulfill]; self.xpcDisconnectExpectation = [self expectationWithDescription:@"XPC Disconnected"]; @@ -832,7 +832,7 @@ - (void)testInvokeCommandFailure XCTAssertEqual([endpointId unsignedShortValue], [myEndpointId unsignedShortValue]); XCTAssertEqual([clusterId unsignedLongValue], [myClusterId unsignedLongValue]); XCTAssertEqual([commandId unsignedLongValue], [myCommandId unsignedLongValue]); - XCTAssertTrue([commandFields isEqualTo:myFields]); + XCTAssertTrue([commandFields isEqual:myFields]); XCTAssertNil(timedInvokeTimeout); [callExpectation fulfill]; completion(nil, myError); @@ -921,7 +921,7 @@ - (void)testSubscribeAttributeSuccess NSLog(@"Report value: %@", values); XCTAssertNotNil(values); XCTAssertNil(error); - XCTAssertTrue([myReport isEqualTo:values]); + XCTAssertTrue([myReport isEqual:values]); [reportExpectation fulfill]; } subscriptionEstablished:^{ @@ -1041,7 +1041,7 @@ - (void)testSubscribeAttributeWithParamsSuccess NSLog(@"Report value: %@", values); XCTAssertNotNil(values); XCTAssertNil(error); - XCTAssertTrue([myReport isEqualTo:values]); + XCTAssertTrue([myReport isEqual:values]); [reportExpectation fulfill]; } subscriptionEstablished:^{ @@ -1156,7 +1156,7 @@ - (void)testBadlyFormattedReport NSLog(@"Report value: %@", values); XCTAssertNotNil(values); XCTAssertNil(error); - XCTAssertTrue([myReport isEqualTo:values]); + XCTAssertTrue([myReport isEqual:values]); [reportExpectation fulfill]; } subscriptionEstablished:^{ @@ -1270,7 +1270,7 @@ - (void)testReportWithUnrelatedEndpointId NSLog(@"Report value: %@", values); XCTAssertNotNil(values); XCTAssertNil(error); - XCTAssertTrue([myReport isEqualTo:values]); + XCTAssertTrue([myReport isEqual:values]); [reportExpectation fulfill]; } subscriptionEstablished:^{ @@ -1386,7 +1386,7 @@ - (void)testReportWithUnrelatedClusterId NSLog(@"Report value: %@", values); XCTAssertNotNil(values); XCTAssertNil(error); - XCTAssertTrue([myReport isEqualTo:values]); + XCTAssertTrue([myReport isEqual:values]); [reportExpectation fulfill]; } subscriptionEstablished:^{ @@ -1502,7 +1502,7 @@ - (void)testReportWithUnrelatedAttributeId NSLog(@"Report value: %@", values); XCTAssertNotNil(values); XCTAssertNil(error); - XCTAssertTrue([myReport isEqualTo:values]); + XCTAssertTrue([myReport isEqual:values]); [reportExpectation fulfill]; } subscriptionEstablished:^{ @@ -1618,7 +1618,7 @@ - (void)testReportWithUnrelatedNode NSLog(@"Report value: %@", values); XCTAssertNotNil(values); XCTAssertNil(error); - XCTAssertTrue([myReport isEqualTo:values]); + XCTAssertTrue([myReport isEqual:values]); [reportExpectation fulfill]; } subscriptionEstablished:^{ @@ -1733,7 +1733,7 @@ - (void)testSubscribeMultiEndpoints NSLog(@"Report value: %@", values); XCTAssertNotNil(values); XCTAssertNil(error); - XCTAssertTrue([myReport isEqualTo:values]); + XCTAssertTrue([myReport isEqual:values]); [reportExpectation fulfill]; } subscriptionEstablished:^{ @@ -1848,7 +1848,7 @@ - (void)testSubscribeMultiClusters NSLog(@"Report value: %@", values); XCTAssertNotNil(values); XCTAssertNil(error); - XCTAssertTrue([myReport isEqualTo:values]); + XCTAssertTrue([myReport isEqual:values]); [reportExpectation fulfill]; } subscriptionEstablished:^{ @@ -1963,7 +1963,7 @@ - (void)testSubscribeMultiAttributes NSLog(@"Report value: %@", values); XCTAssertNotNil(values); XCTAssertNil(error); - XCTAssertTrue([myReport isEqualTo:values]); + XCTAssertTrue([myReport isEqual:values]); [reportExpectation fulfill]; } subscriptionEstablished:^{ @@ -2089,7 +2089,7 @@ - (void)testMutiSubscriptions NSLog(@"Subscriber [%d] report value: %@", i, values); XCTAssertNotNil(values); XCTAssertNil(error); - XCTAssertTrue([myReports[i] isEqualTo:values]); + XCTAssertTrue([myReports[i] isEqual:values]); [reportExpectations[i] fulfill]; } subscriptionEstablished:^{ @@ -2452,7 +2452,7 @@ - (void)testReadAttributeCacheSuccess NSLog(@"Read cached value: %@", values); XCTAssertNotNil(values); XCTAssertNil(error); - XCTAssertTrue([myValues isEqualTo:values]); + XCTAssertTrue([myValues isEqual:values]); [responseExpectation fulfill]; }]; [self waitForExpectations:@[ callExpectation, responseExpectation, _xpcDisconnectExpectation ] timeout:kTimeoutInSeconds]; diff --git a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj index df60f6d6756f34..8ba1247ae7ce0e 100644 --- a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj @@ -81,6 +81,17 @@ 754F3DF427FBB94B00E60580 /* MTREventTLVValueDecoder_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 754F3DF327FBB94B00E60580 /* MTREventTLVValueDecoder_Internal.h */; }; 7560FD1C27FBBD3F005E85B3 /* MTREventTLVValueDecoder.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7560FD1B27FBBD3F005E85B3 /* MTREventTLVValueDecoder.mm */; }; 7596A83E28751220004DAE0E /* MTRBaseClusters_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 7596A83D28751220004DAE0E /* MTRBaseClusters_internal.h */; }; + 7596A84428762729004DAE0E /* MTRDevice.h in Headers */ = {isa = PBXBuildFile; fileRef = 7596A84228762729004DAE0E /* MTRDevice.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 7596A84528762729004DAE0E /* MTRDevice.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7596A84328762729004DAE0E /* MTRDevice.mm */; }; + 7596A84828762783004DAE0E /* MTRAsyncCallbackWorkQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 7596A84628762783004DAE0E /* MTRAsyncCallbackWorkQueue.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 7596A84928762783004DAE0E /* MTRAsyncCallbackWorkQueue.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7596A84728762783004DAE0E /* MTRAsyncCallbackWorkQueue.mm */; }; + 7596A84B287636C1004DAE0E /* MTRDevice_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 7596A84A287636C1004DAE0E /* MTRDevice_Internal.h */; }; + 7596A84D287782EF004DAE0E /* MTRAsyncCallbackWorkQueue_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 7596A84C287782E8004DAE0E /* MTRAsyncCallbackWorkQueue_Internal.h */; }; + 7596A84F2877E6A9004DAE0E /* MTRCluster_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 7596A84E2877E6A9004DAE0E /* MTRCluster_internal.h */; }; + 7596A8512878709F004DAE0E /* MTRAsyncCallbackQueueTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 7596A8502878709F004DAE0E /* MTRAsyncCallbackQueueTests.m */; }; + 7596A85528788557004DAE0E /* MTRClusters.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7596A85228788557004DAE0E /* MTRClusters.mm */; }; + 7596A85628788557004DAE0E /* MTRClustersObjc_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 7596A85328788557004DAE0E /* MTRClustersObjc_internal.h */; }; + 7596A85728788557004DAE0E /* MTRClusters.h in Headers */ = {isa = PBXBuildFile; fileRef = 7596A85428788557004DAE0E /* MTRClusters.h */; settings = {ATTRIBUTES = (Public, ); }; }; 88EBF8CE27FABDD500686BC1 /* MTRDeviceAttestationDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 88EBF8CB27FABDD500686BC1 /* MTRDeviceAttestationDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; 88EBF8CF27FABDD500686BC1 /* MTRDeviceAttestationDelegateBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = 88EBF8CC27FABDD500686BC1 /* MTRDeviceAttestationDelegateBridge.mm */; }; 88EBF8D027FABDD500686BC1 /* MTRDeviceAttestationDelegateBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 88EBF8CD27FABDD500686BC1 /* MTRDeviceAttestationDelegateBridge.h */; }; @@ -203,6 +214,17 @@ 754F3DF327FBB94B00E60580 /* MTREventTLVValueDecoder_Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTREventTLVValueDecoder_Internal.h; sourceTree = ""; }; 7560FD1B27FBBD3F005E85B3 /* MTREventTLVValueDecoder.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MTREventTLVValueDecoder.mm; path = "zap-generated/MTREventTLVValueDecoder.mm"; sourceTree = ""; }; 7596A83D28751220004DAE0E /* MTRBaseClusters_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MTRBaseClusters_internal.h; path = "zap-generated/MTRBaseClusters_internal.h"; sourceTree = ""; }; + 7596A84228762729004DAE0E /* MTRDevice.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRDevice.h; sourceTree = ""; }; + 7596A84328762729004DAE0E /* MTRDevice.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRDevice.mm; sourceTree = ""; }; + 7596A84628762783004DAE0E /* MTRAsyncCallbackWorkQueue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRAsyncCallbackWorkQueue.h; sourceTree = ""; }; + 7596A84728762783004DAE0E /* MTRAsyncCallbackWorkQueue.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRAsyncCallbackWorkQueue.mm; sourceTree = ""; }; + 7596A84A287636C1004DAE0E /* MTRDevice_Internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRDevice_Internal.h; sourceTree = ""; }; + 7596A84C287782E8004DAE0E /* MTRAsyncCallbackWorkQueue_Internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRAsyncCallbackWorkQueue_Internal.h; sourceTree = ""; }; + 7596A84E2877E6A9004DAE0E /* MTRCluster_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRCluster_internal.h; sourceTree = ""; }; + 7596A8502878709F004DAE0E /* MTRAsyncCallbackQueueTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MTRAsyncCallbackQueueTests.m; sourceTree = ""; }; + 7596A85228788557004DAE0E /* MTRClusters.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MTRClusters.mm; path = "zap-generated/MTRClusters.mm"; sourceTree = ""; }; + 7596A85328788557004DAE0E /* MTRClustersObjc_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MTRClustersObjc_internal.h; path = "zap-generated/MTRClustersObjc_internal.h"; sourceTree = ""; }; + 7596A85428788557004DAE0E /* MTRClusters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MTRClusters.h; path = "zap-generated/MTRClusters.h"; sourceTree = ""; }; 88EBF8CB27FABDD500686BC1 /* MTRDeviceAttestationDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRDeviceAttestationDelegate.h; sourceTree = ""; }; 88EBF8CC27FABDD500686BC1 /* MTRDeviceAttestationDelegateBridge.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRDeviceAttestationDelegateBridge.mm; sourceTree = ""; }; 88EBF8CD27FABDD500686BC1 /* MTRDeviceAttestationDelegateBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRDeviceAttestationDelegateBridge.h; sourceTree = ""; }; @@ -292,6 +314,9 @@ 1EC4CE6325CC276600D7304F /* MTRBaseClusters.h */, 1EC4CE5925CC26E900D7304F /* MTRBaseClusters.mm */, 7596A83D28751220004DAE0E /* MTRBaseClusters_internal.h */, + 7596A85428788557004DAE0E /* MTRClusters.h */, + 7596A85228788557004DAE0E /* MTRClusters.mm */, + 7596A85328788557004DAE0E /* MTRClustersObjc_internal.h */, D4772A45285AE98300383630 /* MTRClusterConstants.h */, ); name = CHIPGeneratedFiles; @@ -329,6 +354,7 @@ 88EBF8CC27FABDD500686BC1 /* MTRDeviceAttestationDelegateBridge.mm */, 513DDB852761F69300DAA01A /* MTRAttributeTLVValueDecoder_Internal.h */, 754F3DF327FBB94B00E60580 /* MTREventTLVValueDecoder_Internal.h */, + 7596A84E2877E6A9004DAE0E /* MTRCluster_internal.h */, 1ED276E326C5832500547A89 /* MTRCluster.h */, 1ED276E126C5812A00547A89 /* MTRCluster.mm */, 2C5EEEF4268A85C400CAE3D3 /* MTRDeviceConnectionBridge.h */, @@ -343,6 +369,12 @@ 2C222ADE255C811800E446B9 /* MTRBaseDevice_Internal.h */, 2C222ACE255C620600E446B9 /* MTRBaseDevice.h */, 2C222ACF255C620600E446B9 /* MTRBaseDevice.mm */, + 7596A84A287636C1004DAE0E /* MTRDevice_Internal.h */, + 7596A84228762729004DAE0E /* MTRDevice.h */, + 7596A84328762729004DAE0E /* MTRDevice.mm */, + 7596A84C287782E8004DAE0E /* MTRAsyncCallbackWorkQueue_Internal.h */, + 7596A84628762783004DAE0E /* MTRAsyncCallbackWorkQueue.h */, + 7596A84728762783004DAE0E /* MTRAsyncCallbackWorkQueue.mm */, 2C8C8FBE253E0C2100797F05 /* MTRPersistentStorageDelegate.h */, 5ACDDD7927CD129700EFD68A /* MTRAttributeCacheContainer.h */, 5A60370727EA1FF60020DB79 /* MTRAttributeCacheContainer+XPC.h */, @@ -423,6 +455,7 @@ B2F53AF1245B0DCF0010745E /* MTRSetupPayloadParserTests.m */, 997DED1926955D0200975E97 /* MTRThreadOperationalDatasetTests.mm */, 517BF3F2282B62CB00A8B7DB /* MTRCertificateTests.m */, + 7596A8502878709F004DAE0E /* MTRAsyncCallbackQueueTests.m */, B202529D2459E34F00F97062 /* Info.plist */, ); path = CHIPTests; @@ -447,6 +480,7 @@ 517BF3F0282B62B800A8B7DB /* MTRCertificates.h in Headers */, 51E51FBF282AD37A00FC978D /* MTRDeviceControllerStartupParams.h in Headers */, 5136661628067D550025EDAE /* MTRControllerFactory.h in Headers */, + 7596A84B287636C1004DAE0E /* MTRDevice_Internal.h in Headers */, 5A6FEC9927B5C88900F25F42 /* MTRDeviceOverXPC.h in Headers */, 51B22C222740CB1D008D5055 /* MTRCommandPayloadsObjc.h in Headers */, 51B22C1E2740CB0A008D5055 /* MTRStructsObjc.h in Headers */, @@ -454,6 +488,7 @@ 5ACDDD7A27CD129700EFD68A /* MTRAttributeCacheContainer.h in Headers */, 5A6FEC9227B5669C00F25F42 /* MTRDeviceControllerOverXPC.h in Headers */, 2C1B027B2641DB4E00780EF1 /* MTROperationalCredentialsDelegate.h in Headers */, + 7596A85728788557004DAE0E /* MTRClusters.h in Headers */, 99D466E12798936D0089A18F /* MTRCommissioningParameters.h in Headers */, 5136661528067D550025EDAE /* MTRControllerFactory_Internal.h in Headers */, 515C1C70284F9FFB00A48F0C /* MTRMemory.h in Headers */, @@ -463,12 +498,15 @@ 2CB7163F252F731E0026E2BB /* MTRDevicePairingDelegate.h in Headers */, 88EBF8CE27FABDD500686BC1 /* MTRDeviceAttestationDelegate.h in Headers */, 2C222AD0255C620600E446B9 /* MTRBaseDevice.h in Headers */, + 7596A84F2877E6A9004DAE0E /* MTRCluster_internal.h in Headers */, 991DC0842475F45400C13860 /* MTRDeviceController.h in Headers */, AF1CB86E2874B03B00865A96 /* MTROTAProviderDelegate.h in Headers */, 754F3DF427FBB94B00E60580 /* MTREventTLVValueDecoder_Internal.h in Headers */, B2E0D7B2245B0B5C003C5B48 /* MTRManualSetupPayloadParser.h in Headers */, B2E0D7B1245B0B5C003C5B48 /* Matter.h in Headers */, + 7596A84428762729004DAE0E /* MTRDevice.h in Headers */, B2E0D7B8245B0B5C003C5B48 /* MTRSetupPayload.h in Headers */, + 7596A84D287782EF004DAE0E /* MTRAsyncCallbackWorkQueue_Internal.h in Headers */, 7596A83E28751220004DAE0E /* MTRBaseClusters_internal.h in Headers */, 997DED182695344800975E97 /* MTRThreadOperationalDataset.h in Headers */, 9956064426420367000C28DE /* MTRSetupPayload_Internal.h in Headers */, @@ -492,7 +530,9 @@ 998F286F26D55EC5001846C6 /* MTRP256KeypairBridge.h in Headers */, 2C222ADF255C811800E446B9 /* MTRBaseDevice_Internal.h in Headers */, 51E0310027EA20D20083DC9C /* MTRControllerAccessControl.h in Headers */, + 7596A85628788557004DAE0E /* MTRClustersObjc_internal.h in Headers */, 991DC08B247704DC00C13860 /* MTRLogging.h in Headers */, + 7596A84828762783004DAE0E /* MTRAsyncCallbackWorkQueue.h in Headers */, 5A7947E527C0129F00434CF2 /* MTRDeviceController+XPC.h in Headers */, B2E0D7B4245B0B5C003C5B48 /* MTRError_Internal.h in Headers */, 1EDCE545289049A100E41EC9 /* MTROTAHeaderParser.h in Headers */, @@ -654,12 +694,15 @@ 5112F606287CD2C100B827E7 /* privilege-storage.cpp in Sources */, 2C1B027A2641DB4E00780EF1 /* MTROperationalCredentialsDelegate.mm in Sources */, 7560FD1C27FBBD3F005E85B3 /* MTREventTLVValueDecoder.mm in Sources */, + 7596A84928762783004DAE0E /* MTRAsyncCallbackWorkQueue.mm in Sources */, B2E0D7B9245B0B5C003C5B48 /* MTRSetupPayload.mm in Sources */, B2E0D7B6245B0B5C003C5B48 /* MTRManualSetupPayloadParser.mm in Sources */, + 7596A85528788557004DAE0E /* MTRClusters.mm in Sources */, 88EBF8CF27FABDD500686BC1 /* MTRDeviceAttestationDelegateBridge.mm in Sources */, 5A6FEC9827B5C6AF00F25F42 /* MTRDeviceOverXPC.m in Sources */, 51431AF927D2973E008A7943 /* MTRIMDispatch.mm in Sources */, 51431AFB27D29CA4008A7943 /* ota-provider.cpp in Sources */, + 7596A84528762729004DAE0E /* MTRDevice.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -668,6 +711,7 @@ buildActionMask = 2147483647; files = ( 51D10D2E2808E2CA00E8CA3D /* MTRTestStorage.m in Sources */, + 7596A8512878709F004DAE0E /* MTRAsyncCallbackQueueTests.m in Sources */, 1EB41B7B263C4CC60048E4C1 /* MTRClustersTests.m in Sources */, 997DED1A26955D0200975E97 /* MTRThreadOperationalDatasetTests.mm in Sources */, 51C8E3F82825CDB600D47D00 /* MTRTestKeys.m in Sources */,