3 * Copyright (c) 2021 Project CHIP Authors
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 // THIS FILE IS GENERATED BY ZAP
20 #import <Foundation/Foundation.h>
22 #import "CHIPDevice.h"
23 #import "CHIPDevice_Internal.h"
25 #import "gen/CHIPClientCallbacks.h"
26 #import "gen/CHIPClustersObjc.h"
28 #include <controller/CHIPClusters.h>
29 #include <lib/support/Span.h>
31 using namespace ::chip;
33 class CHIPDefaultSuccessCallbackBridge : public Callback::Callback<DefaultSuccessCallback> {
35 CHIPDefaultSuccessCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
36 : Callback::Callback<DefaultSuccessCallback>(CallbackFn, this)
42 ~CHIPDefaultSuccessCallbackBridge() {};
44 static void CallbackFn(void * context)
46 CHIPDefaultSuccessCallbackBridge * callback = reinterpret_cast<CHIPDefaultSuccessCallbackBridge *>(context);
47 if (callback && callback->mQueue) {
48 dispatch_async(callback->mQueue, ^{
49 callback->mHandler(nil, nil);
57 ResponseHandler mHandler;
58 dispatch_queue_t mQueue;
61 class CHIPDefaultFailureCallbackBridge : public Callback::Callback<DefaultFailureCallback> {
63 CHIPDefaultFailureCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
64 : Callback::Callback<DefaultFailureCallback>(CallbackFn, this)
70 ~CHIPDefaultFailureCallbackBridge() {};
72 static void CallbackFn(void * context, uint8_t status)
74 CHIPDefaultFailureCallbackBridge * callback = reinterpret_cast<CHIPDefaultFailureCallbackBridge *>(context);
75 if (callback && callback->mQueue) {
76 dispatch_async(callback->mQueue, ^{
77 NSError * error = [NSError errorWithDomain:CHIPErrorDomain
79 userInfo:@ { NSLocalizedDescriptionKey : @"" }];
80 callback->mHandler(error, nil);
88 ResponseHandler mHandler;
89 dispatch_queue_t mQueue;
92 class CHIPStringAttributeCallbackBridge : public Callback::Callback<StringAttributeCallback> {
94 CHIPStringAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool octetString, bool keepAlive = false)
95 : Callback::Callback<StringAttributeCallback>(CallbackFn, this)
98 , mOctetString(octetString)
99 , mKeepAlive(keepAlive)
103 ~CHIPStringAttributeCallbackBridge() {};
105 static void CallbackFn(void * context, chip::ByteSpan value)
107 CHIPStringAttributeCallbackBridge * callback = reinterpret_cast<CHIPStringAttributeCallbackBridge *>(context);
108 if (callback && callback->mQueue) {
109 dispatch_async(callback->mQueue, ^{
110 if (callback->mOctetString) {
111 NSData * data = [NSData dataWithBytes:value.data() length:value.size()];
112 callback->mHandler(nil, @ { @"value" : data });
114 NSString * str = [[NSString alloc] initWithBytes:value.data()
116 encoding:NSUTF8StringEncoding];
117 callback->mHandler(nil, @ { @"value" : str });
120 if (!callback->mKeepAlive) {
129 ResponseHandler mHandler;
130 dispatch_queue_t mQueue;
135 class CHIPBooleanAttributeCallbackBridge : public Callback::Callback<BooleanAttributeCallback> {
137 CHIPBooleanAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
138 : Callback::Callback<BooleanAttributeCallback>(CallbackFn, this)
141 , mKeepAlive(keepAlive)
145 ~CHIPBooleanAttributeCallbackBridge() {};
147 static void CallbackFn(void * context, bool value)
149 CHIPBooleanAttributeCallbackBridge * callback = reinterpret_cast<CHIPBooleanAttributeCallbackBridge *>(context);
150 if (callback && callback->mQueue) {
151 dispatch_async(callback->mQueue, ^{
152 callback->mHandler(nil, @ { @"value" : [NSNumber numberWithBool:value] });
153 if (!callback->mKeepAlive) {
162 ResponseHandler mHandler;
163 dispatch_queue_t mQueue;
167 class CHIPInt8uAttributeCallbackBridge : public Callback::Callback<Int8uAttributeCallback> {
169 CHIPInt8uAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
170 : Callback::Callback<Int8uAttributeCallback>(CallbackFn, this)
173 , mKeepAlive(keepAlive)
177 ~CHIPInt8uAttributeCallbackBridge() {};
179 static void CallbackFn(void * context, uint8_t value)
181 CHIPInt8uAttributeCallbackBridge * callback = reinterpret_cast<CHIPInt8uAttributeCallbackBridge *>(context);
182 if (callback && callback->mQueue) {
183 dispatch_async(callback->mQueue, ^{
184 callback->mHandler(nil, @ { @"value" : [NSNumber numberWithUnsignedChar:value] });
185 if (!callback->mKeepAlive) {
194 ResponseHandler mHandler;
195 dispatch_queue_t mQueue;
199 class CHIPInt8sAttributeCallbackBridge : public Callback::Callback<Int8sAttributeCallback> {
201 CHIPInt8sAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
202 : Callback::Callback<Int8sAttributeCallback>(CallbackFn, this)
205 , mKeepAlive(keepAlive)
209 ~CHIPInt8sAttributeCallbackBridge() {};
211 static void CallbackFn(void * context, int8_t value)
213 CHIPInt8sAttributeCallbackBridge * callback = reinterpret_cast<CHIPInt8sAttributeCallbackBridge *>(context);
214 if (callback && callback->mQueue) {
215 dispatch_async(callback->mQueue, ^{
216 callback->mHandler(nil, @ { @"value" : [NSNumber numberWithChar:value] });
217 if (!callback->mKeepAlive) {
226 ResponseHandler mHandler;
227 dispatch_queue_t mQueue;
231 class CHIPInt16uAttributeCallbackBridge : public Callback::Callback<Int16uAttributeCallback> {
233 CHIPInt16uAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
234 : Callback::Callback<Int16uAttributeCallback>(CallbackFn, this)
237 , mKeepAlive(keepAlive)
241 ~CHIPInt16uAttributeCallbackBridge() {};
243 static void CallbackFn(void * context, uint16_t value)
245 CHIPInt16uAttributeCallbackBridge * callback = reinterpret_cast<CHIPInt16uAttributeCallbackBridge *>(context);
246 if (callback && callback->mQueue) {
247 dispatch_async(callback->mQueue, ^{
248 callback->mHandler(nil, @ { @"value" : [NSNumber numberWithUnsignedShort:value] });
249 if (!callback->mKeepAlive) {
258 ResponseHandler mHandler;
259 dispatch_queue_t mQueue;
263 class CHIPInt32uAttributeCallbackBridge : public Callback::Callback<Int32uAttributeCallback> {
265 CHIPInt32uAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
266 : Callback::Callback<Int32uAttributeCallback>(CallbackFn, this)
269 , mKeepAlive(keepAlive)
273 ~CHIPInt32uAttributeCallbackBridge() {};
275 static void CallbackFn(void * context, uint32_t value)
277 CHIPInt32uAttributeCallbackBridge * callback = reinterpret_cast<CHIPInt32uAttributeCallbackBridge *>(context);
278 if (callback && callback->mQueue) {
279 dispatch_async(callback->mQueue, ^{
280 callback->mHandler(nil, @ { @"value" : [NSNumber numberWithUnsignedLong:value] });
281 if (!callback->mKeepAlive) {
290 ResponseHandler mHandler;
291 dispatch_queue_t mQueue;
295 class CHIPInt16sAttributeCallbackBridge : public Callback::Callback<Int16sAttributeCallback> {
297 CHIPInt16sAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
298 : Callback::Callback<Int16sAttributeCallback>(CallbackFn, this)
301 , mKeepAlive(keepAlive)
305 ~CHIPInt16sAttributeCallbackBridge() {};
307 static void CallbackFn(void * context, int16_t value)
309 CHIPInt16sAttributeCallbackBridge * callback = reinterpret_cast<CHIPInt16sAttributeCallbackBridge *>(context);
310 if (callback && callback->mQueue) {
311 dispatch_async(callback->mQueue, ^{
312 callback->mHandler(nil, @ { @"value" : [NSNumber numberWithShort:value] });
313 if (!callback->mKeepAlive) {
322 ResponseHandler mHandler;
323 dispatch_queue_t mQueue;
327 @interface CHIPCluster ()
328 @property (readonly, nonatomic) dispatch_queue_t callbackQueue;
329 - (Controller::ClusterBase *)getCluster;
332 @implementation CHIPCluster
333 - (instancetype)initWithDevice:(CHIPDevice *)device endpoint:(EndpointId)endpoint queue:(dispatch_queue_t)queue
335 if (self = [super init]) {
336 Controller::ClusterBase * cppCluster = [self getCluster];
337 if (cppCluster == nullptr) {
341 CHIP_ERROR err = cppCluster->Associate([device internalDevice], endpoint);
342 if (err != CHIP_NO_ERROR) {
346 _callbackQueue = queue;
351 - (Controller::ClusterBase *)getCluster
357 @interface CHIPApplicationBasic ()
358 @property (readonly) Controller::ApplicationBasicCluster cppCluster;
361 @implementation CHIPApplicationBasic
363 - (Controller::ClusterBase *)getCluster
368 - (void)readAttributeVendorName:(ResponseHandler)completionHandler
370 CHIPStringAttributeCallbackBridge * onSuccess
371 = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true);
373 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
377 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
380 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
384 CHIP_ERROR err = self.cppCluster.ReadAttributeVendorName(onSuccess->Cancel(), onFailure->Cancel());
385 if (err != CHIP_NO_ERROR) {
388 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
392 - (void)readAttributeVendorId:(ResponseHandler)completionHandler
394 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
396 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
400 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
403 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
407 CHIP_ERROR err = self.cppCluster.ReadAttributeVendorId(onSuccess->Cancel(), onFailure->Cancel());
408 if (err != CHIP_NO_ERROR) {
411 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
415 - (void)readAttributeApplicationName:(ResponseHandler)completionHandler
417 CHIPStringAttributeCallbackBridge * onSuccess
418 = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true);
420 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
424 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
427 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
431 CHIP_ERROR err = self.cppCluster.ReadAttributeApplicationName(onSuccess->Cancel(), onFailure->Cancel());
432 if (err != CHIP_NO_ERROR) {
435 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
439 - (void)readAttributeProductId:(ResponseHandler)completionHandler
441 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
443 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
447 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
450 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
454 CHIP_ERROR err = self.cppCluster.ReadAttributeProductId(onSuccess->Cancel(), onFailure->Cancel());
455 if (err != CHIP_NO_ERROR) {
458 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
462 - (void)readAttributeApplicationId:(ResponseHandler)completionHandler
464 CHIPStringAttributeCallbackBridge * onSuccess
465 = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true);
467 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
471 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
474 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
478 CHIP_ERROR err = self.cppCluster.ReadAttributeApplicationId(onSuccess->Cancel(), onFailure->Cancel());
479 if (err != CHIP_NO_ERROR) {
482 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
486 - (void)readAttributeCatalogVendorId:(ResponseHandler)completionHandler
488 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
490 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
494 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
497 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
501 CHIP_ERROR err = self.cppCluster.ReadAttributeCatalogVendorId(onSuccess->Cancel(), onFailure->Cancel());
502 if (err != CHIP_NO_ERROR) {
505 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
509 - (void)readAttributeApplicationSatus:(ResponseHandler)completionHandler
511 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
513 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
517 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
520 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
524 CHIP_ERROR err = self.cppCluster.ReadAttributeApplicationSatus(onSuccess->Cancel(), onFailure->Cancel());
525 if (err != CHIP_NO_ERROR) {
528 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
532 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
534 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
536 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
540 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
543 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
547 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
548 if (err != CHIP_NO_ERROR) {
551 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
557 @interface CHIPBarrierControl ()
558 @property (readonly) Controller::BarrierControlCluster cppCluster;
561 @implementation CHIPBarrierControl
563 - (Controller::ClusterBase *)getCluster
568 - (void)barrierControlGoToPercent:(uint8_t)percentOpen completionHandler:(ResponseHandler)completionHandler
570 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
572 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
576 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
579 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
583 CHIP_ERROR err = self.cppCluster.BarrierControlGoToPercent(onSuccess->Cancel(), onFailure->Cancel(), percentOpen);
584 if (err != CHIP_NO_ERROR) {
587 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
590 - (void)barrierControlStop:(ResponseHandler)completionHandler
592 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
594 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
598 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
601 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
605 CHIP_ERROR err = self.cppCluster.BarrierControlStop(onSuccess->Cancel(), onFailure->Cancel());
606 if (err != CHIP_NO_ERROR) {
609 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
613 - (void)readAttributeBarrierMovingState:(ResponseHandler)completionHandler
615 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
617 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
621 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
624 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
628 CHIP_ERROR err = self.cppCluster.ReadAttributeBarrierMovingState(onSuccess->Cancel(), onFailure->Cancel());
629 if (err != CHIP_NO_ERROR) {
632 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
636 - (void)readAttributeBarrierSafetyStatus:(ResponseHandler)completionHandler
638 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
640 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
644 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
647 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
651 CHIP_ERROR err = self.cppCluster.ReadAttributeBarrierSafetyStatus(onSuccess->Cancel(), onFailure->Cancel());
652 if (err != CHIP_NO_ERROR) {
655 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
659 - (void)readAttributeBarrierCapabilities:(ResponseHandler)completionHandler
661 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
663 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
667 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
670 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
674 CHIP_ERROR err = self.cppCluster.ReadAttributeBarrierCapabilities(onSuccess->Cancel(), onFailure->Cancel());
675 if (err != CHIP_NO_ERROR) {
678 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
682 - (void)readAttributeBarrierPosition:(ResponseHandler)completionHandler
684 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
686 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
690 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
693 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
697 CHIP_ERROR err = self.cppCluster.ReadAttributeBarrierPosition(onSuccess->Cancel(), onFailure->Cancel());
698 if (err != CHIP_NO_ERROR) {
701 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
705 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
707 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
709 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
713 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
716 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
720 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
721 if (err != CHIP_NO_ERROR) {
724 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
730 @interface CHIPBasic ()
731 @property (readonly) Controller::BasicCluster cppCluster;
734 @implementation CHIPBasic
736 - (Controller::ClusterBase *)getCluster
741 - (void)mfgSpecificPing:(ResponseHandler)completionHandler
743 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
745 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
749 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
752 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
756 CHIP_ERROR err = self.cppCluster.MfgSpecificPing(onSuccess->Cancel(), onFailure->Cancel());
757 if (err != CHIP_NO_ERROR) {
760 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
764 - (void)readAttributeInteractionModelVersion:(ResponseHandler)completionHandler
766 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
768 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
772 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
775 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
779 CHIP_ERROR err = self.cppCluster.ReadAttributeInteractionModelVersion(onSuccess->Cancel(), onFailure->Cancel());
780 if (err != CHIP_NO_ERROR) {
783 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
787 - (void)readAttributeVendorName:(ResponseHandler)completionHandler
789 CHIPStringAttributeCallbackBridge * onSuccess
790 = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
792 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
796 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
799 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
803 CHIP_ERROR err = self.cppCluster.ReadAttributeVendorName(onSuccess->Cancel(), onFailure->Cancel());
804 if (err != CHIP_NO_ERROR) {
807 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
811 - (void)readAttributeVendorID:(ResponseHandler)completionHandler
813 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
815 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
819 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
822 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
826 CHIP_ERROR err = self.cppCluster.ReadAttributeVendorID(onSuccess->Cancel(), onFailure->Cancel());
827 if (err != CHIP_NO_ERROR) {
830 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
834 - (void)readAttributeProductName:(ResponseHandler)completionHandler
836 CHIPStringAttributeCallbackBridge * onSuccess
837 = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
839 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
843 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
846 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
850 CHIP_ERROR err = self.cppCluster.ReadAttributeProductName(onSuccess->Cancel(), onFailure->Cancel());
851 if (err != CHIP_NO_ERROR) {
854 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
858 - (void)readAttributeProductID:(ResponseHandler)completionHandler
860 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
862 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
866 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
869 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
873 CHIP_ERROR err = self.cppCluster.ReadAttributeProductID(onSuccess->Cancel(), onFailure->Cancel());
874 if (err != CHIP_NO_ERROR) {
877 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
881 - (void)readAttributeUserLabel:(ResponseHandler)completionHandler
883 CHIPStringAttributeCallbackBridge * onSuccess
884 = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
886 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
890 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
893 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
897 CHIP_ERROR err = self.cppCluster.ReadAttributeUserLabel(onSuccess->Cancel(), onFailure->Cancel());
898 if (err != CHIP_NO_ERROR) {
901 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
905 - (void)writeAttributeUserLabel:(NSString *)value completionHandler:(ResponseHandler)completionHandler
907 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
909 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
913 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
916 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
920 NSData * data = [value dataUsingEncoding:NSUTF8StringEncoding];
921 CHIP_ERROR err = self.cppCluster.WriteAttributeUserLabel(
922 onSuccess->Cancel(), onFailure->Cancel(), chip::ByteSpan((const uint8_t *) data.bytes, data.length));
923 if (err != CHIP_NO_ERROR) {
926 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
930 - (void)readAttributeLocation:(ResponseHandler)completionHandler
932 CHIPStringAttributeCallbackBridge * onSuccess
933 = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
935 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
939 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
942 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
946 CHIP_ERROR err = self.cppCluster.ReadAttributeLocation(onSuccess->Cancel(), onFailure->Cancel());
947 if (err != CHIP_NO_ERROR) {
950 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
954 - (void)writeAttributeLocation:(NSString *)value completionHandler:(ResponseHandler)completionHandler
956 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
958 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
962 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
965 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
969 NSData * data = [value dataUsingEncoding:NSUTF8StringEncoding];
970 CHIP_ERROR err = self.cppCluster.WriteAttributeLocation(
971 onSuccess->Cancel(), onFailure->Cancel(), chip::ByteSpan((const uint8_t *) data.bytes, data.length));
972 if (err != CHIP_NO_ERROR) {
975 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
979 - (void)readAttributeHardwareVersion:(ResponseHandler)completionHandler
981 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
983 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
987 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
990 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
994 CHIP_ERROR err = self.cppCluster.ReadAttributeHardwareVersion(onSuccess->Cancel(), onFailure->Cancel());
995 if (err != CHIP_NO_ERROR) {
998 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1002 - (void)readAttributeHardwareVersionString:(ResponseHandler)completionHandler
1004 CHIPStringAttributeCallbackBridge * onSuccess
1005 = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
1007 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1011 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1014 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1018 CHIP_ERROR err = self.cppCluster.ReadAttributeHardwareVersionString(onSuccess->Cancel(), onFailure->Cancel());
1019 if (err != CHIP_NO_ERROR) {
1022 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1026 - (void)readAttributeSoftwareVersion:(ResponseHandler)completionHandler
1028 CHIPInt32uAttributeCallbackBridge * onSuccess = new CHIPInt32uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1030 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1034 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1037 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1041 CHIP_ERROR err = self.cppCluster.ReadAttributeSoftwareVersion(onSuccess->Cancel(), onFailure->Cancel());
1042 if (err != CHIP_NO_ERROR) {
1045 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1049 - (void)readAttributeSoftwareVersionString:(ResponseHandler)completionHandler
1051 CHIPStringAttributeCallbackBridge * onSuccess
1052 = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
1054 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1058 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1061 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1065 CHIP_ERROR err = self.cppCluster.ReadAttributeSoftwareVersionString(onSuccess->Cancel(), onFailure->Cancel());
1066 if (err != CHIP_NO_ERROR) {
1069 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1073 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
1075 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1077 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1081 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1084 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1088 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
1089 if (err != CHIP_NO_ERROR) {
1092 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1098 @interface CHIPBinding ()
1099 @property (readonly) Controller::BindingCluster cppCluster;
1102 @implementation CHIPBinding
1104 - (Controller::ClusterBase *)getCluster
1106 return &_cppCluster;
1109 - (void)bind:(uint64_t)nodeId
1110 groupId:(uint16_t)groupId
1111 endpointId:(uint8_t)endpointId
1112 clusterId:(uint16_t)clusterId
1113 completionHandler:(ResponseHandler)completionHandler
1115 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1117 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1121 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1124 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1128 CHIP_ERROR err = self.cppCluster.Bind(onSuccess->Cancel(), onFailure->Cancel(), nodeId, groupId, endpointId, clusterId);
1129 if (err != CHIP_NO_ERROR) {
1132 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1135 - (void)unbind:(uint64_t)nodeId
1136 groupId:(uint16_t)groupId
1137 endpointId:(uint8_t)endpointId
1138 clusterId:(uint16_t)clusterId
1139 completionHandler:(ResponseHandler)completionHandler
1141 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1143 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1147 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1150 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1154 CHIP_ERROR err = self.cppCluster.Unbind(onSuccess->Cancel(), onFailure->Cancel(), nodeId, groupId, endpointId, clusterId);
1155 if (err != CHIP_NO_ERROR) {
1158 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1162 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
1164 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1166 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1170 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1173 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1177 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
1178 if (err != CHIP_NO_ERROR) {
1181 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1187 @interface CHIPColorControl ()
1188 @property (readonly) Controller::ColorControlCluster cppCluster;
1191 @implementation CHIPColorControl
1193 - (Controller::ClusterBase *)getCluster
1195 return &_cppCluster;
1198 - (void)moveColor:(int16_t)rateX
1199 rateY:(int16_t)rateY
1200 optionsMask:(uint8_t)optionsMask
1201 optionsOverride:(uint8_t)optionsOverride
1202 completionHandler:(ResponseHandler)completionHandler
1204 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1206 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1210 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1213 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1218 = self.cppCluster.MoveColor(onSuccess->Cancel(), onFailure->Cancel(), rateX, rateY, optionsMask, optionsOverride);
1219 if (err != CHIP_NO_ERROR) {
1222 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1225 - (void)moveColorTemperature:(uint8_t)moveMode
1227 colorTemperatureMinimum:(uint16_t)colorTemperatureMinimum
1228 colorTemperatureMaximum:(uint16_t)colorTemperatureMaximum
1229 optionsMask:(uint8_t)optionsMask
1230 optionsOverride:(uint8_t)optionsOverride
1231 completionHandler:(ResponseHandler)completionHandler
1233 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1235 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1239 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1242 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1246 CHIP_ERROR err = self.cppCluster.MoveColorTemperature(onSuccess->Cancel(), onFailure->Cancel(), moveMode, rate,
1247 colorTemperatureMinimum, colorTemperatureMaximum, optionsMask, optionsOverride);
1248 if (err != CHIP_NO_ERROR) {
1251 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1254 - (void)moveHue:(uint8_t)moveMode
1256 optionsMask:(uint8_t)optionsMask
1257 optionsOverride:(uint8_t)optionsOverride
1258 completionHandler:(ResponseHandler)completionHandler
1260 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1262 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1266 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1269 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1274 = self.cppCluster.MoveHue(onSuccess->Cancel(), onFailure->Cancel(), moveMode, rate, optionsMask, optionsOverride);
1275 if (err != CHIP_NO_ERROR) {
1278 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1281 - (void)moveSaturation:(uint8_t)moveMode
1283 optionsMask:(uint8_t)optionsMask
1284 optionsOverride:(uint8_t)optionsOverride
1285 completionHandler:(ResponseHandler)completionHandler
1287 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1289 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1293 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1296 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1301 = self.cppCluster.MoveSaturation(onSuccess->Cancel(), onFailure->Cancel(), moveMode, rate, optionsMask, optionsOverride);
1302 if (err != CHIP_NO_ERROR) {
1305 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1308 - (void)moveToColor:(uint16_t)colorX
1309 colorY:(uint16_t)colorY
1310 transitionTime:(uint16_t)transitionTime
1311 optionsMask:(uint8_t)optionsMask
1312 optionsOverride:(uint8_t)optionsOverride
1313 completionHandler:(ResponseHandler)completionHandler
1315 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1317 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1321 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1324 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1328 CHIP_ERROR err = self.cppCluster.MoveToColor(
1329 onSuccess->Cancel(), onFailure->Cancel(), colorX, colorY, transitionTime, optionsMask, optionsOverride);
1330 if (err != CHIP_NO_ERROR) {
1333 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1336 - (void)moveToColorTemperature:(uint16_t)colorTemperature
1337 transitionTime:(uint16_t)transitionTime
1338 optionsMask:(uint8_t)optionsMask
1339 optionsOverride:(uint8_t)optionsOverride
1340 completionHandler:(ResponseHandler)completionHandler
1342 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1344 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1348 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1351 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1355 CHIP_ERROR err = self.cppCluster.MoveToColorTemperature(
1356 onSuccess->Cancel(), onFailure->Cancel(), colorTemperature, transitionTime, optionsMask, optionsOverride);
1357 if (err != CHIP_NO_ERROR) {
1360 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1363 - (void)moveToHue:(uint8_t)hue
1364 direction:(uint8_t)direction
1365 transitionTime:(uint16_t)transitionTime
1366 optionsMask:(uint8_t)optionsMask
1367 optionsOverride:(uint8_t)optionsOverride
1368 completionHandler:(ResponseHandler)completionHandler
1370 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1372 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1376 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1379 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1383 CHIP_ERROR err = self.cppCluster.MoveToHue(
1384 onSuccess->Cancel(), onFailure->Cancel(), hue, direction, transitionTime, optionsMask, optionsOverride);
1385 if (err != CHIP_NO_ERROR) {
1388 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1391 - (void)moveToHueAndSaturation:(uint8_t)hue
1392 saturation:(uint8_t)saturation
1393 transitionTime:(uint16_t)transitionTime
1394 optionsMask:(uint8_t)optionsMask
1395 optionsOverride:(uint8_t)optionsOverride
1396 completionHandler:(ResponseHandler)completionHandler
1398 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1400 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1404 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1407 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1411 CHIP_ERROR err = self.cppCluster.MoveToHueAndSaturation(
1412 onSuccess->Cancel(), onFailure->Cancel(), hue, saturation, transitionTime, optionsMask, optionsOverride);
1413 if (err != CHIP_NO_ERROR) {
1416 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1419 - (void)moveToSaturation:(uint8_t)saturation
1420 transitionTime:(uint16_t)transitionTime
1421 optionsMask:(uint8_t)optionsMask
1422 optionsOverride:(uint8_t)optionsOverride
1423 completionHandler:(ResponseHandler)completionHandler
1425 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1427 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1431 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1434 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1438 CHIP_ERROR err = self.cppCluster.MoveToSaturation(
1439 onSuccess->Cancel(), onFailure->Cancel(), saturation, transitionTime, optionsMask, optionsOverride);
1440 if (err != CHIP_NO_ERROR) {
1443 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1446 - (void)stepColor:(int16_t)stepX
1447 stepY:(int16_t)stepY
1448 transitionTime:(uint16_t)transitionTime
1449 optionsMask:(uint8_t)optionsMask
1450 optionsOverride:(uint8_t)optionsOverride
1451 completionHandler:(ResponseHandler)completionHandler
1453 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1455 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1459 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1462 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1466 CHIP_ERROR err = self.cppCluster.StepColor(
1467 onSuccess->Cancel(), onFailure->Cancel(), stepX, stepY, transitionTime, optionsMask, optionsOverride);
1468 if (err != CHIP_NO_ERROR) {
1471 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1474 - (void)stepColorTemperature:(uint8_t)stepMode
1475 stepSize:(uint16_t)stepSize
1476 transitionTime:(uint16_t)transitionTime
1477 colorTemperatureMinimum:(uint16_t)colorTemperatureMinimum
1478 colorTemperatureMaximum:(uint16_t)colorTemperatureMaximum
1479 optionsMask:(uint8_t)optionsMask
1480 optionsOverride:(uint8_t)optionsOverride
1481 completionHandler:(ResponseHandler)completionHandler
1483 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1485 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1489 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1492 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1496 CHIP_ERROR err = self.cppCluster.StepColorTemperature(onSuccess->Cancel(), onFailure->Cancel(), stepMode, stepSize,
1497 transitionTime, colorTemperatureMinimum, colorTemperatureMaximum, optionsMask, optionsOverride);
1498 if (err != CHIP_NO_ERROR) {
1501 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1504 - (void)stepHue:(uint8_t)stepMode
1505 stepSize:(uint8_t)stepSize
1506 transitionTime:(uint8_t)transitionTime
1507 optionsMask:(uint8_t)optionsMask
1508 optionsOverride:(uint8_t)optionsOverride
1509 completionHandler:(ResponseHandler)completionHandler
1511 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1513 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1517 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1520 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1524 CHIP_ERROR err = self.cppCluster.StepHue(
1525 onSuccess->Cancel(), onFailure->Cancel(), stepMode, stepSize, transitionTime, optionsMask, optionsOverride);
1526 if (err != CHIP_NO_ERROR) {
1529 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1532 - (void)stepSaturation:(uint8_t)stepMode
1533 stepSize:(uint8_t)stepSize
1534 transitionTime:(uint8_t)transitionTime
1535 optionsMask:(uint8_t)optionsMask
1536 optionsOverride:(uint8_t)optionsOverride
1537 completionHandler:(ResponseHandler)completionHandler
1539 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1541 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1545 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1548 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1552 CHIP_ERROR err = self.cppCluster.StepSaturation(
1553 onSuccess->Cancel(), onFailure->Cancel(), stepMode, stepSize, transitionTime, optionsMask, optionsOverride);
1554 if (err != CHIP_NO_ERROR) {
1557 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1560 - (void)stopMoveStep:(uint8_t)optionsMask
1561 optionsOverride:(uint8_t)optionsOverride
1562 completionHandler:(ResponseHandler)completionHandler
1564 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1566 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1570 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1573 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1577 CHIP_ERROR err = self.cppCluster.StopMoveStep(onSuccess->Cancel(), onFailure->Cancel(), optionsMask, optionsOverride);
1578 if (err != CHIP_NO_ERROR) {
1581 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1585 - (void)readAttributeCurrentHue:(ResponseHandler)completionHandler
1587 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1589 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1593 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1596 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1600 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentHue(onSuccess->Cancel(), onFailure->Cancel());
1601 if (err != CHIP_NO_ERROR) {
1604 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1608 - (void)configureAttributeCurrentHue:(uint16_t)minInterval
1609 maxInterval:(uint16_t)maxInterval
1610 change:(uint8_t)change
1611 completionHandler:(ResponseHandler)completionHandler
1613 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1615 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1619 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1622 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1627 = self.cppCluster.ConfigureAttributeCurrentHue(onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
1628 if (err != CHIP_NO_ERROR) {
1631 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1635 - (void)reportAttributeCurrentHue:(ResponseHandler)reportHandler
1637 CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
1639 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1643 CHIP_ERROR err = self.cppCluster.ReportAttributeCurrentHue(onReport->Cancel());
1644 if (err != CHIP_NO_ERROR) {
1646 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
1650 - (void)readAttributeCurrentSaturation:(ResponseHandler)completionHandler
1652 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1654 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1658 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1661 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1665 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentSaturation(onSuccess->Cancel(), onFailure->Cancel());
1666 if (err != CHIP_NO_ERROR) {
1669 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1673 - (void)configureAttributeCurrentSaturation:(uint16_t)minInterval
1674 maxInterval:(uint16_t)maxInterval
1675 change:(uint8_t)change
1676 completionHandler:(ResponseHandler)completionHandler
1678 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1680 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1684 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1687 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1691 CHIP_ERROR err = self.cppCluster.ConfigureAttributeCurrentSaturation(
1692 onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
1693 if (err != CHIP_NO_ERROR) {
1696 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1700 - (void)reportAttributeCurrentSaturation:(ResponseHandler)reportHandler
1702 CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
1704 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1708 CHIP_ERROR err = self.cppCluster.ReportAttributeCurrentSaturation(onReport->Cancel());
1709 if (err != CHIP_NO_ERROR) {
1711 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
1715 - (void)readAttributeRemainingTime:(ResponseHandler)completionHandler
1717 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1719 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1723 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1726 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1730 CHIP_ERROR err = self.cppCluster.ReadAttributeRemainingTime(onSuccess->Cancel(), onFailure->Cancel());
1731 if (err != CHIP_NO_ERROR) {
1734 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1738 - (void)readAttributeCurrentX:(ResponseHandler)completionHandler
1740 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1742 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1746 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1749 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1753 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentX(onSuccess->Cancel(), onFailure->Cancel());
1754 if (err != CHIP_NO_ERROR) {
1757 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1761 - (void)configureAttributeCurrentX:(uint16_t)minInterval
1762 maxInterval:(uint16_t)maxInterval
1763 change:(uint16_t)change
1764 completionHandler:(ResponseHandler)completionHandler
1766 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1768 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1772 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1775 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1780 = self.cppCluster.ConfigureAttributeCurrentX(onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
1781 if (err != CHIP_NO_ERROR) {
1784 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1788 - (void)reportAttributeCurrentX:(ResponseHandler)reportHandler
1790 CHIPInt16uAttributeCallbackBridge * onReport = new CHIPInt16uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
1792 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1796 CHIP_ERROR err = self.cppCluster.ReportAttributeCurrentX(onReport->Cancel());
1797 if (err != CHIP_NO_ERROR) {
1799 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
1803 - (void)readAttributeCurrentY:(ResponseHandler)completionHandler
1805 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1807 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1811 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1814 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1818 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentY(onSuccess->Cancel(), onFailure->Cancel());
1819 if (err != CHIP_NO_ERROR) {
1822 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1826 - (void)configureAttributeCurrentY:(uint16_t)minInterval
1827 maxInterval:(uint16_t)maxInterval
1828 change:(uint16_t)change
1829 completionHandler:(ResponseHandler)completionHandler
1831 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1833 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1837 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1840 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1845 = self.cppCluster.ConfigureAttributeCurrentY(onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
1846 if (err != CHIP_NO_ERROR) {
1849 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1853 - (void)reportAttributeCurrentY:(ResponseHandler)reportHandler
1855 CHIPInt16uAttributeCallbackBridge * onReport = new CHIPInt16uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
1857 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1861 CHIP_ERROR err = self.cppCluster.ReportAttributeCurrentY(onReport->Cancel());
1862 if (err != CHIP_NO_ERROR) {
1864 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
1868 - (void)readAttributeDriftCompensation:(ResponseHandler)completionHandler
1870 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1872 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1876 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1879 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1883 CHIP_ERROR err = self.cppCluster.ReadAttributeDriftCompensation(onSuccess->Cancel(), onFailure->Cancel());
1884 if (err != CHIP_NO_ERROR) {
1887 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1891 - (void)readAttributeCompensationText:(ResponseHandler)completionHandler
1893 CHIPStringAttributeCallbackBridge * onSuccess
1894 = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
1896 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1900 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1903 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1907 CHIP_ERROR err = self.cppCluster.ReadAttributeCompensationText(onSuccess->Cancel(), onFailure->Cancel());
1908 if (err != CHIP_NO_ERROR) {
1911 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1915 - (void)readAttributeColorTemperature:(ResponseHandler)completionHandler
1917 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1919 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1923 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1926 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1930 CHIP_ERROR err = self.cppCluster.ReadAttributeColorTemperature(onSuccess->Cancel(), onFailure->Cancel());
1931 if (err != CHIP_NO_ERROR) {
1934 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1938 - (void)configureAttributeColorTemperature:(uint16_t)minInterval
1939 maxInterval:(uint16_t)maxInterval
1940 change:(uint16_t)change
1941 completionHandler:(ResponseHandler)completionHandler
1943 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1945 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1949 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1952 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1956 CHIP_ERROR err = self.cppCluster.ConfigureAttributeColorTemperature(
1957 onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
1958 if (err != CHIP_NO_ERROR) {
1961 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1965 - (void)reportAttributeColorTemperature:(ResponseHandler)reportHandler
1967 CHIPInt16uAttributeCallbackBridge * onReport = new CHIPInt16uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
1969 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1973 CHIP_ERROR err = self.cppCluster.ReportAttributeColorTemperature(onReport->Cancel());
1974 if (err != CHIP_NO_ERROR) {
1976 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
1980 - (void)readAttributeColorMode:(ResponseHandler)completionHandler
1982 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1984 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1988 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1991 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1995 CHIP_ERROR err = self.cppCluster.ReadAttributeColorMode(onSuccess->Cancel(), onFailure->Cancel());
1996 if (err != CHIP_NO_ERROR) {
1999 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2003 - (void)readAttributeColorControlOptions:(ResponseHandler)completionHandler
2005 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2007 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2011 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2014 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2018 CHIP_ERROR err = self.cppCluster.ReadAttributeColorControlOptions(onSuccess->Cancel(), onFailure->Cancel());
2019 if (err != CHIP_NO_ERROR) {
2022 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2026 - (void)writeAttributeColorControlOptions:(uint8_t)value completionHandler:(ResponseHandler)completionHandler
2028 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2030 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2034 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2037 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2041 CHIP_ERROR err = self.cppCluster.WriteAttributeColorControlOptions(onSuccess->Cancel(), onFailure->Cancel(), value);
2042 if (err != CHIP_NO_ERROR) {
2045 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2049 - (void)readAttributeNumberOfPrimaries:(ResponseHandler)completionHandler
2051 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2053 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2057 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2060 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2064 CHIP_ERROR err = self.cppCluster.ReadAttributeNumberOfPrimaries(onSuccess->Cancel(), onFailure->Cancel());
2065 if (err != CHIP_NO_ERROR) {
2068 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2072 - (void)readAttributePrimary1X:(ResponseHandler)completionHandler
2074 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2076 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2080 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2083 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2087 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary1X(onSuccess->Cancel(), onFailure->Cancel());
2088 if (err != CHIP_NO_ERROR) {
2091 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2095 - (void)readAttributePrimary1Y:(ResponseHandler)completionHandler
2097 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2099 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2103 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2106 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2110 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary1Y(onSuccess->Cancel(), onFailure->Cancel());
2111 if (err != CHIP_NO_ERROR) {
2114 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2118 - (void)readAttributePrimary1Intensity:(ResponseHandler)completionHandler
2120 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2122 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2126 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2129 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2133 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary1Intensity(onSuccess->Cancel(), onFailure->Cancel());
2134 if (err != CHIP_NO_ERROR) {
2137 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2141 - (void)readAttributePrimary2X:(ResponseHandler)completionHandler
2143 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2145 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2149 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2152 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2156 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary2X(onSuccess->Cancel(), onFailure->Cancel());
2157 if (err != CHIP_NO_ERROR) {
2160 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2164 - (void)readAttributePrimary2Y:(ResponseHandler)completionHandler
2166 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2168 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2172 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2175 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2179 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary2Y(onSuccess->Cancel(), onFailure->Cancel());
2180 if (err != CHIP_NO_ERROR) {
2183 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2187 - (void)readAttributePrimary2Intensity:(ResponseHandler)completionHandler
2189 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2191 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2195 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2198 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2202 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary2Intensity(onSuccess->Cancel(), onFailure->Cancel());
2203 if (err != CHIP_NO_ERROR) {
2206 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2210 - (void)readAttributePrimary3X:(ResponseHandler)completionHandler
2212 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2214 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2218 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2221 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2225 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary3X(onSuccess->Cancel(), onFailure->Cancel());
2226 if (err != CHIP_NO_ERROR) {
2229 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2233 - (void)readAttributePrimary3Y:(ResponseHandler)completionHandler
2235 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2237 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2241 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2244 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2248 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary3Y(onSuccess->Cancel(), onFailure->Cancel());
2249 if (err != CHIP_NO_ERROR) {
2252 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2256 - (void)readAttributePrimary3Intensity:(ResponseHandler)completionHandler
2258 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2260 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2264 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2267 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2271 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary3Intensity(onSuccess->Cancel(), onFailure->Cancel());
2272 if (err != CHIP_NO_ERROR) {
2275 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2279 - (void)readAttributePrimary4X:(ResponseHandler)completionHandler
2281 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2283 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2287 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2290 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2294 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary4X(onSuccess->Cancel(), onFailure->Cancel());
2295 if (err != CHIP_NO_ERROR) {
2298 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2302 - (void)readAttributePrimary4Y:(ResponseHandler)completionHandler
2304 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2306 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2310 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2313 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2317 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary4Y(onSuccess->Cancel(), onFailure->Cancel());
2318 if (err != CHIP_NO_ERROR) {
2321 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2325 - (void)readAttributePrimary4Intensity:(ResponseHandler)completionHandler
2327 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2329 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2333 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2336 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2340 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary4Intensity(onSuccess->Cancel(), onFailure->Cancel());
2341 if (err != CHIP_NO_ERROR) {
2344 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2348 - (void)readAttributePrimary5X:(ResponseHandler)completionHandler
2350 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2352 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2356 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2359 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2363 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary5X(onSuccess->Cancel(), onFailure->Cancel());
2364 if (err != CHIP_NO_ERROR) {
2367 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2371 - (void)readAttributePrimary5Y:(ResponseHandler)completionHandler
2373 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2375 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2379 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2382 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2386 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary5Y(onSuccess->Cancel(), onFailure->Cancel());
2387 if (err != CHIP_NO_ERROR) {
2390 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2394 - (void)readAttributePrimary5Intensity:(ResponseHandler)completionHandler
2396 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2398 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2402 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2405 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2409 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary5Intensity(onSuccess->Cancel(), onFailure->Cancel());
2410 if (err != CHIP_NO_ERROR) {
2413 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2417 - (void)readAttributePrimary6X:(ResponseHandler)completionHandler
2419 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2421 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2425 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2428 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2432 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary6X(onSuccess->Cancel(), onFailure->Cancel());
2433 if (err != CHIP_NO_ERROR) {
2436 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2440 - (void)readAttributePrimary6Y:(ResponseHandler)completionHandler
2442 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2444 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2448 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2451 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2455 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary6Y(onSuccess->Cancel(), onFailure->Cancel());
2456 if (err != CHIP_NO_ERROR) {
2459 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2463 - (void)readAttributePrimary6Intensity:(ResponseHandler)completionHandler
2465 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2467 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2471 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2474 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2478 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary6Intensity(onSuccess->Cancel(), onFailure->Cancel());
2479 if (err != CHIP_NO_ERROR) {
2482 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2486 - (void)readAttributeWhitePointX:(ResponseHandler)completionHandler
2488 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2490 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2494 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2497 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2501 CHIP_ERROR err = self.cppCluster.ReadAttributeWhitePointX(onSuccess->Cancel(), onFailure->Cancel());
2502 if (err != CHIP_NO_ERROR) {
2505 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2509 - (void)writeAttributeWhitePointX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
2511 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2513 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2517 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2520 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2524 CHIP_ERROR err = self.cppCluster.WriteAttributeWhitePointX(onSuccess->Cancel(), onFailure->Cancel(), value);
2525 if (err != CHIP_NO_ERROR) {
2528 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2532 - (void)readAttributeWhitePointY:(ResponseHandler)completionHandler
2534 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2536 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2540 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2543 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2547 CHIP_ERROR err = self.cppCluster.ReadAttributeWhitePointY(onSuccess->Cancel(), onFailure->Cancel());
2548 if (err != CHIP_NO_ERROR) {
2551 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2555 - (void)writeAttributeWhitePointY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
2557 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2559 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2563 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2566 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2570 CHIP_ERROR err = self.cppCluster.WriteAttributeWhitePointY(onSuccess->Cancel(), onFailure->Cancel(), value);
2571 if (err != CHIP_NO_ERROR) {
2574 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2578 - (void)readAttributeColorPointRX:(ResponseHandler)completionHandler
2580 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2582 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2586 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2589 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2593 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointRX(onSuccess->Cancel(), onFailure->Cancel());
2594 if (err != CHIP_NO_ERROR) {
2597 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2601 - (void)writeAttributeColorPointRX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
2603 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2605 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2609 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2612 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2616 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointRX(onSuccess->Cancel(), onFailure->Cancel(), value);
2617 if (err != CHIP_NO_ERROR) {
2620 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2624 - (void)readAttributeColorPointRY:(ResponseHandler)completionHandler
2626 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2628 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2632 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2635 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2639 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointRY(onSuccess->Cancel(), onFailure->Cancel());
2640 if (err != CHIP_NO_ERROR) {
2643 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2647 - (void)writeAttributeColorPointRY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
2649 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2651 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2655 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2658 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2662 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointRY(onSuccess->Cancel(), onFailure->Cancel(), value);
2663 if (err != CHIP_NO_ERROR) {
2666 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2670 - (void)readAttributeColorPointRIntensity:(ResponseHandler)completionHandler
2672 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2674 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2678 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2681 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2685 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointRIntensity(onSuccess->Cancel(), onFailure->Cancel());
2686 if (err != CHIP_NO_ERROR) {
2689 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2693 - (void)writeAttributeColorPointRIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler
2695 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2697 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2701 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2704 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2708 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointRIntensity(onSuccess->Cancel(), onFailure->Cancel(), value);
2709 if (err != CHIP_NO_ERROR) {
2712 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2716 - (void)readAttributeColorPointGX:(ResponseHandler)completionHandler
2718 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2720 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2724 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2727 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2731 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointGX(onSuccess->Cancel(), onFailure->Cancel());
2732 if (err != CHIP_NO_ERROR) {
2735 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2739 - (void)writeAttributeColorPointGX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
2741 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2743 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2747 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2750 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2754 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointGX(onSuccess->Cancel(), onFailure->Cancel(), value);
2755 if (err != CHIP_NO_ERROR) {
2758 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2762 - (void)readAttributeColorPointGY:(ResponseHandler)completionHandler
2764 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2766 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2770 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2773 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2777 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointGY(onSuccess->Cancel(), onFailure->Cancel());
2778 if (err != CHIP_NO_ERROR) {
2781 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2785 - (void)writeAttributeColorPointGY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
2787 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2789 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2793 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2796 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2800 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointGY(onSuccess->Cancel(), onFailure->Cancel(), value);
2801 if (err != CHIP_NO_ERROR) {
2804 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2808 - (void)readAttributeColorPointGIntensity:(ResponseHandler)completionHandler
2810 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2812 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2816 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2819 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2823 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointGIntensity(onSuccess->Cancel(), onFailure->Cancel());
2824 if (err != CHIP_NO_ERROR) {
2827 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2831 - (void)writeAttributeColorPointGIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler
2833 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2835 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2839 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2842 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2846 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointGIntensity(onSuccess->Cancel(), onFailure->Cancel(), value);
2847 if (err != CHIP_NO_ERROR) {
2850 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2854 - (void)readAttributeColorPointBX:(ResponseHandler)completionHandler
2856 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2858 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2862 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2865 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2869 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointBX(onSuccess->Cancel(), onFailure->Cancel());
2870 if (err != CHIP_NO_ERROR) {
2873 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2877 - (void)writeAttributeColorPointBX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
2879 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2881 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2885 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2888 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2892 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointBX(onSuccess->Cancel(), onFailure->Cancel(), value);
2893 if (err != CHIP_NO_ERROR) {
2896 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2900 - (void)readAttributeColorPointBY:(ResponseHandler)completionHandler
2902 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2904 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2908 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2911 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2915 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointBY(onSuccess->Cancel(), onFailure->Cancel());
2916 if (err != CHIP_NO_ERROR) {
2919 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2923 - (void)writeAttributeColorPointBY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
2925 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2927 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2931 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2934 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2938 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointBY(onSuccess->Cancel(), onFailure->Cancel(), value);
2939 if (err != CHIP_NO_ERROR) {
2942 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2946 - (void)readAttributeColorPointBIntensity:(ResponseHandler)completionHandler
2948 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2950 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2954 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2957 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2961 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointBIntensity(onSuccess->Cancel(), onFailure->Cancel());
2962 if (err != CHIP_NO_ERROR) {
2965 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2969 - (void)writeAttributeColorPointBIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler
2971 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2973 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2977 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2980 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2984 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointBIntensity(onSuccess->Cancel(), onFailure->Cancel(), value);
2985 if (err != CHIP_NO_ERROR) {
2988 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2992 - (void)readAttributeEnhancedCurrentHue:(ResponseHandler)completionHandler
2994 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2996 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3000 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3003 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3007 CHIP_ERROR err = self.cppCluster.ReadAttributeEnhancedCurrentHue(onSuccess->Cancel(), onFailure->Cancel());
3008 if (err != CHIP_NO_ERROR) {
3011 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3015 - (void)readAttributeEnhancedColorMode:(ResponseHandler)completionHandler
3017 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3019 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3023 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3026 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3030 CHIP_ERROR err = self.cppCluster.ReadAttributeEnhancedColorMode(onSuccess->Cancel(), onFailure->Cancel());
3031 if (err != CHIP_NO_ERROR) {
3034 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3038 - (void)readAttributeColorLoopActive:(ResponseHandler)completionHandler
3040 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3042 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3046 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3049 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3053 CHIP_ERROR err = self.cppCluster.ReadAttributeColorLoopActive(onSuccess->Cancel(), onFailure->Cancel());
3054 if (err != CHIP_NO_ERROR) {
3057 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3061 - (void)readAttributeColorLoopDirection:(ResponseHandler)completionHandler
3063 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3065 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3069 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3072 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3076 CHIP_ERROR err = self.cppCluster.ReadAttributeColorLoopDirection(onSuccess->Cancel(), onFailure->Cancel());
3077 if (err != CHIP_NO_ERROR) {
3080 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3084 - (void)readAttributeColorLoopTime:(ResponseHandler)completionHandler
3086 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3088 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3092 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3095 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3099 CHIP_ERROR err = self.cppCluster.ReadAttributeColorLoopTime(onSuccess->Cancel(), onFailure->Cancel());
3100 if (err != CHIP_NO_ERROR) {
3103 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3107 - (void)readAttributeColorCapabilities:(ResponseHandler)completionHandler
3109 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3111 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3115 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3118 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3122 CHIP_ERROR err = self.cppCluster.ReadAttributeColorCapabilities(onSuccess->Cancel(), onFailure->Cancel());
3123 if (err != CHIP_NO_ERROR) {
3126 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3130 - (void)readAttributeColorTempPhysicalMin:(ResponseHandler)completionHandler
3132 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3134 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3138 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3141 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3145 CHIP_ERROR err = self.cppCluster.ReadAttributeColorTempPhysicalMin(onSuccess->Cancel(), onFailure->Cancel());
3146 if (err != CHIP_NO_ERROR) {
3149 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3153 - (void)readAttributeColorTempPhysicalMax:(ResponseHandler)completionHandler
3155 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3157 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3161 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3164 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3168 CHIP_ERROR err = self.cppCluster.ReadAttributeColorTempPhysicalMax(onSuccess->Cancel(), onFailure->Cancel());
3169 if (err != CHIP_NO_ERROR) {
3172 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3176 - (void)readAttributeCoupleColorTempToLevelMinMireds:(ResponseHandler)completionHandler
3178 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3180 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3184 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3187 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3191 CHIP_ERROR err = self.cppCluster.ReadAttributeCoupleColorTempToLevelMinMireds(onSuccess->Cancel(), onFailure->Cancel());
3192 if (err != CHIP_NO_ERROR) {
3195 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3199 - (void)readAttributeStartUpColorTemperatureMireds:(ResponseHandler)completionHandler
3201 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3203 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3207 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3210 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3214 CHIP_ERROR err = self.cppCluster.ReadAttributeStartUpColorTemperatureMireds(onSuccess->Cancel(), onFailure->Cancel());
3215 if (err != CHIP_NO_ERROR) {
3218 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3222 - (void)writeAttributeStartUpColorTemperatureMireds:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
3224 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3226 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3230 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3233 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3237 CHIP_ERROR err = self.cppCluster.WriteAttributeStartUpColorTemperatureMireds(onSuccess->Cancel(), onFailure->Cancel(), value);
3238 if (err != CHIP_NO_ERROR) {
3241 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3245 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
3247 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3249 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3253 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3256 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3260 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
3261 if (err != CHIP_NO_ERROR) {
3264 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3270 @interface CHIPContentLaunch ()
3271 @property (readonly) Controller::ContentLaunchCluster cppCluster;
3274 @implementation CHIPContentLaunch
3276 - (Controller::ClusterBase *)getCluster
3278 return &_cppCluster;
3281 - (void)launchContent:(ResponseHandler)completionHandler
3283 CHIPContentLaunchClusterLaunchContentResponseCallbackBridge * onSuccess
3284 = new CHIPContentLaunchClusterLaunchContentResponseCallbackBridge(completionHandler, [self callbackQueue]);
3286 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3290 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3293 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3297 CHIP_ERROR err = self.cppCluster.LaunchContent(onSuccess->Cancel(), onFailure->Cancel());
3298 if (err != CHIP_NO_ERROR) {
3301 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3304 - (void)launchURL:(ResponseHandler)completionHandler
3306 CHIPContentLaunchClusterLaunchURLResponseCallbackBridge * onSuccess
3307 = new CHIPContentLaunchClusterLaunchURLResponseCallbackBridge(completionHandler, [self callbackQueue]);
3309 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3313 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3316 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3320 CHIP_ERROR err = self.cppCluster.LaunchURL(onSuccess->Cancel(), onFailure->Cancel());
3321 if (err != CHIP_NO_ERROR) {
3324 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3328 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
3330 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3332 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3336 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3339 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3343 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
3344 if (err != CHIP_NO_ERROR) {
3347 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3353 @interface CHIPDoorLock ()
3354 @property (readonly) Controller::DoorLockCluster cppCluster;
3357 @implementation CHIPDoorLock
3359 - (Controller::ClusterBase *)getCluster
3361 return &_cppCluster;
3364 - (void)clearAllPins:(ResponseHandler)completionHandler
3366 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3368 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3372 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3375 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3379 CHIP_ERROR err = self.cppCluster.ClearAllPins(onSuccess->Cancel(), onFailure->Cancel());
3380 if (err != CHIP_NO_ERROR) {
3383 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3386 - (void)clearAllRfids:(ResponseHandler)completionHandler
3388 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3390 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3394 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3397 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3401 CHIP_ERROR err = self.cppCluster.ClearAllRfids(onSuccess->Cancel(), onFailure->Cancel());
3402 if (err != CHIP_NO_ERROR) {
3405 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3408 - (void)clearHolidaySchedule:(uint8_t)scheduleId completionHandler:(ResponseHandler)completionHandler
3410 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3412 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3416 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3419 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3423 CHIP_ERROR err = self.cppCluster.ClearHolidaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId);
3424 if (err != CHIP_NO_ERROR) {
3427 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3430 - (void)clearPin:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
3432 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3434 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3438 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3441 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3445 CHIP_ERROR err = self.cppCluster.ClearPin(onSuccess->Cancel(), onFailure->Cancel(), userId);
3446 if (err != CHIP_NO_ERROR) {
3449 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3452 - (void)clearRfid:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
3454 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3456 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3460 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3463 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3467 CHIP_ERROR err = self.cppCluster.ClearRfid(onSuccess->Cancel(), onFailure->Cancel(), userId);
3468 if (err != CHIP_NO_ERROR) {
3471 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3474 - (void)clearWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
3476 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3478 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3482 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3485 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3489 CHIP_ERROR err = self.cppCluster.ClearWeekdaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId);
3490 if (err != CHIP_NO_ERROR) {
3493 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3496 - (void)clearYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
3498 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3500 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3504 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3507 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3511 CHIP_ERROR err = self.cppCluster.ClearYeardaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId);
3512 if (err != CHIP_NO_ERROR) {
3515 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3518 - (void)getHolidaySchedule:(uint8_t)scheduleId completionHandler:(ResponseHandler)completionHandler
3520 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3522 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3526 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3529 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3533 CHIP_ERROR err = self.cppCluster.GetHolidaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId);
3534 if (err != CHIP_NO_ERROR) {
3537 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3540 - (void)getLogRecord:(uint16_t)logIndex completionHandler:(ResponseHandler)completionHandler
3542 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3544 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3548 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3551 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3555 CHIP_ERROR err = self.cppCluster.GetLogRecord(onSuccess->Cancel(), onFailure->Cancel(), logIndex);
3556 if (err != CHIP_NO_ERROR) {
3559 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3562 - (void)getPin:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
3564 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3566 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3570 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3573 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3577 CHIP_ERROR err = self.cppCluster.GetPin(onSuccess->Cancel(), onFailure->Cancel(), userId);
3578 if (err != CHIP_NO_ERROR) {
3581 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3584 - (void)getRfid:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
3586 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3588 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3592 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3595 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3599 CHIP_ERROR err = self.cppCluster.GetRfid(onSuccess->Cancel(), onFailure->Cancel(), userId);
3600 if (err != CHIP_NO_ERROR) {
3603 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3606 - (void)getUserType:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
3608 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3610 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3614 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3617 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3621 CHIP_ERROR err = self.cppCluster.GetUserType(onSuccess->Cancel(), onFailure->Cancel(), userId);
3622 if (err != CHIP_NO_ERROR) {
3625 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3628 - (void)getWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
3630 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3632 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3636 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3639 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3643 CHIP_ERROR err = self.cppCluster.GetWeekdaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId);
3644 if (err != CHIP_NO_ERROR) {
3647 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3650 - (void)getYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
3652 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3654 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3658 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3661 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3665 CHIP_ERROR err = self.cppCluster.GetYeardaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId);
3666 if (err != CHIP_NO_ERROR) {
3669 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3672 - (void)lockDoor:(NSString *)pin completionHandler:(ResponseHandler)completionHandler
3674 CHIPDoorLockClusterLockDoorResponseCallbackBridge * onSuccess
3675 = new CHIPDoorLockClusterLockDoorResponseCallbackBridge(completionHandler, [self callbackQueue]);
3677 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3681 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3684 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3688 CHIP_ERROR err = self.cppCluster.LockDoor(onSuccess->Cancel(), onFailure->Cancel(),
3689 chip::ByteSpan((const uint8_t *) [pin dataUsingEncoding:NSUTF8StringEncoding].bytes,
3690 [pin lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
3691 if (err != CHIP_NO_ERROR) {
3694 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3697 - (void)setHolidaySchedule:(uint8_t)scheduleId
3698 localStartTime:(uint32_t)localStartTime
3699 localEndTime:(uint32_t)localEndTime
3700 operatingModeDuringHoliday:(uint8_t)operatingModeDuringHoliday
3701 completionHandler:(ResponseHandler)completionHandler
3703 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3705 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3709 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3712 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3716 CHIP_ERROR err = self.cppCluster.SetHolidaySchedule(
3717 onSuccess->Cancel(), onFailure->Cancel(), scheduleId, localStartTime, localEndTime, operatingModeDuringHoliday);
3718 if (err != CHIP_NO_ERROR) {
3721 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3724 - (void)setPin:(uint16_t)userId
3725 userStatus:(uint8_t)userStatus
3726 userType:(uint8_t)userType
3728 completionHandler:(ResponseHandler)completionHandler
3730 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3732 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3736 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3739 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3743 CHIP_ERROR err = self.cppCluster.SetPin(onSuccess->Cancel(), onFailure->Cancel(), userId, userStatus, userType,
3744 chip::ByteSpan((const uint8_t *) [pin dataUsingEncoding:NSUTF8StringEncoding].bytes,
3745 [pin lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
3746 if (err != CHIP_NO_ERROR) {
3749 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3752 - (void)setRfid:(uint16_t)userId
3753 userStatus:(uint8_t)userStatus
3754 userType:(uint8_t)userType
3756 completionHandler:(ResponseHandler)completionHandler
3758 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3760 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3764 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3767 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3771 CHIP_ERROR err = self.cppCluster.SetRfid(onSuccess->Cancel(), onFailure->Cancel(), userId, userStatus, userType,
3772 chip::ByteSpan((const uint8_t *) [id dataUsingEncoding:NSUTF8StringEncoding].bytes,
3773 [id lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
3774 if (err != CHIP_NO_ERROR) {
3777 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3780 - (void)setUserType:(uint16_t)userId userType:(uint8_t)userType completionHandler:(ResponseHandler)completionHandler
3782 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3784 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3788 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3791 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3795 CHIP_ERROR err = self.cppCluster.SetUserType(onSuccess->Cancel(), onFailure->Cancel(), userId, userType);
3796 if (err != CHIP_NO_ERROR) {
3799 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3802 - (void)setWeekdaySchedule:(uint8_t)scheduleId
3803 userId:(uint16_t)userId
3804 daysMask:(uint8_t)daysMask
3805 startHour:(uint8_t)startHour
3806 startMinute:(uint8_t)startMinute
3807 endHour:(uint8_t)endHour
3808 endMinute:(uint8_t)endMinute
3809 completionHandler:(ResponseHandler)completionHandler
3811 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3813 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3817 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3820 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3824 CHIP_ERROR err = self.cppCluster.SetWeekdaySchedule(
3825 onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId, daysMask, startHour, startMinute, endHour, endMinute);
3826 if (err != CHIP_NO_ERROR) {
3829 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3832 - (void)setYeardaySchedule:(uint8_t)scheduleId
3833 userId:(uint16_t)userId
3834 localStartTime:(uint32_t)localStartTime
3835 localEndTime:(uint32_t)localEndTime
3836 completionHandler:(ResponseHandler)completionHandler
3838 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3840 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3844 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3847 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3851 CHIP_ERROR err = self.cppCluster.SetYeardaySchedule(
3852 onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId, localStartTime, localEndTime);
3853 if (err != CHIP_NO_ERROR) {
3856 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3859 - (void)unlockDoor:(NSString *)pin completionHandler:(ResponseHandler)completionHandler
3861 CHIPDoorLockClusterUnlockDoorResponseCallbackBridge * onSuccess
3862 = new CHIPDoorLockClusterUnlockDoorResponseCallbackBridge(completionHandler, [self callbackQueue]);
3864 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3868 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3871 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3875 CHIP_ERROR err = self.cppCluster.UnlockDoor(onSuccess->Cancel(), onFailure->Cancel(),
3876 chip::ByteSpan((const uint8_t *) [pin dataUsingEncoding:NSUTF8StringEncoding].bytes,
3877 [pin lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
3878 if (err != CHIP_NO_ERROR) {
3881 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3884 - (void)unlockWithTimeout:(uint16_t)timeoutInSeconds pin:(NSString *)pin completionHandler:(ResponseHandler)completionHandler
3886 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3888 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3892 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3895 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3899 CHIP_ERROR err = self.cppCluster.UnlockWithTimeout(onSuccess->Cancel(), onFailure->Cancel(), timeoutInSeconds,
3900 chip::ByteSpan((const uint8_t *) [pin dataUsingEncoding:NSUTF8StringEncoding].bytes,
3901 [pin lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
3902 if (err != CHIP_NO_ERROR) {
3905 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3909 - (void)readAttributeLockState:(ResponseHandler)completionHandler
3911 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3913 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3917 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3920 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3924 CHIP_ERROR err = self.cppCluster.ReadAttributeLockState(onSuccess->Cancel(), onFailure->Cancel());
3925 if (err != CHIP_NO_ERROR) {
3928 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3932 - (void)configureAttributeLockState:(uint16_t)minInterval
3933 maxInterval:(uint16_t)maxInterval
3934 completionHandler:(ResponseHandler)completionHandler
3936 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3938 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3942 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3945 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3950 = self.cppCluster.ConfigureAttributeLockState(onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval);
3951 if (err != CHIP_NO_ERROR) {
3954 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3958 - (void)reportAttributeLockState:(ResponseHandler)reportHandler
3960 CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
3962 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3966 CHIP_ERROR err = self.cppCluster.ReportAttributeLockState(onReport->Cancel());
3967 if (err != CHIP_NO_ERROR) {
3969 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
3973 - (void)readAttributeLockType:(ResponseHandler)completionHandler
3975 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3977 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3981 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3984 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3988 CHIP_ERROR err = self.cppCluster.ReadAttributeLockType(onSuccess->Cancel(), onFailure->Cancel());
3989 if (err != CHIP_NO_ERROR) {
3992 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3996 - (void)readAttributeActuatorEnabled:(ResponseHandler)completionHandler
3998 CHIPBooleanAttributeCallbackBridge * onSuccess
3999 = new CHIPBooleanAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4001 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4005 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4008 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4012 CHIP_ERROR err = self.cppCluster.ReadAttributeActuatorEnabled(onSuccess->Cancel(), onFailure->Cancel());
4013 if (err != CHIP_NO_ERROR) {
4016 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4020 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
4022 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4024 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4028 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4031 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4035 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
4036 if (err != CHIP_NO_ERROR) {
4039 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4045 @interface CHIPGeneralCommissioning ()
4046 @property (readonly) Controller::GeneralCommissioningCluster cppCluster;
4049 @implementation CHIPGeneralCommissioning
4051 - (Controller::ClusterBase *)getCluster
4053 return &_cppCluster;
4056 - (void)armFailSafe:(uint16_t)expiryLengthSeconds
4057 breadcrumb:(uint64_t)breadcrumb
4058 timeoutMs:(uint32_t)timeoutMs
4059 completionHandler:(ResponseHandler)completionHandler
4061 CHIPGeneralCommissioningClusterArmFailSafeResponseCallbackBridge * onSuccess
4062 = new CHIPGeneralCommissioningClusterArmFailSafeResponseCallbackBridge(completionHandler, [self callbackQueue]);
4064 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4068 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4071 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4076 = self.cppCluster.ArmFailSafe(onSuccess->Cancel(), onFailure->Cancel(), expiryLengthSeconds, breadcrumb, timeoutMs);
4077 if (err != CHIP_NO_ERROR) {
4080 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4083 - (void)commissioningComplete:(ResponseHandler)completionHandler
4085 CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge * onSuccess
4086 = new CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge(completionHandler, [self callbackQueue]);
4088 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4092 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4095 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4099 CHIP_ERROR err = self.cppCluster.CommissioningComplete(onSuccess->Cancel(), onFailure->Cancel());
4100 if (err != CHIP_NO_ERROR) {
4103 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4106 - (void)setFabric:(NSData *)fabricId
4107 fabricSecret:(NSData *)fabricSecret
4108 breadcrumb:(uint64_t)breadcrumb
4109 timeoutMs:(uint32_t)timeoutMs
4110 completionHandler:(ResponseHandler)completionHandler
4112 CHIPGeneralCommissioningClusterSetFabricResponseCallbackBridge * onSuccess
4113 = new CHIPGeneralCommissioningClusterSetFabricResponseCallbackBridge(completionHandler, [self callbackQueue]);
4115 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4119 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4122 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4126 CHIP_ERROR err = self.cppCluster.SetFabric(onSuccess->Cancel(), onFailure->Cancel(),
4127 chip::ByteSpan((const uint8_t *) fabricId.bytes, fabricId.length),
4128 chip::ByteSpan((const uint8_t *) fabricSecret.bytes, fabricSecret.length), breadcrumb, timeoutMs);
4129 if (err != CHIP_NO_ERROR) {
4132 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4136 - (void)readAttributeFabricId:(ResponseHandler)completionHandler
4138 CHIPStringAttributeCallbackBridge * onSuccess
4139 = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true);
4141 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4145 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4148 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4152 CHIP_ERROR err = self.cppCluster.ReadAttributeFabricId(onSuccess->Cancel(), onFailure->Cancel());
4153 if (err != CHIP_NO_ERROR) {
4156 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4160 - (void)readAttributeBreadcrumb:(ResponseHandler)completionHandler
4162 CHIPInt64uAttributeCallbackBridge * onSuccess = new CHIPInt64uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4164 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4168 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4171 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4175 CHIP_ERROR err = self.cppCluster.ReadAttributeBreadcrumb(onSuccess->Cancel(), onFailure->Cancel());
4176 if (err != CHIP_NO_ERROR) {
4179 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4183 - (void)writeAttributeBreadcrumb:(uint64_t)value completionHandler:(ResponseHandler)completionHandler
4185 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4187 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4191 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4194 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4198 CHIP_ERROR err = self.cppCluster.WriteAttributeBreadcrumb(onSuccess->Cancel(), onFailure->Cancel(), value);
4199 if (err != CHIP_NO_ERROR) {
4202 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4206 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
4208 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4210 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4214 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4217 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4221 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
4222 if (err != CHIP_NO_ERROR) {
4225 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4231 @interface CHIPGroups ()
4232 @property (readonly) Controller::GroupsCluster cppCluster;
4235 @implementation CHIPGroups
4237 - (Controller::ClusterBase *)getCluster
4239 return &_cppCluster;
4242 - (void)addGroup:(uint16_t)groupId groupName:(NSString *)groupName completionHandler:(ResponseHandler)completionHandler
4244 CHIPGroupsClusterAddGroupResponseCallbackBridge * onSuccess
4245 = new CHIPGroupsClusterAddGroupResponseCallbackBridge(completionHandler, [self callbackQueue]);
4247 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4251 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4254 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4258 CHIP_ERROR err = self.cppCluster.AddGroup(onSuccess->Cancel(), onFailure->Cancel(), groupId,
4259 chip::ByteSpan((const uint8_t *) [groupName dataUsingEncoding:NSUTF8StringEncoding].bytes,
4260 [groupName lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
4261 if (err != CHIP_NO_ERROR) {
4264 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4267 - (void)addGroupIfIdentifying:(uint16_t)groupId groupName:(NSString *)groupName completionHandler:(ResponseHandler)completionHandler
4269 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4271 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4275 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4278 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4282 CHIP_ERROR err = self.cppCluster.AddGroupIfIdentifying(onSuccess->Cancel(), onFailure->Cancel(), groupId,
4283 chip::ByteSpan((const uint8_t *) [groupName dataUsingEncoding:NSUTF8StringEncoding].bytes,
4284 [groupName lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
4285 if (err != CHIP_NO_ERROR) {
4288 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4291 - (void)getGroupMembership:(uint8_t)groupCount groupList:(uint16_t)groupList completionHandler:(ResponseHandler)completionHandler
4293 CHIPGroupsClusterGetGroupMembershipResponseCallbackBridge * onSuccess
4294 = new CHIPGroupsClusterGetGroupMembershipResponseCallbackBridge(completionHandler, [self callbackQueue]);
4296 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4300 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4303 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4307 CHIP_ERROR err = self.cppCluster.GetGroupMembership(onSuccess->Cancel(), onFailure->Cancel(), groupCount, groupList);
4308 if (err != CHIP_NO_ERROR) {
4311 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4314 - (void)removeAllGroups:(ResponseHandler)completionHandler
4316 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4318 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4322 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4325 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4329 CHIP_ERROR err = self.cppCluster.RemoveAllGroups(onSuccess->Cancel(), onFailure->Cancel());
4330 if (err != CHIP_NO_ERROR) {
4333 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4336 - (void)removeGroup:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler
4338 CHIPGroupsClusterRemoveGroupResponseCallbackBridge * onSuccess
4339 = new CHIPGroupsClusterRemoveGroupResponseCallbackBridge(completionHandler, [self callbackQueue]);
4341 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4345 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4348 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4352 CHIP_ERROR err = self.cppCluster.RemoveGroup(onSuccess->Cancel(), onFailure->Cancel(), groupId);
4353 if (err != CHIP_NO_ERROR) {
4356 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4359 - (void)viewGroup:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler
4361 CHIPGroupsClusterViewGroupResponseCallbackBridge * onSuccess
4362 = new CHIPGroupsClusterViewGroupResponseCallbackBridge(completionHandler, [self callbackQueue]);
4364 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4368 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4371 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4375 CHIP_ERROR err = self.cppCluster.ViewGroup(onSuccess->Cancel(), onFailure->Cancel(), groupId);
4376 if (err != CHIP_NO_ERROR) {
4379 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4383 - (void)readAttributeNameSupport:(ResponseHandler)completionHandler
4385 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4387 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4391 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4394 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4398 CHIP_ERROR err = self.cppCluster.ReadAttributeNameSupport(onSuccess->Cancel(), onFailure->Cancel());
4399 if (err != CHIP_NO_ERROR) {
4402 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4406 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
4408 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4410 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4414 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4417 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4421 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
4422 if (err != CHIP_NO_ERROR) {
4425 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4431 @interface CHIPIasZone ()
4432 @property (readonly) Controller::IasZoneCluster cppCluster;
4435 @implementation CHIPIasZone
4437 - (Controller::ClusterBase *)getCluster
4439 return &_cppCluster;
4442 - (void)readAttributeZoneState:(ResponseHandler)completionHandler
4444 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4446 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4450 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4453 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4457 CHIP_ERROR err = self.cppCluster.ReadAttributeZoneState(onSuccess->Cancel(), onFailure->Cancel());
4458 if (err != CHIP_NO_ERROR) {
4461 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4465 - (void)readAttributeZoneType:(ResponseHandler)completionHandler
4467 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4469 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4473 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4476 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4480 CHIP_ERROR err = self.cppCluster.ReadAttributeZoneType(onSuccess->Cancel(), onFailure->Cancel());
4481 if (err != CHIP_NO_ERROR) {
4484 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4488 - (void)readAttributeZoneStatus:(ResponseHandler)completionHandler
4490 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4492 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4496 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4499 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4503 CHIP_ERROR err = self.cppCluster.ReadAttributeZoneStatus(onSuccess->Cancel(), onFailure->Cancel());
4504 if (err != CHIP_NO_ERROR) {
4507 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4511 - (void)readAttributeIasCieAddress:(ResponseHandler)completionHandler
4513 CHIPInt64uAttributeCallbackBridge * onSuccess = new CHIPInt64uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4515 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4519 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4522 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4526 CHIP_ERROR err = self.cppCluster.ReadAttributeIasCieAddress(onSuccess->Cancel(), onFailure->Cancel());
4527 if (err != CHIP_NO_ERROR) {
4530 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4534 - (void)writeAttributeIasCieAddress:(uint64_t)value completionHandler:(ResponseHandler)completionHandler
4536 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4538 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4542 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4545 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4549 CHIP_ERROR err = self.cppCluster.WriteAttributeIasCieAddress(onSuccess->Cancel(), onFailure->Cancel(), value);
4550 if (err != CHIP_NO_ERROR) {
4553 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4557 - (void)readAttributeZoneId:(ResponseHandler)completionHandler
4559 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4561 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4565 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4568 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4572 CHIP_ERROR err = self.cppCluster.ReadAttributeZoneId(onSuccess->Cancel(), onFailure->Cancel());
4573 if (err != CHIP_NO_ERROR) {
4576 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4580 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
4582 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4584 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4588 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4591 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4595 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
4596 if (err != CHIP_NO_ERROR) {
4599 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4605 @interface CHIPIdentify ()
4606 @property (readonly) Controller::IdentifyCluster cppCluster;
4609 @implementation CHIPIdentify
4611 - (Controller::ClusterBase *)getCluster
4613 return &_cppCluster;
4616 - (void)identify:(uint16_t)identifyTime completionHandler:(ResponseHandler)completionHandler
4618 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4620 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4624 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4627 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4631 CHIP_ERROR err = self.cppCluster.Identify(onSuccess->Cancel(), onFailure->Cancel(), identifyTime);
4632 if (err != CHIP_NO_ERROR) {
4635 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4638 - (void)identifyQuery:(ResponseHandler)completionHandler
4640 CHIPIdentifyClusterIdentifyQueryResponseCallbackBridge * onSuccess
4641 = new CHIPIdentifyClusterIdentifyQueryResponseCallbackBridge(completionHandler, [self callbackQueue]);
4643 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4647 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4650 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4654 CHIP_ERROR err = self.cppCluster.IdentifyQuery(onSuccess->Cancel(), onFailure->Cancel());
4655 if (err != CHIP_NO_ERROR) {
4658 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4662 - (void)readAttributeIdentifyTime:(ResponseHandler)completionHandler
4664 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4666 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4670 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4673 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4677 CHIP_ERROR err = self.cppCluster.ReadAttributeIdentifyTime(onSuccess->Cancel(), onFailure->Cancel());
4678 if (err != CHIP_NO_ERROR) {
4681 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4685 - (void)writeAttributeIdentifyTime:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
4687 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4689 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4693 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4696 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4700 CHIP_ERROR err = self.cppCluster.WriteAttributeIdentifyTime(onSuccess->Cancel(), onFailure->Cancel(), value);
4701 if (err != CHIP_NO_ERROR) {
4704 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4708 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
4710 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4712 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4716 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4719 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4723 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
4724 if (err != CHIP_NO_ERROR) {
4727 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4733 @interface CHIPLevelControl ()
4734 @property (readonly) Controller::LevelControlCluster cppCluster;
4737 @implementation CHIPLevelControl
4739 - (Controller::ClusterBase *)getCluster
4741 return &_cppCluster;
4744 - (void)move:(uint8_t)moveMode
4746 optionMask:(uint8_t)optionMask
4747 optionOverride:(uint8_t)optionOverride
4748 completionHandler:(ResponseHandler)completionHandler
4750 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4752 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4756 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4759 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4763 CHIP_ERROR err = self.cppCluster.Move(onSuccess->Cancel(), onFailure->Cancel(), moveMode, rate, optionMask, optionOverride);
4764 if (err != CHIP_NO_ERROR) {
4767 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4770 - (void)moveToLevel:(uint8_t)level
4771 transitionTime:(uint16_t)transitionTime
4772 optionMask:(uint8_t)optionMask
4773 optionOverride:(uint8_t)optionOverride
4774 completionHandler:(ResponseHandler)completionHandler
4776 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4778 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4782 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4785 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4790 = self.cppCluster.MoveToLevel(onSuccess->Cancel(), onFailure->Cancel(), level, transitionTime, optionMask, optionOverride);
4791 if (err != CHIP_NO_ERROR) {
4794 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4797 - (void)moveToLevelWithOnOff:(uint8_t)level
4798 transitionTime:(uint16_t)transitionTime
4799 completionHandler:(ResponseHandler)completionHandler
4801 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4803 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4807 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4810 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4814 CHIP_ERROR err = self.cppCluster.MoveToLevelWithOnOff(onSuccess->Cancel(), onFailure->Cancel(), level, transitionTime);
4815 if (err != CHIP_NO_ERROR) {
4818 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4821 - (void)moveWithOnOff:(uint8_t)moveMode rate:(uint8_t)rate completionHandler:(ResponseHandler)completionHandler
4823 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4825 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4829 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4832 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4836 CHIP_ERROR err = self.cppCluster.MoveWithOnOff(onSuccess->Cancel(), onFailure->Cancel(), moveMode, rate);
4837 if (err != CHIP_NO_ERROR) {
4840 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4843 - (void)step:(uint8_t)stepMode
4844 stepSize:(uint8_t)stepSize
4845 transitionTime:(uint16_t)transitionTime
4846 optionMask:(uint8_t)optionMask
4847 optionOverride:(uint8_t)optionOverride
4848 completionHandler:(ResponseHandler)completionHandler
4850 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4852 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4856 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4859 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4863 CHIP_ERROR err = self.cppCluster.Step(
4864 onSuccess->Cancel(), onFailure->Cancel(), stepMode, stepSize, transitionTime, optionMask, optionOverride);
4865 if (err != CHIP_NO_ERROR) {
4868 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4871 - (void)stepWithOnOff:(uint8_t)stepMode
4872 stepSize:(uint8_t)stepSize
4873 transitionTime:(uint16_t)transitionTime
4874 completionHandler:(ResponseHandler)completionHandler
4876 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4878 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4882 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4885 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4889 CHIP_ERROR err = self.cppCluster.StepWithOnOff(onSuccess->Cancel(), onFailure->Cancel(), stepMode, stepSize, transitionTime);
4890 if (err != CHIP_NO_ERROR) {
4893 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4896 - (void)stop:(uint8_t)optionMask optionOverride:(uint8_t)optionOverride completionHandler:(ResponseHandler)completionHandler
4898 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4900 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4904 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4907 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4911 CHIP_ERROR err = self.cppCluster.Stop(onSuccess->Cancel(), onFailure->Cancel(), optionMask, optionOverride);
4912 if (err != CHIP_NO_ERROR) {
4915 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4918 - (void)stopWithOnOff:(ResponseHandler)completionHandler
4920 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4922 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4926 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4929 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4933 CHIP_ERROR err = self.cppCluster.StopWithOnOff(onSuccess->Cancel(), onFailure->Cancel());
4934 if (err != CHIP_NO_ERROR) {
4937 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4941 - (void)readAttributeCurrentLevel:(ResponseHandler)completionHandler
4943 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4945 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4949 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4952 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4956 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentLevel(onSuccess->Cancel(), onFailure->Cancel());
4957 if (err != CHIP_NO_ERROR) {
4960 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4964 - (void)configureAttributeCurrentLevel:(uint16_t)minInterval
4965 maxInterval:(uint16_t)maxInterval
4966 change:(uint8_t)change
4967 completionHandler:(ResponseHandler)completionHandler
4969 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4971 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4975 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4978 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4982 CHIP_ERROR err = self.cppCluster.ConfigureAttributeCurrentLevel(
4983 onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
4984 if (err != CHIP_NO_ERROR) {
4987 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4991 - (void)reportAttributeCurrentLevel:(ResponseHandler)reportHandler
4993 CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
4995 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4999 CHIP_ERROR err = self.cppCluster.ReportAttributeCurrentLevel(onReport->Cancel());
5000 if (err != CHIP_NO_ERROR) {
5002 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
5006 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
5008 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5010 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5014 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5017 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5021 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
5022 if (err != CHIP_NO_ERROR) {
5025 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5031 @interface CHIPLowPower ()
5032 @property (readonly) Controller::LowPowerCluster cppCluster;
5035 @implementation CHIPLowPower
5037 - (Controller::ClusterBase *)getCluster
5039 return &_cppCluster;
5042 - (void)sleep:(ResponseHandler)completionHandler
5044 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5046 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5050 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5053 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5057 CHIP_ERROR err = self.cppCluster.Sleep(onSuccess->Cancel(), onFailure->Cancel());
5058 if (err != CHIP_NO_ERROR) {
5061 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5065 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
5067 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5069 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5073 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5076 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5080 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
5081 if (err != CHIP_NO_ERROR) {
5084 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5090 @interface CHIPMediaPlayback ()
5091 @property (readonly) Controller::MediaPlaybackCluster cppCluster;
5094 @implementation CHIPMediaPlayback
5096 - (Controller::ClusterBase *)getCluster
5098 return &_cppCluster;
5101 - (void)fastForwardRequest:(ResponseHandler)completionHandler
5103 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5105 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5109 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5112 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5116 CHIP_ERROR err = self.cppCluster.FastForwardRequest(onSuccess->Cancel(), onFailure->Cancel());
5117 if (err != CHIP_NO_ERROR) {
5120 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5123 - (void)nextRequest:(ResponseHandler)completionHandler
5125 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5127 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5131 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5134 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5138 CHIP_ERROR err = self.cppCluster.NextRequest(onSuccess->Cancel(), onFailure->Cancel());
5139 if (err != CHIP_NO_ERROR) {
5142 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5145 - (void)pauseRequest:(ResponseHandler)completionHandler
5147 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5149 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5153 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5156 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5160 CHIP_ERROR err = self.cppCluster.PauseRequest(onSuccess->Cancel(), onFailure->Cancel());
5161 if (err != CHIP_NO_ERROR) {
5164 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5167 - (void)playRequest:(ResponseHandler)completionHandler
5169 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5171 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5175 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5178 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5182 CHIP_ERROR err = self.cppCluster.PlayRequest(onSuccess->Cancel(), onFailure->Cancel());
5183 if (err != CHIP_NO_ERROR) {
5186 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5189 - (void)previousRequest:(ResponseHandler)completionHandler
5191 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5193 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5197 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5200 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5204 CHIP_ERROR err = self.cppCluster.PreviousRequest(onSuccess->Cancel(), onFailure->Cancel());
5205 if (err != CHIP_NO_ERROR) {
5208 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5211 - (void)rewindRequest:(ResponseHandler)completionHandler
5213 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5215 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5219 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5222 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5226 CHIP_ERROR err = self.cppCluster.RewindRequest(onSuccess->Cancel(), onFailure->Cancel());
5227 if (err != CHIP_NO_ERROR) {
5230 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5233 - (void)skipBackwardRequest:(ResponseHandler)completionHandler
5235 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5237 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5241 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5244 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5248 CHIP_ERROR err = self.cppCluster.SkipBackwardRequest(onSuccess->Cancel(), onFailure->Cancel());
5249 if (err != CHIP_NO_ERROR) {
5252 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5255 - (void)skipForwardRequest:(ResponseHandler)completionHandler
5257 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5259 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5263 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5266 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5270 CHIP_ERROR err = self.cppCluster.SkipForwardRequest(onSuccess->Cancel(), onFailure->Cancel());
5271 if (err != CHIP_NO_ERROR) {
5274 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5277 - (void)startOverRequest:(ResponseHandler)completionHandler
5279 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5281 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5285 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5288 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5292 CHIP_ERROR err = self.cppCluster.StartOverRequest(onSuccess->Cancel(), onFailure->Cancel());
5293 if (err != CHIP_NO_ERROR) {
5296 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5299 - (void)stopRequest:(ResponseHandler)completionHandler
5301 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5303 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5307 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5310 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5314 CHIP_ERROR err = self.cppCluster.StopRequest(onSuccess->Cancel(), onFailure->Cancel());
5315 if (err != CHIP_NO_ERROR) {
5318 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5322 - (void)readAttributeCurrentState:(ResponseHandler)completionHandler
5324 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5326 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5330 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5333 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5337 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentState(onSuccess->Cancel(), onFailure->Cancel());
5338 if (err != CHIP_NO_ERROR) {
5341 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5345 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
5347 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5349 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5353 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5356 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5360 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
5361 if (err != CHIP_NO_ERROR) {
5364 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5370 @interface CHIPOnOff ()
5371 @property (readonly) Controller::OnOffCluster cppCluster;
5374 @implementation CHIPOnOff
5376 - (Controller::ClusterBase *)getCluster
5378 return &_cppCluster;
5381 - (void)off:(ResponseHandler)completionHandler
5383 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5385 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5389 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5392 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5396 CHIP_ERROR err = self.cppCluster.Off(onSuccess->Cancel(), onFailure->Cancel());
5397 if (err != CHIP_NO_ERROR) {
5400 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5403 - (void)on:(ResponseHandler)completionHandler
5405 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5407 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5411 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5414 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5418 CHIP_ERROR err = self.cppCluster.On(onSuccess->Cancel(), onFailure->Cancel());
5419 if (err != CHIP_NO_ERROR) {
5422 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5425 - (void)toggle:(ResponseHandler)completionHandler
5427 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5429 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5433 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5436 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5440 CHIP_ERROR err = self.cppCluster.Toggle(onSuccess->Cancel(), onFailure->Cancel());
5441 if (err != CHIP_NO_ERROR) {
5444 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5448 - (void)readAttributeOnOff:(ResponseHandler)completionHandler
5450 CHIPBooleanAttributeCallbackBridge * onSuccess
5451 = new CHIPBooleanAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5453 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5457 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5460 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5464 CHIP_ERROR err = self.cppCluster.ReadAttributeOnOff(onSuccess->Cancel(), onFailure->Cancel());
5465 if (err != CHIP_NO_ERROR) {
5468 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5472 - (void)configureAttributeOnOff:(uint16_t)minInterval
5473 maxInterval:(uint16_t)maxInterval
5474 completionHandler:(ResponseHandler)completionHandler
5476 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5478 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5482 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5485 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5489 CHIP_ERROR err = self.cppCluster.ConfigureAttributeOnOff(onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval);
5490 if (err != CHIP_NO_ERROR) {
5493 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5497 - (void)reportAttributeOnOff:(ResponseHandler)reportHandler
5499 CHIPBooleanAttributeCallbackBridge * onReport
5500 = new CHIPBooleanAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
5502 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5506 CHIP_ERROR err = self.cppCluster.ReportAttributeOnOff(onReport->Cancel());
5507 if (err != CHIP_NO_ERROR) {
5509 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
5513 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
5515 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5517 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5521 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5524 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5528 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
5529 if (err != CHIP_NO_ERROR) {
5532 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5538 @interface CHIPScenes ()
5539 @property (readonly) Controller::ScenesCluster cppCluster;
5542 @implementation CHIPScenes
5544 - (Controller::ClusterBase *)getCluster
5546 return &_cppCluster;
5549 - (void)addScene:(uint16_t)groupId
5550 sceneId:(uint8_t)sceneId
5551 transitionTime:(uint16_t)transitionTime
5552 sceneName:(NSString *)sceneName
5553 clusterId:(uint16_t)clusterId
5554 length:(uint8_t)length
5555 value:(uint8_t)value
5556 completionHandler:(ResponseHandler)completionHandler
5558 CHIPScenesClusterAddSceneResponseCallbackBridge * onSuccess
5559 = new CHIPScenesClusterAddSceneResponseCallbackBridge(completionHandler, [self callbackQueue]);
5561 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5565 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5568 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5572 CHIP_ERROR err = self.cppCluster.AddScene(onSuccess->Cancel(), onFailure->Cancel(), groupId, sceneId, transitionTime,
5573 chip::ByteSpan((const uint8_t *) [sceneName dataUsingEncoding:NSUTF8StringEncoding].bytes,
5574 [sceneName lengthOfBytesUsingEncoding:NSUTF8StringEncoding]),
5575 clusterId, length, value);
5576 if (err != CHIP_NO_ERROR) {
5579 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5582 - (void)getSceneMembership:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler
5584 CHIPScenesClusterGetSceneMembershipResponseCallbackBridge * onSuccess
5585 = new CHIPScenesClusterGetSceneMembershipResponseCallbackBridge(completionHandler, [self callbackQueue]);
5587 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5591 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5594 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5598 CHIP_ERROR err = self.cppCluster.GetSceneMembership(onSuccess->Cancel(), onFailure->Cancel(), groupId);
5599 if (err != CHIP_NO_ERROR) {
5602 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5605 - (void)recallScene:(uint16_t)groupId
5606 sceneId:(uint8_t)sceneId
5607 transitionTime:(uint16_t)transitionTime
5608 completionHandler:(ResponseHandler)completionHandler
5610 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5612 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5616 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5619 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5623 CHIP_ERROR err = self.cppCluster.RecallScene(onSuccess->Cancel(), onFailure->Cancel(), groupId, sceneId, transitionTime);
5624 if (err != CHIP_NO_ERROR) {
5627 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5630 - (void)removeAllScenes:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler
5632 CHIPScenesClusterRemoveAllScenesResponseCallbackBridge * onSuccess
5633 = new CHIPScenesClusterRemoveAllScenesResponseCallbackBridge(completionHandler, [self callbackQueue]);
5635 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5639 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5642 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5646 CHIP_ERROR err = self.cppCluster.RemoveAllScenes(onSuccess->Cancel(), onFailure->Cancel(), groupId);
5647 if (err != CHIP_NO_ERROR) {
5650 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5653 - (void)removeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:(ResponseHandler)completionHandler
5655 CHIPScenesClusterRemoveSceneResponseCallbackBridge * onSuccess
5656 = new CHIPScenesClusterRemoveSceneResponseCallbackBridge(completionHandler, [self callbackQueue]);
5658 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5662 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5665 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5669 CHIP_ERROR err = self.cppCluster.RemoveScene(onSuccess->Cancel(), onFailure->Cancel(), groupId, sceneId);
5670 if (err != CHIP_NO_ERROR) {
5673 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5676 - (void)storeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:(ResponseHandler)completionHandler
5678 CHIPScenesClusterStoreSceneResponseCallbackBridge * onSuccess
5679 = new CHIPScenesClusterStoreSceneResponseCallbackBridge(completionHandler, [self callbackQueue]);
5681 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5685 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5688 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5692 CHIP_ERROR err = self.cppCluster.StoreScene(onSuccess->Cancel(), onFailure->Cancel(), groupId, sceneId);
5693 if (err != CHIP_NO_ERROR) {
5696 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5699 - (void)viewScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:(ResponseHandler)completionHandler
5701 CHIPScenesClusterViewSceneResponseCallbackBridge * onSuccess
5702 = new CHIPScenesClusterViewSceneResponseCallbackBridge(completionHandler, [self callbackQueue]);
5704 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5708 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5711 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5715 CHIP_ERROR err = self.cppCluster.ViewScene(onSuccess->Cancel(), onFailure->Cancel(), groupId, sceneId);
5716 if (err != CHIP_NO_ERROR) {
5719 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5723 - (void)readAttributeSceneCount:(ResponseHandler)completionHandler
5725 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5727 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5731 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5734 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5738 CHIP_ERROR err = self.cppCluster.ReadAttributeSceneCount(onSuccess->Cancel(), onFailure->Cancel());
5739 if (err != CHIP_NO_ERROR) {
5742 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5746 - (void)readAttributeCurrentScene:(ResponseHandler)completionHandler
5748 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5750 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5754 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5757 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5761 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentScene(onSuccess->Cancel(), onFailure->Cancel());
5762 if (err != CHIP_NO_ERROR) {
5765 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5769 - (void)readAttributeCurrentGroup:(ResponseHandler)completionHandler
5771 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5773 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5777 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5780 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5784 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentGroup(onSuccess->Cancel(), onFailure->Cancel());
5785 if (err != CHIP_NO_ERROR) {
5788 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5792 - (void)readAttributeSceneValid:(ResponseHandler)completionHandler
5794 CHIPBooleanAttributeCallbackBridge * onSuccess
5795 = new CHIPBooleanAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5797 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5801 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5804 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5808 CHIP_ERROR err = self.cppCluster.ReadAttributeSceneValid(onSuccess->Cancel(), onFailure->Cancel());
5809 if (err != CHIP_NO_ERROR) {
5812 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5816 - (void)readAttributeNameSupport:(ResponseHandler)completionHandler
5818 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5820 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5824 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5827 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5831 CHIP_ERROR err = self.cppCluster.ReadAttributeNameSupport(onSuccess->Cancel(), onFailure->Cancel());
5832 if (err != CHIP_NO_ERROR) {
5835 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5839 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
5841 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5843 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5847 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5850 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5854 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
5855 if (err != CHIP_NO_ERROR) {
5858 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5864 @interface CHIPTemperatureMeasurement ()
5865 @property (readonly) Controller::TemperatureMeasurementCluster cppCluster;
5868 @implementation CHIPTemperatureMeasurement
5870 - (Controller::ClusterBase *)getCluster
5872 return &_cppCluster;
5875 - (void)readAttributeMeasuredValue:(ResponseHandler)completionHandler
5877 CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5879 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5883 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5886 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5890 CHIP_ERROR err = self.cppCluster.ReadAttributeMeasuredValue(onSuccess->Cancel(), onFailure->Cancel());
5891 if (err != CHIP_NO_ERROR) {
5894 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5898 - (void)configureAttributeMeasuredValue:(uint16_t)minInterval
5899 maxInterval:(uint16_t)maxInterval
5900 change:(int16_t)change
5901 completionHandler:(ResponseHandler)completionHandler
5903 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5905 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5909 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5912 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5916 CHIP_ERROR err = self.cppCluster.ConfigureAttributeMeasuredValue(
5917 onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
5918 if (err != CHIP_NO_ERROR) {
5921 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5925 - (void)reportAttributeMeasuredValue:(ResponseHandler)reportHandler
5927 CHIPInt16sAttributeCallbackBridge * onReport = new CHIPInt16sAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
5929 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5933 CHIP_ERROR err = self.cppCluster.ReportAttributeMeasuredValue(onReport->Cancel());
5934 if (err != CHIP_NO_ERROR) {
5936 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
5940 - (void)readAttributeMinMeasuredValue:(ResponseHandler)completionHandler
5942 CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5944 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5948 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5951 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5955 CHIP_ERROR err = self.cppCluster.ReadAttributeMinMeasuredValue(onSuccess->Cancel(), onFailure->Cancel());
5956 if (err != CHIP_NO_ERROR) {
5959 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5963 - (void)readAttributeMaxMeasuredValue:(ResponseHandler)completionHandler
5965 CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5967 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5971 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5974 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5978 CHIP_ERROR err = self.cppCluster.ReadAttributeMaxMeasuredValue(onSuccess->Cancel(), onFailure->Cancel());
5979 if (err != CHIP_NO_ERROR) {
5982 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5986 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
5988 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5990 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5994 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5997 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6001 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
6002 if (err != CHIP_NO_ERROR) {
6005 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);