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 CHIPUnsupportedAttributeCallbackBridge : public Callback::Callback<DefaultSuccessCallback> {
94 CHIPUnsupportedAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
95 : Callback::Callback<DefaultSuccessCallback>(CallbackFn, this)
99 ~CHIPUnsupportedAttributeCallbackBridge() {};
101 static void CallbackFn(void * context)
103 CHIPUnsupportedAttributeCallbackBridge * callback = reinterpret_cast<CHIPUnsupportedAttributeCallbackBridge *>(context);
104 if (callback && callback->mQueue) {
105 dispatch_async(callback->mQueue, ^{
106 NSError * error = [NSError errorWithDomain:CHIPErrorDomain
107 code:CHIPErrorCodeUndefinedError
108 userInfo:@ { NSLocalizedDescriptionKey : @"Unsupported attribute type" }];
109 callback->mHandler(error, nil);
117 ResponseHandler mHandler;
118 dispatch_queue_t mQueue;
121 class CHIPBooleanAttributeCallbackBridge : public Callback::Callback<BooleanAttributeCallback> {
123 CHIPBooleanAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
124 : Callback::Callback<BooleanAttributeCallback>(CallbackFn, this)
127 , mKeepAlive(keepAlive)
131 ~CHIPBooleanAttributeCallbackBridge() {};
133 static void CallbackFn(void * context, bool value)
135 CHIPBooleanAttributeCallbackBridge * callback = reinterpret_cast<CHIPBooleanAttributeCallbackBridge *>(context);
136 if (callback && callback->mQueue) {
137 dispatch_async(callback->mQueue, ^{
138 callback->mHandler(nil, @ { @"value" : [NSNumber numberWithBool:value] });
139 if (!callback->mKeepAlive) {
148 ResponseHandler mHandler;
149 dispatch_queue_t mQueue;
153 class CHIPInt8uAttributeCallbackBridge : public Callback::Callback<Int8uAttributeCallback> {
155 CHIPInt8uAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
156 : Callback::Callback<Int8uAttributeCallback>(CallbackFn, this)
159 , mKeepAlive(keepAlive)
163 ~CHIPInt8uAttributeCallbackBridge() {};
165 static void CallbackFn(void * context, uint8_t value)
167 CHIPInt8uAttributeCallbackBridge * callback = reinterpret_cast<CHIPInt8uAttributeCallbackBridge *>(context);
168 if (callback && callback->mQueue) {
169 dispatch_async(callback->mQueue, ^{
170 callback->mHandler(nil, @ { @"value" : [NSNumber numberWithUnsignedChar:value] });
171 if (!callback->mKeepAlive) {
180 ResponseHandler mHandler;
181 dispatch_queue_t mQueue;
185 class CHIPInt8sAttributeCallbackBridge : public Callback::Callback<Int8sAttributeCallback> {
187 CHIPInt8sAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
188 : Callback::Callback<Int8sAttributeCallback>(CallbackFn, this)
191 , mKeepAlive(keepAlive)
195 ~CHIPInt8sAttributeCallbackBridge() {};
197 static void CallbackFn(void * context, int8_t value)
199 CHIPInt8sAttributeCallbackBridge * callback = reinterpret_cast<CHIPInt8sAttributeCallbackBridge *>(context);
200 if (callback && callback->mQueue) {
201 dispatch_async(callback->mQueue, ^{
202 callback->mHandler(nil, @ { @"value" : [NSNumber numberWithChar:value] });
203 if (!callback->mKeepAlive) {
212 ResponseHandler mHandler;
213 dispatch_queue_t mQueue;
217 class CHIPInt16uAttributeCallbackBridge : public Callback::Callback<Int16uAttributeCallback> {
219 CHIPInt16uAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
220 : Callback::Callback<Int16uAttributeCallback>(CallbackFn, this)
223 , mKeepAlive(keepAlive)
227 ~CHIPInt16uAttributeCallbackBridge() {};
229 static void CallbackFn(void * context, uint16_t value)
231 CHIPInt16uAttributeCallbackBridge * callback = reinterpret_cast<CHIPInt16uAttributeCallbackBridge *>(context);
232 if (callback && callback->mQueue) {
233 dispatch_async(callback->mQueue, ^{
234 callback->mHandler(nil, @ { @"value" : [NSNumber numberWithUnsignedShort:value] });
235 if (!callback->mKeepAlive) {
244 ResponseHandler mHandler;
245 dispatch_queue_t mQueue;
249 class CHIPInt16sAttributeCallbackBridge : public Callback::Callback<Int16sAttributeCallback> {
251 CHIPInt16sAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
252 : Callback::Callback<Int16sAttributeCallback>(CallbackFn, this)
255 , mKeepAlive(keepAlive)
259 ~CHIPInt16sAttributeCallbackBridge() {};
261 static void CallbackFn(void * context, int16_t value)
263 CHIPInt16sAttributeCallbackBridge * callback = reinterpret_cast<CHIPInt16sAttributeCallbackBridge *>(context);
264 if (callback && callback->mQueue) {
265 dispatch_async(callback->mQueue, ^{
266 callback->mHandler(nil, @ { @"value" : [NSNumber numberWithShort:value] });
267 if (!callback->mKeepAlive) {
276 ResponseHandler mHandler;
277 dispatch_queue_t mQueue;
281 @interface CHIPCluster ()
282 @property (readonly, nonatomic) dispatch_queue_t callbackQueue;
283 - (Controller::ClusterBase *)getCluster;
286 @implementation CHIPCluster
287 - (instancetype)initWithDevice:(CHIPDevice *)device endpoint:(EndpointId)endpoint queue:(dispatch_queue_t)queue
289 if (self = [super init]) {
290 Controller::ClusterBase * cppCluster = [self getCluster];
291 if (cppCluster == nullptr) {
295 CHIP_ERROR err = cppCluster->Associate([device internalDevice], endpoint);
296 if (err != CHIP_NO_ERROR) {
300 _callbackQueue = queue;
305 - (Controller::ClusterBase *)getCluster
311 @interface CHIPApplicationBasic ()
312 @property (readonly) Controller::ApplicationBasicCluster cppCluster;
315 @implementation CHIPApplicationBasic
317 - (Controller::ClusterBase *)getCluster
322 - (void)readAttributeVendorName:(ResponseHandler)completionHandler
324 CHIPUnsupportedAttributeCallbackBridge * onSuccess
325 = new CHIPUnsupportedAttributeCallbackBridge(completionHandler, [self callbackQueue]);
327 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
331 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
334 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
338 CHIP_ERROR err = self.cppCluster.ReadAttributeVendorName(onSuccess->Cancel(), onFailure->Cancel());
339 if (err != CHIP_NO_ERROR) {
342 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
346 - (void)readAttributeVendorId:(ResponseHandler)completionHandler
348 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
350 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
354 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
357 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
361 CHIP_ERROR err = self.cppCluster.ReadAttributeVendorId(onSuccess->Cancel(), onFailure->Cancel());
362 if (err != CHIP_NO_ERROR) {
365 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
369 - (void)readAttributeApplicationName:(ResponseHandler)completionHandler
371 CHIPUnsupportedAttributeCallbackBridge * onSuccess
372 = new CHIPUnsupportedAttributeCallbackBridge(completionHandler, [self callbackQueue]);
374 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
378 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
381 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
385 CHIP_ERROR err = self.cppCluster.ReadAttributeApplicationName(onSuccess->Cancel(), onFailure->Cancel());
386 if (err != CHIP_NO_ERROR) {
389 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
393 - (void)readAttributeProductId:(ResponseHandler)completionHandler
395 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
397 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
401 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
404 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
408 CHIP_ERROR err = self.cppCluster.ReadAttributeProductId(onSuccess->Cancel(), onFailure->Cancel());
409 if (err != CHIP_NO_ERROR) {
412 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
416 - (void)readAttributeApplicationId:(ResponseHandler)completionHandler
418 CHIPUnsupportedAttributeCallbackBridge * onSuccess
419 = new CHIPUnsupportedAttributeCallbackBridge(completionHandler, [self callbackQueue]);
421 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
425 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
428 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
432 CHIP_ERROR err = self.cppCluster.ReadAttributeApplicationId(onSuccess->Cancel(), onFailure->Cancel());
433 if (err != CHIP_NO_ERROR) {
436 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
440 - (void)readAttributeCatalogVendorId:(ResponseHandler)completionHandler
442 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
444 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
448 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
451 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
455 CHIP_ERROR err = self.cppCluster.ReadAttributeCatalogVendorId(onSuccess->Cancel(), onFailure->Cancel());
456 if (err != CHIP_NO_ERROR) {
459 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
463 - (void)readAttributeApplicationSatus:(ResponseHandler)completionHandler
465 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
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.ReadAttributeApplicationSatus(onSuccess->Cancel(), onFailure->Cancel());
479 if (err != CHIP_NO_ERROR) {
482 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
486 - (void)readAttributeClusterRevision:(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.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
502 if (err != CHIP_NO_ERROR) {
505 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
511 @interface CHIPBarrierControl ()
512 @property (readonly) Controller::BarrierControlCluster cppCluster;
515 @implementation CHIPBarrierControl
517 - (Controller::ClusterBase *)getCluster
522 - (void)barrierControlGoToPercent:(uint8_t)percentOpen completionHandler:(ResponseHandler)completionHandler
524 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
526 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
530 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
533 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
537 CHIP_ERROR err = self.cppCluster.BarrierControlGoToPercent(onSuccess->Cancel(), onFailure->Cancel(), percentOpen);
538 if (err != CHIP_NO_ERROR) {
541 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
544 - (void)barrierControlStop:(ResponseHandler)completionHandler
546 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
548 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
552 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
555 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
559 CHIP_ERROR err = self.cppCluster.BarrierControlStop(onSuccess->Cancel(), onFailure->Cancel());
560 if (err != CHIP_NO_ERROR) {
563 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
567 - (void)readAttributeBarrierMovingState:(ResponseHandler)completionHandler
569 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
571 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
575 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
578 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
582 CHIP_ERROR err = self.cppCluster.ReadAttributeBarrierMovingState(onSuccess->Cancel(), onFailure->Cancel());
583 if (err != CHIP_NO_ERROR) {
586 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
590 - (void)readAttributeBarrierSafetyStatus:(ResponseHandler)completionHandler
592 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(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.ReadAttributeBarrierSafetyStatus(onSuccess->Cancel(), onFailure->Cancel());
606 if (err != CHIP_NO_ERROR) {
609 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
613 - (void)readAttributeBarrierCapabilities:(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.ReadAttributeBarrierCapabilities(onSuccess->Cancel(), onFailure->Cancel());
629 if (err != CHIP_NO_ERROR) {
632 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
636 - (void)readAttributeBarrierPosition:(ResponseHandler)completionHandler
638 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(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.ReadAttributeBarrierPosition(onSuccess->Cancel(), onFailure->Cancel());
652 if (err != CHIP_NO_ERROR) {
655 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
659 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
661 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(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.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
675 if (err != CHIP_NO_ERROR) {
678 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
684 @interface CHIPBasic ()
685 @property (readonly) Controller::BasicCluster cppCluster;
688 @implementation CHIPBasic
690 - (Controller::ClusterBase *)getCluster
695 - (void)mfgSpecificPing:(ResponseHandler)completionHandler
697 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
699 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
703 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
706 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
710 CHIP_ERROR err = self.cppCluster.MfgSpecificPing(onSuccess->Cancel(), onFailure->Cancel());
711 if (err != CHIP_NO_ERROR) {
714 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
717 - (void)resetToFactoryDefaults:(ResponseHandler)completionHandler
719 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
721 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
725 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
728 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
732 CHIP_ERROR err = self.cppCluster.ResetToFactoryDefaults(onSuccess->Cancel(), onFailure->Cancel());
733 if (err != CHIP_NO_ERROR) {
736 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
740 - (void)readAttributeZclVersion:(ResponseHandler)completionHandler
742 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
744 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
748 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
751 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
755 CHIP_ERROR err = self.cppCluster.ReadAttributeZclVersion(onSuccess->Cancel(), onFailure->Cancel());
756 if (err != CHIP_NO_ERROR) {
759 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
763 - (void)readAttributePowerSource:(ResponseHandler)completionHandler
765 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
767 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
771 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
774 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
778 CHIP_ERROR err = self.cppCluster.ReadAttributePowerSource(onSuccess->Cancel(), onFailure->Cancel());
779 if (err != CHIP_NO_ERROR) {
782 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
786 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
788 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
790 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
794 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
797 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
801 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
802 if (err != CHIP_NO_ERROR) {
805 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
811 @interface CHIPBinding ()
812 @property (readonly) Controller::BindingCluster cppCluster;
815 @implementation CHIPBinding
817 - (Controller::ClusterBase *)getCluster
822 - (void)bind:(uint64_t)nodeId
823 groupId:(uint16_t)groupId
824 endpointId:(uint8_t)endpointId
825 clusterId:(uint16_t)clusterId
826 completionHandler:(ResponseHandler)completionHandler
828 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
830 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
834 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
837 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
841 CHIP_ERROR err = self.cppCluster.Bind(onSuccess->Cancel(), onFailure->Cancel(), nodeId, groupId, endpointId, clusterId);
842 if (err != CHIP_NO_ERROR) {
845 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
848 - (void)unbind:(uint64_t)nodeId
849 groupId:(uint16_t)groupId
850 endpointId:(uint8_t)endpointId
851 clusterId:(uint16_t)clusterId
852 completionHandler:(ResponseHandler)completionHandler
854 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
856 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
860 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
863 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
867 CHIP_ERROR err = self.cppCluster.Unbind(onSuccess->Cancel(), onFailure->Cancel(), nodeId, groupId, endpointId, clusterId);
868 if (err != CHIP_NO_ERROR) {
871 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
875 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
877 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
879 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
883 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
886 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
890 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
891 if (err != CHIP_NO_ERROR) {
894 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
900 @interface CHIPColorControl ()
901 @property (readonly) Controller::ColorControlCluster cppCluster;
904 @implementation CHIPColorControl
906 - (Controller::ClusterBase *)getCluster
911 - (void)moveColor:(int16_t)rateX
913 optionsMask:(uint8_t)optionsMask
914 optionsOverride:(uint8_t)optionsOverride
915 completionHandler:(ResponseHandler)completionHandler
917 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
919 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
923 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
926 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
931 = self.cppCluster.MoveColor(onSuccess->Cancel(), onFailure->Cancel(), rateX, rateY, optionsMask, optionsOverride);
932 if (err != CHIP_NO_ERROR) {
935 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
938 - (void)moveColorTemperature:(uint8_t)moveMode
940 colorTemperatureMinimum:(uint16_t)colorTemperatureMinimum
941 colorTemperatureMaximum:(uint16_t)colorTemperatureMaximum
942 optionsMask:(uint8_t)optionsMask
943 optionsOverride:(uint8_t)optionsOverride
944 completionHandler:(ResponseHandler)completionHandler
946 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
948 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
952 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
955 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
959 CHIP_ERROR err = self.cppCluster.MoveColorTemperature(onSuccess->Cancel(), onFailure->Cancel(), moveMode, rate,
960 colorTemperatureMinimum, colorTemperatureMaximum, optionsMask, optionsOverride);
961 if (err != CHIP_NO_ERROR) {
964 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
967 - (void)moveHue:(uint8_t)moveMode
969 optionsMask:(uint8_t)optionsMask
970 optionsOverride:(uint8_t)optionsOverride
971 completionHandler:(ResponseHandler)completionHandler
973 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
975 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
979 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
982 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
987 = self.cppCluster.MoveHue(onSuccess->Cancel(), onFailure->Cancel(), moveMode, rate, optionsMask, optionsOverride);
988 if (err != CHIP_NO_ERROR) {
991 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
994 - (void)moveSaturation:(uint8_t)moveMode
996 optionsMask:(uint8_t)optionsMask
997 optionsOverride:(uint8_t)optionsOverride
998 completionHandler:(ResponseHandler)completionHandler
1000 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1002 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1006 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1009 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1014 = self.cppCluster.MoveSaturation(onSuccess->Cancel(), onFailure->Cancel(), moveMode, rate, optionsMask, optionsOverride);
1015 if (err != CHIP_NO_ERROR) {
1018 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1021 - (void)moveToColor:(uint16_t)colorX
1022 colorY:(uint16_t)colorY
1023 transitionTime:(uint16_t)transitionTime
1024 optionsMask:(uint8_t)optionsMask
1025 optionsOverride:(uint8_t)optionsOverride
1026 completionHandler:(ResponseHandler)completionHandler
1028 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(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.MoveToColor(
1042 onSuccess->Cancel(), onFailure->Cancel(), colorX, colorY, transitionTime, optionsMask, optionsOverride);
1043 if (err != CHIP_NO_ERROR) {
1046 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1049 - (void)moveToColorTemperature:(uint16_t)colorTemperature
1050 transitionTime:(uint16_t)transitionTime
1051 optionsMask:(uint8_t)optionsMask
1052 optionsOverride:(uint8_t)optionsOverride
1053 completionHandler:(ResponseHandler)completionHandler
1055 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1057 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1061 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1064 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1068 CHIP_ERROR err = self.cppCluster.MoveToColorTemperature(
1069 onSuccess->Cancel(), onFailure->Cancel(), colorTemperature, transitionTime, optionsMask, optionsOverride);
1070 if (err != CHIP_NO_ERROR) {
1073 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1076 - (void)moveToHue:(uint8_t)hue
1077 direction:(uint8_t)direction
1078 transitionTime:(uint16_t)transitionTime
1079 optionsMask:(uint8_t)optionsMask
1080 optionsOverride:(uint8_t)optionsOverride
1081 completionHandler:(ResponseHandler)completionHandler
1083 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1085 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1089 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1092 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1096 CHIP_ERROR err = self.cppCluster.MoveToHue(
1097 onSuccess->Cancel(), onFailure->Cancel(), hue, direction, transitionTime, optionsMask, optionsOverride);
1098 if (err != CHIP_NO_ERROR) {
1101 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1104 - (void)moveToHueAndSaturation:(uint8_t)hue
1105 saturation:(uint8_t)saturation
1106 transitionTime:(uint16_t)transitionTime
1107 optionsMask:(uint8_t)optionsMask
1108 optionsOverride:(uint8_t)optionsOverride
1109 completionHandler:(ResponseHandler)completionHandler
1111 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1113 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1117 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1120 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1124 CHIP_ERROR err = self.cppCluster.MoveToHueAndSaturation(
1125 onSuccess->Cancel(), onFailure->Cancel(), hue, saturation, transitionTime, optionsMask, optionsOverride);
1126 if (err != CHIP_NO_ERROR) {
1129 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1132 - (void)moveToSaturation:(uint8_t)saturation
1133 transitionTime:(uint16_t)transitionTime
1134 optionsMask:(uint8_t)optionsMask
1135 optionsOverride:(uint8_t)optionsOverride
1136 completionHandler:(ResponseHandler)completionHandler
1138 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1140 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1144 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1147 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1151 CHIP_ERROR err = self.cppCluster.MoveToSaturation(
1152 onSuccess->Cancel(), onFailure->Cancel(), saturation, transitionTime, optionsMask, optionsOverride);
1153 if (err != CHIP_NO_ERROR) {
1156 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1159 - (void)stepColor:(int16_t)stepX
1160 stepY:(int16_t)stepY
1161 transitionTime:(uint16_t)transitionTime
1162 optionsMask:(uint8_t)optionsMask
1163 optionsOverride:(uint8_t)optionsOverride
1164 completionHandler:(ResponseHandler)completionHandler
1166 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1168 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1172 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1175 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1179 CHIP_ERROR err = self.cppCluster.StepColor(
1180 onSuccess->Cancel(), onFailure->Cancel(), stepX, stepY, transitionTime, optionsMask, optionsOverride);
1181 if (err != CHIP_NO_ERROR) {
1184 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1187 - (void)stepColorTemperature:(uint8_t)stepMode
1188 stepSize:(uint16_t)stepSize
1189 transitionTime:(uint16_t)transitionTime
1190 colorTemperatureMinimum:(uint16_t)colorTemperatureMinimum
1191 colorTemperatureMaximum:(uint16_t)colorTemperatureMaximum
1192 optionsMask:(uint8_t)optionsMask
1193 optionsOverride:(uint8_t)optionsOverride
1194 completionHandler:(ResponseHandler)completionHandler
1196 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1198 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1202 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1205 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1209 CHIP_ERROR err = self.cppCluster.StepColorTemperature(onSuccess->Cancel(), onFailure->Cancel(), stepMode, stepSize,
1210 transitionTime, colorTemperatureMinimum, colorTemperatureMaximum, optionsMask, optionsOverride);
1211 if (err != CHIP_NO_ERROR) {
1214 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1217 - (void)stepHue:(uint8_t)stepMode
1218 stepSize:(uint8_t)stepSize
1219 transitionTime:(uint8_t)transitionTime
1220 optionsMask:(uint8_t)optionsMask
1221 optionsOverride:(uint8_t)optionsOverride
1222 completionHandler:(ResponseHandler)completionHandler
1224 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1226 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1230 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1233 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1237 CHIP_ERROR err = self.cppCluster.StepHue(
1238 onSuccess->Cancel(), onFailure->Cancel(), stepMode, stepSize, transitionTime, optionsMask, optionsOverride);
1239 if (err != CHIP_NO_ERROR) {
1242 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1245 - (void)stepSaturation:(uint8_t)stepMode
1246 stepSize:(uint8_t)stepSize
1247 transitionTime:(uint8_t)transitionTime
1248 optionsMask:(uint8_t)optionsMask
1249 optionsOverride:(uint8_t)optionsOverride
1250 completionHandler:(ResponseHandler)completionHandler
1252 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1254 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1258 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1261 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1265 CHIP_ERROR err = self.cppCluster.StepSaturation(
1266 onSuccess->Cancel(), onFailure->Cancel(), stepMode, stepSize, transitionTime, optionsMask, optionsOverride);
1267 if (err != CHIP_NO_ERROR) {
1270 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1273 - (void)stopMoveStep:(uint8_t)optionsMask
1274 optionsOverride:(uint8_t)optionsOverride
1275 completionHandler:(ResponseHandler)completionHandler
1277 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1279 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1283 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1286 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1290 CHIP_ERROR err = self.cppCluster.StopMoveStep(onSuccess->Cancel(), onFailure->Cancel(), optionsMask, optionsOverride);
1291 if (err != CHIP_NO_ERROR) {
1294 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1298 - (void)readAttributeCurrentHue:(ResponseHandler)completionHandler
1300 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1302 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1306 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1309 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1313 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentHue(onSuccess->Cancel(), onFailure->Cancel());
1314 if (err != CHIP_NO_ERROR) {
1317 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1321 - (void)configureAttributeCurrentHue:(uint16_t)minInterval
1322 maxInterval:(uint16_t)maxInterval
1323 change:(uint8_t)change
1324 completionHandler:(ResponseHandler)completionHandler
1326 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1328 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1332 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1335 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1340 = self.cppCluster.ConfigureAttributeCurrentHue(onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
1341 if (err != CHIP_NO_ERROR) {
1344 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1348 - (void)reportAttributeCurrentHue:(ResponseHandler)reportHandler
1350 CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
1352 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1356 CHIP_ERROR err = self.cppCluster.ReportAttributeCurrentHue(onReport->Cancel());
1357 if (err != CHIP_NO_ERROR) {
1359 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
1363 - (void)readAttributeCurrentSaturation:(ResponseHandler)completionHandler
1365 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1367 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1371 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1374 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1378 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentSaturation(onSuccess->Cancel(), onFailure->Cancel());
1379 if (err != CHIP_NO_ERROR) {
1382 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1386 - (void)configureAttributeCurrentSaturation:(uint16_t)minInterval
1387 maxInterval:(uint16_t)maxInterval
1388 change:(uint8_t)change
1389 completionHandler:(ResponseHandler)completionHandler
1391 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1393 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1397 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1400 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1404 CHIP_ERROR err = self.cppCluster.ConfigureAttributeCurrentSaturation(
1405 onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
1406 if (err != CHIP_NO_ERROR) {
1409 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1413 - (void)reportAttributeCurrentSaturation:(ResponseHandler)reportHandler
1415 CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
1417 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1421 CHIP_ERROR err = self.cppCluster.ReportAttributeCurrentSaturation(onReport->Cancel());
1422 if (err != CHIP_NO_ERROR) {
1424 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
1428 - (void)readAttributeRemainingTime:(ResponseHandler)completionHandler
1430 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1432 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1436 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1439 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1443 CHIP_ERROR err = self.cppCluster.ReadAttributeRemainingTime(onSuccess->Cancel(), onFailure->Cancel());
1444 if (err != CHIP_NO_ERROR) {
1447 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1451 - (void)readAttributeCurrentX:(ResponseHandler)completionHandler
1453 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(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.ReadAttributeCurrentX(onSuccess->Cancel(), onFailure->Cancel());
1467 if (err != CHIP_NO_ERROR) {
1470 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1474 - (void)configureAttributeCurrentX:(uint16_t)minInterval
1475 maxInterval:(uint16_t)maxInterval
1476 change:(uint16_t)change
1477 completionHandler:(ResponseHandler)completionHandler
1479 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1481 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1485 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1488 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1493 = self.cppCluster.ConfigureAttributeCurrentX(onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
1494 if (err != CHIP_NO_ERROR) {
1497 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1501 - (void)reportAttributeCurrentX:(ResponseHandler)reportHandler
1503 CHIPInt16uAttributeCallbackBridge * onReport = new CHIPInt16uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
1505 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1509 CHIP_ERROR err = self.cppCluster.ReportAttributeCurrentX(onReport->Cancel());
1510 if (err != CHIP_NO_ERROR) {
1512 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
1516 - (void)readAttributeCurrentY:(ResponseHandler)completionHandler
1518 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1520 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1524 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1527 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1531 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentY(onSuccess->Cancel(), onFailure->Cancel());
1532 if (err != CHIP_NO_ERROR) {
1535 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1539 - (void)configureAttributeCurrentY:(uint16_t)minInterval
1540 maxInterval:(uint16_t)maxInterval
1541 change:(uint16_t)change
1542 completionHandler:(ResponseHandler)completionHandler
1544 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1546 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1550 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1553 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1558 = self.cppCluster.ConfigureAttributeCurrentY(onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
1559 if (err != CHIP_NO_ERROR) {
1562 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1566 - (void)reportAttributeCurrentY:(ResponseHandler)reportHandler
1568 CHIPInt16uAttributeCallbackBridge * onReport = new CHIPInt16uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
1570 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1574 CHIP_ERROR err = self.cppCluster.ReportAttributeCurrentY(onReport->Cancel());
1575 if (err != CHIP_NO_ERROR) {
1577 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
1581 - (void)readAttributeDriftCompensation:(ResponseHandler)completionHandler
1583 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1585 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1589 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1592 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1596 CHIP_ERROR err = self.cppCluster.ReadAttributeDriftCompensation(onSuccess->Cancel(), onFailure->Cancel());
1597 if (err != CHIP_NO_ERROR) {
1600 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1604 - (void)readAttributeCompensationText:(ResponseHandler)completionHandler
1606 CHIPUnsupportedAttributeCallbackBridge * onSuccess
1607 = new CHIPUnsupportedAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1609 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1613 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1616 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1620 CHIP_ERROR err = self.cppCluster.ReadAttributeCompensationText(onSuccess->Cancel(), onFailure->Cancel());
1621 if (err != CHIP_NO_ERROR) {
1624 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1628 - (void)readAttributeColorTemperature:(ResponseHandler)completionHandler
1630 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1632 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1636 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1639 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1643 CHIP_ERROR err = self.cppCluster.ReadAttributeColorTemperature(onSuccess->Cancel(), onFailure->Cancel());
1644 if (err != CHIP_NO_ERROR) {
1647 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1651 - (void)configureAttributeColorTemperature:(uint16_t)minInterval
1652 maxInterval:(uint16_t)maxInterval
1653 change:(uint16_t)change
1654 completionHandler:(ResponseHandler)completionHandler
1656 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1658 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1662 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1665 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1669 CHIP_ERROR err = self.cppCluster.ConfigureAttributeColorTemperature(
1670 onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
1671 if (err != CHIP_NO_ERROR) {
1674 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1678 - (void)reportAttributeColorTemperature:(ResponseHandler)reportHandler
1680 CHIPInt16uAttributeCallbackBridge * onReport = new CHIPInt16uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
1682 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1686 CHIP_ERROR err = self.cppCluster.ReportAttributeColorTemperature(onReport->Cancel());
1687 if (err != CHIP_NO_ERROR) {
1689 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
1693 - (void)readAttributeColorMode:(ResponseHandler)completionHandler
1695 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1697 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1701 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1704 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1708 CHIP_ERROR err = self.cppCluster.ReadAttributeColorMode(onSuccess->Cancel(), onFailure->Cancel());
1709 if (err != CHIP_NO_ERROR) {
1712 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1716 - (void)readAttributeColorControlOptions:(ResponseHandler)completionHandler
1718 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1720 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1724 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1727 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1731 CHIP_ERROR err = self.cppCluster.ReadAttributeColorControlOptions(onSuccess->Cancel(), onFailure->Cancel());
1732 if (err != CHIP_NO_ERROR) {
1735 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1739 - (void)writeAttributeColorControlOptions:(uint8_t)value completionHandler:(ResponseHandler)completionHandler
1741 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1743 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1747 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1750 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1754 CHIP_ERROR err = self.cppCluster.WriteAttributeColorControlOptions(onSuccess->Cancel(), onFailure->Cancel(), value);
1755 if (err != CHIP_NO_ERROR) {
1758 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1762 - (void)readAttributeNumberOfPrimaries:(ResponseHandler)completionHandler
1764 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1766 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1770 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1773 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1777 CHIP_ERROR err = self.cppCluster.ReadAttributeNumberOfPrimaries(onSuccess->Cancel(), onFailure->Cancel());
1778 if (err != CHIP_NO_ERROR) {
1781 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1785 - (void)readAttributePrimary1X:(ResponseHandler)completionHandler
1787 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1789 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1793 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1796 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1800 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary1X(onSuccess->Cancel(), onFailure->Cancel());
1801 if (err != CHIP_NO_ERROR) {
1804 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1808 - (void)readAttributePrimary1Y:(ResponseHandler)completionHandler
1810 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1812 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1816 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1819 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1823 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary1Y(onSuccess->Cancel(), onFailure->Cancel());
1824 if (err != CHIP_NO_ERROR) {
1827 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1831 - (void)readAttributePrimary1Intensity:(ResponseHandler)completionHandler
1833 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1835 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1839 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1842 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1846 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary1Intensity(onSuccess->Cancel(), onFailure->Cancel());
1847 if (err != CHIP_NO_ERROR) {
1850 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1854 - (void)readAttributePrimary2X:(ResponseHandler)completionHandler
1856 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1858 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1862 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1865 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1869 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary2X(onSuccess->Cancel(), onFailure->Cancel());
1870 if (err != CHIP_NO_ERROR) {
1873 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1877 - (void)readAttributePrimary2Y:(ResponseHandler)completionHandler
1879 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1881 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1885 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1888 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1892 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary2Y(onSuccess->Cancel(), onFailure->Cancel());
1893 if (err != CHIP_NO_ERROR) {
1896 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1900 - (void)readAttributePrimary2Intensity:(ResponseHandler)completionHandler
1902 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1904 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1908 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1911 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1915 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary2Intensity(onSuccess->Cancel(), onFailure->Cancel());
1916 if (err != CHIP_NO_ERROR) {
1919 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1923 - (void)readAttributePrimary3X:(ResponseHandler)completionHandler
1925 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1927 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1931 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1934 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1938 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary3X(onSuccess->Cancel(), onFailure->Cancel());
1939 if (err != CHIP_NO_ERROR) {
1942 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1946 - (void)readAttributePrimary3Y:(ResponseHandler)completionHandler
1948 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1950 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1954 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1957 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1961 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary3Y(onSuccess->Cancel(), onFailure->Cancel());
1962 if (err != CHIP_NO_ERROR) {
1965 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1969 - (void)readAttributePrimary3Intensity:(ResponseHandler)completionHandler
1971 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1973 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1977 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1980 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1984 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary3Intensity(onSuccess->Cancel(), onFailure->Cancel());
1985 if (err != CHIP_NO_ERROR) {
1988 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1992 - (void)readAttributePrimary4X:(ResponseHandler)completionHandler
1994 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1996 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2000 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2003 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2007 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary4X(onSuccess->Cancel(), onFailure->Cancel());
2008 if (err != CHIP_NO_ERROR) {
2011 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2015 - (void)readAttributePrimary4Y:(ResponseHandler)completionHandler
2017 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2019 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2023 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2026 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2030 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary4Y(onSuccess->Cancel(), onFailure->Cancel());
2031 if (err != CHIP_NO_ERROR) {
2034 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2038 - (void)readAttributePrimary4Intensity:(ResponseHandler)completionHandler
2040 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2042 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2046 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2049 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2053 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary4Intensity(onSuccess->Cancel(), onFailure->Cancel());
2054 if (err != CHIP_NO_ERROR) {
2057 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2061 - (void)readAttributePrimary5X:(ResponseHandler)completionHandler
2063 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2065 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2069 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2072 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2076 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary5X(onSuccess->Cancel(), onFailure->Cancel());
2077 if (err != CHIP_NO_ERROR) {
2080 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2084 - (void)readAttributePrimary5Y:(ResponseHandler)completionHandler
2086 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2088 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2092 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2095 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2099 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary5Y(onSuccess->Cancel(), onFailure->Cancel());
2100 if (err != CHIP_NO_ERROR) {
2103 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2107 - (void)readAttributePrimary5Intensity:(ResponseHandler)completionHandler
2109 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2111 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2115 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2118 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2122 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary5Intensity(onSuccess->Cancel(), onFailure->Cancel());
2123 if (err != CHIP_NO_ERROR) {
2126 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2130 - (void)readAttributePrimary6X:(ResponseHandler)completionHandler
2132 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2134 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2138 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2141 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2145 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary6X(onSuccess->Cancel(), onFailure->Cancel());
2146 if (err != CHIP_NO_ERROR) {
2149 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2153 - (void)readAttributePrimary6Y:(ResponseHandler)completionHandler
2155 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2157 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2161 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2164 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2168 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary6Y(onSuccess->Cancel(), onFailure->Cancel());
2169 if (err != CHIP_NO_ERROR) {
2172 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2176 - (void)readAttributePrimary6Intensity:(ResponseHandler)completionHandler
2178 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2180 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2184 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2187 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2191 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary6Intensity(onSuccess->Cancel(), onFailure->Cancel());
2192 if (err != CHIP_NO_ERROR) {
2195 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2199 - (void)readAttributeWhitePointX:(ResponseHandler)completionHandler
2201 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2203 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2207 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2210 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2214 CHIP_ERROR err = self.cppCluster.ReadAttributeWhitePointX(onSuccess->Cancel(), onFailure->Cancel());
2215 if (err != CHIP_NO_ERROR) {
2218 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2222 - (void)writeAttributeWhitePointX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
2224 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2226 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2230 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2233 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2237 CHIP_ERROR err = self.cppCluster.WriteAttributeWhitePointX(onSuccess->Cancel(), onFailure->Cancel(), value);
2238 if (err != CHIP_NO_ERROR) {
2241 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2245 - (void)readAttributeWhitePointY:(ResponseHandler)completionHandler
2247 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2249 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2253 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2256 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2260 CHIP_ERROR err = self.cppCluster.ReadAttributeWhitePointY(onSuccess->Cancel(), onFailure->Cancel());
2261 if (err != CHIP_NO_ERROR) {
2264 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2268 - (void)writeAttributeWhitePointY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
2270 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2272 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2276 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2279 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2283 CHIP_ERROR err = self.cppCluster.WriteAttributeWhitePointY(onSuccess->Cancel(), onFailure->Cancel(), value);
2284 if (err != CHIP_NO_ERROR) {
2287 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2291 - (void)readAttributeColorPointRX:(ResponseHandler)completionHandler
2293 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2295 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2299 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2302 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2306 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointRX(onSuccess->Cancel(), onFailure->Cancel());
2307 if (err != CHIP_NO_ERROR) {
2310 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2314 - (void)writeAttributeColorPointRX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
2316 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2318 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2322 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2325 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2329 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointRX(onSuccess->Cancel(), onFailure->Cancel(), value);
2330 if (err != CHIP_NO_ERROR) {
2333 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2337 - (void)readAttributeColorPointRY:(ResponseHandler)completionHandler
2339 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2341 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2345 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2348 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2352 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointRY(onSuccess->Cancel(), onFailure->Cancel());
2353 if (err != CHIP_NO_ERROR) {
2356 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2360 - (void)writeAttributeColorPointRY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
2362 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2364 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2368 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2371 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2375 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointRY(onSuccess->Cancel(), onFailure->Cancel(), value);
2376 if (err != CHIP_NO_ERROR) {
2379 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2383 - (void)readAttributeColorPointRIntensity:(ResponseHandler)completionHandler
2385 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2387 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2391 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2394 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2398 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointRIntensity(onSuccess->Cancel(), onFailure->Cancel());
2399 if (err != CHIP_NO_ERROR) {
2402 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2406 - (void)writeAttributeColorPointRIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler
2408 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2410 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2414 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2417 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2421 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointRIntensity(onSuccess->Cancel(), onFailure->Cancel(), value);
2422 if (err != CHIP_NO_ERROR) {
2425 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2429 - (void)readAttributeColorPointGX:(ResponseHandler)completionHandler
2431 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2433 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2437 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2440 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2444 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointGX(onSuccess->Cancel(), onFailure->Cancel());
2445 if (err != CHIP_NO_ERROR) {
2448 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2452 - (void)writeAttributeColorPointGX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
2454 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2456 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2460 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2463 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2467 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointGX(onSuccess->Cancel(), onFailure->Cancel(), value);
2468 if (err != CHIP_NO_ERROR) {
2471 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2475 - (void)readAttributeColorPointGY:(ResponseHandler)completionHandler
2477 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2479 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2483 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2486 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2490 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointGY(onSuccess->Cancel(), onFailure->Cancel());
2491 if (err != CHIP_NO_ERROR) {
2494 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2498 - (void)writeAttributeColorPointGY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
2500 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2502 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2506 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2509 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2513 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointGY(onSuccess->Cancel(), onFailure->Cancel(), value);
2514 if (err != CHIP_NO_ERROR) {
2517 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2521 - (void)readAttributeColorPointGIntensity:(ResponseHandler)completionHandler
2523 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2525 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2529 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2532 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2536 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointGIntensity(onSuccess->Cancel(), onFailure->Cancel());
2537 if (err != CHIP_NO_ERROR) {
2540 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2544 - (void)writeAttributeColorPointGIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler
2546 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2548 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2552 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2555 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2559 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointGIntensity(onSuccess->Cancel(), onFailure->Cancel(), value);
2560 if (err != CHIP_NO_ERROR) {
2563 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2567 - (void)readAttributeColorPointBX:(ResponseHandler)completionHandler
2569 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2571 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2575 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2578 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2582 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointBX(onSuccess->Cancel(), onFailure->Cancel());
2583 if (err != CHIP_NO_ERROR) {
2586 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2590 - (void)writeAttributeColorPointBX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
2592 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2594 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2598 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2601 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2605 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointBX(onSuccess->Cancel(), onFailure->Cancel(), value);
2606 if (err != CHIP_NO_ERROR) {
2609 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2613 - (void)readAttributeColorPointBY:(ResponseHandler)completionHandler
2615 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2617 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2621 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2624 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2628 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointBY(onSuccess->Cancel(), onFailure->Cancel());
2629 if (err != CHIP_NO_ERROR) {
2632 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2636 - (void)writeAttributeColorPointBY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
2638 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2640 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2644 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2647 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2651 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointBY(onSuccess->Cancel(), onFailure->Cancel(), value);
2652 if (err != CHIP_NO_ERROR) {
2655 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2659 - (void)readAttributeColorPointBIntensity:(ResponseHandler)completionHandler
2661 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2663 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2667 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2670 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2674 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointBIntensity(onSuccess->Cancel(), onFailure->Cancel());
2675 if (err != CHIP_NO_ERROR) {
2678 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2682 - (void)writeAttributeColorPointBIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler
2684 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2686 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2690 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2693 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2697 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointBIntensity(onSuccess->Cancel(), onFailure->Cancel(), value);
2698 if (err != CHIP_NO_ERROR) {
2701 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2705 - (void)readAttributeEnhancedCurrentHue:(ResponseHandler)completionHandler
2707 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2709 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2713 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2716 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2720 CHIP_ERROR err = self.cppCluster.ReadAttributeEnhancedCurrentHue(onSuccess->Cancel(), onFailure->Cancel());
2721 if (err != CHIP_NO_ERROR) {
2724 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2728 - (void)readAttributeEnhancedColorMode:(ResponseHandler)completionHandler
2730 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2732 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2736 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2739 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2743 CHIP_ERROR err = self.cppCluster.ReadAttributeEnhancedColorMode(onSuccess->Cancel(), onFailure->Cancel());
2744 if (err != CHIP_NO_ERROR) {
2747 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2751 - (void)readAttributeColorLoopActive:(ResponseHandler)completionHandler
2753 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2755 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2759 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2762 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2766 CHIP_ERROR err = self.cppCluster.ReadAttributeColorLoopActive(onSuccess->Cancel(), onFailure->Cancel());
2767 if (err != CHIP_NO_ERROR) {
2770 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2774 - (void)readAttributeColorLoopDirection:(ResponseHandler)completionHandler
2776 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2778 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2782 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2785 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2789 CHIP_ERROR err = self.cppCluster.ReadAttributeColorLoopDirection(onSuccess->Cancel(), onFailure->Cancel());
2790 if (err != CHIP_NO_ERROR) {
2793 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2797 - (void)readAttributeColorLoopTime:(ResponseHandler)completionHandler
2799 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2801 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2805 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2808 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2812 CHIP_ERROR err = self.cppCluster.ReadAttributeColorLoopTime(onSuccess->Cancel(), onFailure->Cancel());
2813 if (err != CHIP_NO_ERROR) {
2816 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2820 - (void)readAttributeColorCapabilities:(ResponseHandler)completionHandler
2822 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2824 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2828 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2831 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2835 CHIP_ERROR err = self.cppCluster.ReadAttributeColorCapabilities(onSuccess->Cancel(), onFailure->Cancel());
2836 if (err != CHIP_NO_ERROR) {
2839 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2843 - (void)readAttributeColorTempPhysicalMin:(ResponseHandler)completionHandler
2845 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2847 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2851 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2854 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2858 CHIP_ERROR err = self.cppCluster.ReadAttributeColorTempPhysicalMin(onSuccess->Cancel(), onFailure->Cancel());
2859 if (err != CHIP_NO_ERROR) {
2862 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2866 - (void)readAttributeColorTempPhysicalMax:(ResponseHandler)completionHandler
2868 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2870 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2874 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2877 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2881 CHIP_ERROR err = self.cppCluster.ReadAttributeColorTempPhysicalMax(onSuccess->Cancel(), onFailure->Cancel());
2882 if (err != CHIP_NO_ERROR) {
2885 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2889 - (void)readAttributeCoupleColorTempToLevelMinMireds:(ResponseHandler)completionHandler
2891 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2893 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2897 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2900 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2904 CHIP_ERROR err = self.cppCluster.ReadAttributeCoupleColorTempToLevelMinMireds(onSuccess->Cancel(), onFailure->Cancel());
2905 if (err != CHIP_NO_ERROR) {
2908 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2912 - (void)readAttributeStartUpColorTemperatureMireds:(ResponseHandler)completionHandler
2914 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2916 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2920 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2923 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2927 CHIP_ERROR err = self.cppCluster.ReadAttributeStartUpColorTemperatureMireds(onSuccess->Cancel(), onFailure->Cancel());
2928 if (err != CHIP_NO_ERROR) {
2931 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2935 - (void)writeAttributeStartUpColorTemperatureMireds:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
2937 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2939 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2943 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2946 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2950 CHIP_ERROR err = self.cppCluster.WriteAttributeStartUpColorTemperatureMireds(onSuccess->Cancel(), onFailure->Cancel(), value);
2951 if (err != CHIP_NO_ERROR) {
2954 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2958 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
2960 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2962 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2966 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2969 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2973 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
2974 if (err != CHIP_NO_ERROR) {
2977 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2983 @interface CHIPContentLaunch ()
2984 @property (readonly) Controller::ContentLaunchCluster cppCluster;
2987 @implementation CHIPContentLaunch
2989 - (Controller::ClusterBase *)getCluster
2991 return &_cppCluster;
2994 - (void)launchContent:(ResponseHandler)completionHandler
2996 CHIPContentLaunchClusterLaunchContentResponseCallbackBridge * onSuccess
2997 = new CHIPContentLaunchClusterLaunchContentResponseCallbackBridge(completionHandler, [self callbackQueue]);
2999 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3003 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3006 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3010 CHIP_ERROR err = self.cppCluster.LaunchContent(onSuccess->Cancel(), onFailure->Cancel());
3011 if (err != CHIP_NO_ERROR) {
3014 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3017 - (void)launchURL:(ResponseHandler)completionHandler
3019 CHIPContentLaunchClusterLaunchURLResponseCallbackBridge * onSuccess
3020 = new CHIPContentLaunchClusterLaunchURLResponseCallbackBridge(completionHandler, [self callbackQueue]);
3022 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3026 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3029 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3033 CHIP_ERROR err = self.cppCluster.LaunchURL(onSuccess->Cancel(), onFailure->Cancel());
3034 if (err != CHIP_NO_ERROR) {
3037 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3041 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
3043 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3045 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3049 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3052 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3056 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
3057 if (err != CHIP_NO_ERROR) {
3060 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3066 @interface CHIPDoorLock ()
3067 @property (readonly) Controller::DoorLockCluster cppCluster;
3070 @implementation CHIPDoorLock
3072 - (Controller::ClusterBase *)getCluster
3074 return &_cppCluster;
3077 - (void)clearAllPins:(ResponseHandler)completionHandler
3079 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3081 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3085 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3088 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3092 CHIP_ERROR err = self.cppCluster.ClearAllPins(onSuccess->Cancel(), onFailure->Cancel());
3093 if (err != CHIP_NO_ERROR) {
3096 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3099 - (void)clearAllRfids:(ResponseHandler)completionHandler
3101 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3103 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3107 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3110 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3114 CHIP_ERROR err = self.cppCluster.ClearAllRfids(onSuccess->Cancel(), onFailure->Cancel());
3115 if (err != CHIP_NO_ERROR) {
3118 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3121 - (void)clearHolidaySchedule:(uint8_t)scheduleId completionHandler:(ResponseHandler)completionHandler
3123 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3125 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3129 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3132 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3136 CHIP_ERROR err = self.cppCluster.ClearHolidaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId);
3137 if (err != CHIP_NO_ERROR) {
3140 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3143 - (void)clearPin:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
3145 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3147 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3151 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3154 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3158 CHIP_ERROR err = self.cppCluster.ClearPin(onSuccess->Cancel(), onFailure->Cancel(), userId);
3159 if (err != CHIP_NO_ERROR) {
3162 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3165 - (void)clearRfid:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
3167 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3169 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3173 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3176 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3180 CHIP_ERROR err = self.cppCluster.ClearRfid(onSuccess->Cancel(), onFailure->Cancel(), userId);
3181 if (err != CHIP_NO_ERROR) {
3184 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3187 - (void)clearWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
3189 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3191 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3195 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3198 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3202 CHIP_ERROR err = self.cppCluster.ClearWeekdaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId);
3203 if (err != CHIP_NO_ERROR) {
3206 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3209 - (void)clearYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
3211 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3213 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3217 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3220 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3224 CHIP_ERROR err = self.cppCluster.ClearYeardaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId);
3225 if (err != CHIP_NO_ERROR) {
3228 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3231 - (void)getHolidaySchedule:(uint8_t)scheduleId completionHandler:(ResponseHandler)completionHandler
3233 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3235 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3239 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3242 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3246 CHIP_ERROR err = self.cppCluster.GetHolidaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId);
3247 if (err != CHIP_NO_ERROR) {
3250 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3253 - (void)getLogRecord:(uint16_t)logIndex completionHandler:(ResponseHandler)completionHandler
3255 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3257 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3261 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3264 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3268 CHIP_ERROR err = self.cppCluster.GetLogRecord(onSuccess->Cancel(), onFailure->Cancel(), logIndex);
3269 if (err != CHIP_NO_ERROR) {
3272 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3275 - (void)getPin:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
3277 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3279 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3283 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3286 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3290 CHIP_ERROR err = self.cppCluster.GetPin(onSuccess->Cancel(), onFailure->Cancel(), userId);
3291 if (err != CHIP_NO_ERROR) {
3294 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3297 - (void)getRfid:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
3299 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3301 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3305 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3308 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3312 CHIP_ERROR err = self.cppCluster.GetRfid(onSuccess->Cancel(), onFailure->Cancel(), userId);
3313 if (err != CHIP_NO_ERROR) {
3316 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3319 - (void)getUserType:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
3321 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3323 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3327 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3330 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3334 CHIP_ERROR err = self.cppCluster.GetUserType(onSuccess->Cancel(), onFailure->Cancel(), userId);
3335 if (err != CHIP_NO_ERROR) {
3338 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3341 - (void)getWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
3343 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3345 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3349 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3352 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3356 CHIP_ERROR err = self.cppCluster.GetWeekdaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId);
3357 if (err != CHIP_NO_ERROR) {
3360 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3363 - (void)getYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
3365 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3367 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3371 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3374 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3378 CHIP_ERROR err = self.cppCluster.GetYeardaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId);
3379 if (err != CHIP_NO_ERROR) {
3382 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3385 - (void)lockDoor:(char *)pin completionHandler:(ResponseHandler)completionHandler
3387 CHIPDoorLockClusterLockDoorResponseCallbackBridge * onSuccess
3388 = new CHIPDoorLockClusterLockDoorResponseCallbackBridge(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.LockDoor(onSuccess->Cancel(), onFailure->Cancel(), pin);
3402 if (err != CHIP_NO_ERROR) {
3405 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3408 - (void)setHolidaySchedule:(uint8_t)scheduleId
3409 localStartTime:(uint32_t)localStartTime
3410 localEndTime:(uint32_t)localEndTime
3411 operatingModeDuringHoliday:(uint8_t)operatingModeDuringHoliday
3412 completionHandler:(ResponseHandler)completionHandler
3414 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3416 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3420 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3423 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3427 CHIP_ERROR err = self.cppCluster.SetHolidaySchedule(
3428 onSuccess->Cancel(), onFailure->Cancel(), scheduleId, localStartTime, localEndTime, operatingModeDuringHoliday);
3429 if (err != CHIP_NO_ERROR) {
3432 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3435 - (void)setPin:(uint16_t)userId
3436 userStatus:(uint8_t)userStatus
3437 userType:(uint8_t)userType
3439 completionHandler:(ResponseHandler)completionHandler
3441 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3443 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3447 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3450 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3454 CHIP_ERROR err = self.cppCluster.SetPin(onSuccess->Cancel(), onFailure->Cancel(), userId, userStatus, userType, pin);
3455 if (err != CHIP_NO_ERROR) {
3458 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3461 - (void)setRfid:(uint16_t)userId
3462 userStatus:(uint8_t)userStatus
3463 userType:(uint8_t)userType
3465 completionHandler:(ResponseHandler)completionHandler
3467 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3469 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3473 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3476 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3480 CHIP_ERROR err = self.cppCluster.SetRfid(onSuccess->Cancel(), onFailure->Cancel(), userId, userStatus, userType, id);
3481 if (err != CHIP_NO_ERROR) {
3484 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3487 - (void)setUserType:(uint16_t)userId userType:(uint8_t)userType completionHandler:(ResponseHandler)completionHandler
3489 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3491 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3495 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3498 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3502 CHIP_ERROR err = self.cppCluster.SetUserType(onSuccess->Cancel(), onFailure->Cancel(), userId, userType);
3503 if (err != CHIP_NO_ERROR) {
3506 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3509 - (void)setWeekdaySchedule:(uint8_t)scheduleId
3510 userId:(uint16_t)userId
3511 daysMask:(uint8_t)daysMask
3512 startHour:(uint8_t)startHour
3513 startMinute:(uint8_t)startMinute
3514 endHour:(uint8_t)endHour
3515 endMinute:(uint8_t)endMinute
3516 completionHandler:(ResponseHandler)completionHandler
3518 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3520 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3524 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3527 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3531 CHIP_ERROR err = self.cppCluster.SetWeekdaySchedule(
3532 onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId, daysMask, startHour, startMinute, endHour, endMinute);
3533 if (err != CHIP_NO_ERROR) {
3536 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3539 - (void)setYeardaySchedule:(uint8_t)scheduleId
3540 userId:(uint16_t)userId
3541 localStartTime:(uint32_t)localStartTime
3542 localEndTime:(uint32_t)localEndTime
3543 completionHandler:(ResponseHandler)completionHandler
3545 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3547 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3551 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3554 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3558 CHIP_ERROR err = self.cppCluster.SetYeardaySchedule(
3559 onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId, localStartTime, localEndTime);
3560 if (err != CHIP_NO_ERROR) {
3563 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3566 - (void)unlockDoor:(char *)pin completionHandler:(ResponseHandler)completionHandler
3568 CHIPDoorLockClusterUnlockDoorResponseCallbackBridge * onSuccess
3569 = new CHIPDoorLockClusterUnlockDoorResponseCallbackBridge(completionHandler, [self callbackQueue]);
3571 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3575 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3578 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3582 CHIP_ERROR err = self.cppCluster.UnlockDoor(onSuccess->Cancel(), onFailure->Cancel(), pin);
3583 if (err != CHIP_NO_ERROR) {
3586 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3589 - (void)unlockWithTimeout:(uint16_t)timeoutInSeconds pin:(char *)pin completionHandler:(ResponseHandler)completionHandler
3591 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3593 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3597 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3600 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3604 CHIP_ERROR err = self.cppCluster.UnlockWithTimeout(onSuccess->Cancel(), onFailure->Cancel(), timeoutInSeconds, pin);
3605 if (err != CHIP_NO_ERROR) {
3608 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3612 - (void)readAttributeLockState:(ResponseHandler)completionHandler
3614 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3616 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3620 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3623 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3627 CHIP_ERROR err = self.cppCluster.ReadAttributeLockState(onSuccess->Cancel(), onFailure->Cancel());
3628 if (err != CHIP_NO_ERROR) {
3631 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3635 - (void)configureAttributeLockState:(uint16_t)minInterval
3636 maxInterval:(uint16_t)maxInterval
3637 completionHandler:(ResponseHandler)completionHandler
3639 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3641 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3645 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3648 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3653 = self.cppCluster.ConfigureAttributeLockState(onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval);
3654 if (err != CHIP_NO_ERROR) {
3657 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3661 - (void)reportAttributeLockState:(ResponseHandler)reportHandler
3663 CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
3665 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3669 CHIP_ERROR err = self.cppCluster.ReportAttributeLockState(onReport->Cancel());
3670 if (err != CHIP_NO_ERROR) {
3672 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
3676 - (void)readAttributeLockType:(ResponseHandler)completionHandler
3678 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3680 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3684 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3687 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3691 CHIP_ERROR err = self.cppCluster.ReadAttributeLockType(onSuccess->Cancel(), onFailure->Cancel());
3692 if (err != CHIP_NO_ERROR) {
3695 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3699 - (void)readAttributeActuatorEnabled:(ResponseHandler)completionHandler
3701 CHIPBooleanAttributeCallbackBridge * onSuccess
3702 = new CHIPBooleanAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3704 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3708 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3711 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3715 CHIP_ERROR err = self.cppCluster.ReadAttributeActuatorEnabled(onSuccess->Cancel(), onFailure->Cancel());
3716 if (err != CHIP_NO_ERROR) {
3719 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3723 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
3725 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3727 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3731 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3734 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3738 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
3739 if (err != CHIP_NO_ERROR) {
3742 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3748 @interface CHIPGeneralCommissioning ()
3749 @property (readonly) Controller::GeneralCommissioningCluster cppCluster;
3752 @implementation CHIPGeneralCommissioning
3754 - (Controller::ClusterBase *)getCluster
3756 return &_cppCluster;
3759 - (void)armFailSafe:(uint16_t)expiryLengthSeconds
3760 breadcrumb:(uint64_t)breadcrumb
3761 timeoutMs:(uint32_t)timeoutMs
3762 completionHandler:(ResponseHandler)completionHandler
3764 CHIPGeneralCommissioningClusterArmFailSafeResponseCallbackBridge * onSuccess
3765 = new CHIPGeneralCommissioningClusterArmFailSafeResponseCallbackBridge(completionHandler, [self callbackQueue]);
3767 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3771 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3774 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3779 = self.cppCluster.ArmFailSafe(onSuccess->Cancel(), onFailure->Cancel(), expiryLengthSeconds, breadcrumb, timeoutMs);
3780 if (err != CHIP_NO_ERROR) {
3783 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3786 - (void)commissioningComplete:(ResponseHandler)completionHandler
3788 CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge * onSuccess
3789 = new CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge(completionHandler, [self callbackQueue]);
3791 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3795 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3798 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3802 CHIP_ERROR err = self.cppCluster.CommissioningComplete(onSuccess->Cancel(), onFailure->Cancel());
3803 if (err != CHIP_NO_ERROR) {
3806 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3809 - (void)setFabric:(NSData *)fabricId
3810 fabricSecret:(NSData *)fabricSecret
3811 breadcrumb:(uint64_t)breadcrumb
3812 timeoutMs:(uint32_t)timeoutMs
3813 completionHandler:(ResponseHandler)completionHandler
3815 CHIPGeneralCommissioningClusterSetFabricResponseCallbackBridge * onSuccess
3816 = new CHIPGeneralCommissioningClusterSetFabricResponseCallbackBridge(completionHandler, [self callbackQueue]);
3818 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3822 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3825 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3829 CHIP_ERROR err = self.cppCluster.SetFabric(onSuccess->Cancel(), onFailure->Cancel(),
3830 chip::ByteSpan((const uint8_t *) fabricId.bytes, fabricId.length),
3831 chip::ByteSpan((const uint8_t *) fabricSecret.bytes, fabricSecret.length), breadcrumb, timeoutMs);
3832 if (err != CHIP_NO_ERROR) {
3835 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3839 - (void)readAttributeFabricId:(ResponseHandler)completionHandler
3841 CHIPUnsupportedAttributeCallbackBridge * onSuccess
3842 = new CHIPUnsupportedAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3844 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3848 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3851 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3855 CHIP_ERROR err = self.cppCluster.ReadAttributeFabricId(onSuccess->Cancel(), onFailure->Cancel());
3856 if (err != CHIP_NO_ERROR) {
3859 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3863 - (void)readAttributeBreadcrumb:(ResponseHandler)completionHandler
3865 CHIPInt64uAttributeCallbackBridge * onSuccess = new CHIPInt64uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3867 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3871 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3874 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3878 CHIP_ERROR err = self.cppCluster.ReadAttributeBreadcrumb(onSuccess->Cancel(), onFailure->Cancel());
3879 if (err != CHIP_NO_ERROR) {
3882 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3886 - (void)writeAttributeBreadcrumb:(uint64_t)value completionHandler:(ResponseHandler)completionHandler
3888 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3890 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3894 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3897 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3901 CHIP_ERROR err = self.cppCluster.WriteAttributeBreadcrumb(onSuccess->Cancel(), onFailure->Cancel(), value);
3902 if (err != CHIP_NO_ERROR) {
3905 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3909 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
3911 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(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.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
3925 if (err != CHIP_NO_ERROR) {
3928 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3934 @interface CHIPGroups ()
3935 @property (readonly) Controller::GroupsCluster cppCluster;
3938 @implementation CHIPGroups
3940 - (Controller::ClusterBase *)getCluster
3942 return &_cppCluster;
3945 - (void)addGroup:(uint16_t)groupId groupName:(char *)groupName completionHandler:(ResponseHandler)completionHandler
3947 CHIPGroupsClusterAddGroupResponseCallbackBridge * onSuccess
3948 = new CHIPGroupsClusterAddGroupResponseCallbackBridge(completionHandler, [self callbackQueue]);
3950 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3954 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3957 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3961 CHIP_ERROR err = self.cppCluster.AddGroup(onSuccess->Cancel(), onFailure->Cancel(), groupId, groupName);
3962 if (err != CHIP_NO_ERROR) {
3965 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3968 - (void)addGroupIfIdentifying:(uint16_t)groupId groupName:(char *)groupName completionHandler:(ResponseHandler)completionHandler
3970 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3972 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3976 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3979 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3983 CHIP_ERROR err = self.cppCluster.AddGroupIfIdentifying(onSuccess->Cancel(), onFailure->Cancel(), groupId, groupName);
3984 if (err != CHIP_NO_ERROR) {
3987 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3990 - (void)getGroupMembership:(uint8_t)groupCount groupList:(uint16_t)groupList completionHandler:(ResponseHandler)completionHandler
3992 CHIPGroupsClusterGetGroupMembershipResponseCallbackBridge * onSuccess
3993 = new CHIPGroupsClusterGetGroupMembershipResponseCallbackBridge(completionHandler, [self callbackQueue]);
3995 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3999 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4002 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4006 CHIP_ERROR err = self.cppCluster.GetGroupMembership(onSuccess->Cancel(), onFailure->Cancel(), groupCount, groupList);
4007 if (err != CHIP_NO_ERROR) {
4010 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4013 - (void)removeAllGroups:(ResponseHandler)completionHandler
4015 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4017 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4021 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4024 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4028 CHIP_ERROR err = self.cppCluster.RemoveAllGroups(onSuccess->Cancel(), onFailure->Cancel());
4029 if (err != CHIP_NO_ERROR) {
4032 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4035 - (void)removeGroup:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler
4037 CHIPGroupsClusterRemoveGroupResponseCallbackBridge * onSuccess
4038 = new CHIPGroupsClusterRemoveGroupResponseCallbackBridge(completionHandler, [self callbackQueue]);
4040 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4044 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4047 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4051 CHIP_ERROR err = self.cppCluster.RemoveGroup(onSuccess->Cancel(), onFailure->Cancel(), groupId);
4052 if (err != CHIP_NO_ERROR) {
4055 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4058 - (void)viewGroup:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler
4060 CHIPGroupsClusterViewGroupResponseCallbackBridge * onSuccess
4061 = new CHIPGroupsClusterViewGroupResponseCallbackBridge(completionHandler, [self callbackQueue]);
4063 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4067 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4070 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4074 CHIP_ERROR err = self.cppCluster.ViewGroup(onSuccess->Cancel(), onFailure->Cancel(), groupId);
4075 if (err != CHIP_NO_ERROR) {
4078 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4082 - (void)readAttributeNameSupport:(ResponseHandler)completionHandler
4084 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4086 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4090 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4093 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4097 CHIP_ERROR err = self.cppCluster.ReadAttributeNameSupport(onSuccess->Cancel(), onFailure->Cancel());
4098 if (err != CHIP_NO_ERROR) {
4101 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4105 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
4107 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4109 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4113 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4116 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4120 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
4121 if (err != CHIP_NO_ERROR) {
4124 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4130 @interface CHIPIasZone ()
4131 @property (readonly) Controller::IasZoneCluster cppCluster;
4134 @implementation CHIPIasZone
4136 - (Controller::ClusterBase *)getCluster
4138 return &_cppCluster;
4141 - (void)readAttributeZoneState:(ResponseHandler)completionHandler
4143 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4145 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4149 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4152 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4156 CHIP_ERROR err = self.cppCluster.ReadAttributeZoneState(onSuccess->Cancel(), onFailure->Cancel());
4157 if (err != CHIP_NO_ERROR) {
4160 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4164 - (void)readAttributeZoneType:(ResponseHandler)completionHandler
4166 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4168 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4172 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4175 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4179 CHIP_ERROR err = self.cppCluster.ReadAttributeZoneType(onSuccess->Cancel(), onFailure->Cancel());
4180 if (err != CHIP_NO_ERROR) {
4183 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4187 - (void)readAttributeZoneStatus:(ResponseHandler)completionHandler
4189 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4191 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4195 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4198 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4202 CHIP_ERROR err = self.cppCluster.ReadAttributeZoneStatus(onSuccess->Cancel(), onFailure->Cancel());
4203 if (err != CHIP_NO_ERROR) {
4206 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4210 - (void)readAttributeIasCieAddress:(ResponseHandler)completionHandler
4212 CHIPInt64uAttributeCallbackBridge * onSuccess = new CHIPInt64uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4214 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4218 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4221 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4225 CHIP_ERROR err = self.cppCluster.ReadAttributeIasCieAddress(onSuccess->Cancel(), onFailure->Cancel());
4226 if (err != CHIP_NO_ERROR) {
4229 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4233 - (void)writeAttributeIasCieAddress:(uint64_t)value completionHandler:(ResponseHandler)completionHandler
4235 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4237 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4241 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4244 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4248 CHIP_ERROR err = self.cppCluster.WriteAttributeIasCieAddress(onSuccess->Cancel(), onFailure->Cancel(), value);
4249 if (err != CHIP_NO_ERROR) {
4252 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4256 - (void)readAttributeZoneId:(ResponseHandler)completionHandler
4258 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4260 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4264 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4267 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4271 CHIP_ERROR err = self.cppCluster.ReadAttributeZoneId(onSuccess->Cancel(), onFailure->Cancel());
4272 if (err != CHIP_NO_ERROR) {
4275 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4279 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
4281 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4283 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4287 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4290 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4294 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
4295 if (err != CHIP_NO_ERROR) {
4298 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4304 @interface CHIPIdentify ()
4305 @property (readonly) Controller::IdentifyCluster cppCluster;
4308 @implementation CHIPIdentify
4310 - (Controller::ClusterBase *)getCluster
4312 return &_cppCluster;
4315 - (void)identify:(uint16_t)identifyTime completionHandler:(ResponseHandler)completionHandler
4317 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4319 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4323 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4326 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4330 CHIP_ERROR err = self.cppCluster.Identify(onSuccess->Cancel(), onFailure->Cancel(), identifyTime);
4331 if (err != CHIP_NO_ERROR) {
4334 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4337 - (void)identifyQuery:(ResponseHandler)completionHandler
4339 CHIPIdentifyClusterIdentifyQueryResponseCallbackBridge * onSuccess
4340 = new CHIPIdentifyClusterIdentifyQueryResponseCallbackBridge(completionHandler, [self callbackQueue]);
4342 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4346 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4349 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4353 CHIP_ERROR err = self.cppCluster.IdentifyQuery(onSuccess->Cancel(), onFailure->Cancel());
4354 if (err != CHIP_NO_ERROR) {
4357 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4361 - (void)readAttributeIdentifyTime:(ResponseHandler)completionHandler
4363 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4365 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4369 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4372 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4376 CHIP_ERROR err = self.cppCluster.ReadAttributeIdentifyTime(onSuccess->Cancel(), onFailure->Cancel());
4377 if (err != CHIP_NO_ERROR) {
4380 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4384 - (void)writeAttributeIdentifyTime:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
4386 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4388 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4392 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4395 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4399 CHIP_ERROR err = self.cppCluster.WriteAttributeIdentifyTime(onSuccess->Cancel(), onFailure->Cancel(), value);
4400 if (err != CHIP_NO_ERROR) {
4403 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4407 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
4409 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4411 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4415 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4418 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4422 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
4423 if (err != CHIP_NO_ERROR) {
4426 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4432 @interface CHIPLevelControl ()
4433 @property (readonly) Controller::LevelControlCluster cppCluster;
4436 @implementation CHIPLevelControl
4438 - (Controller::ClusterBase *)getCluster
4440 return &_cppCluster;
4443 - (void)move:(uint8_t)moveMode
4445 optionMask:(uint8_t)optionMask
4446 optionOverride:(uint8_t)optionOverride
4447 completionHandler:(ResponseHandler)completionHandler
4449 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4451 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4455 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4458 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4462 CHIP_ERROR err = self.cppCluster.Move(onSuccess->Cancel(), onFailure->Cancel(), moveMode, rate, optionMask, optionOverride);
4463 if (err != CHIP_NO_ERROR) {
4466 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4469 - (void)moveToLevel:(uint8_t)level
4470 transitionTime:(uint16_t)transitionTime
4471 optionMask:(uint8_t)optionMask
4472 optionOverride:(uint8_t)optionOverride
4473 completionHandler:(ResponseHandler)completionHandler
4475 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4477 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4481 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4484 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4489 = self.cppCluster.MoveToLevel(onSuccess->Cancel(), onFailure->Cancel(), level, transitionTime, optionMask, optionOverride);
4490 if (err != CHIP_NO_ERROR) {
4493 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4496 - (void)moveToLevelWithOnOff:(uint8_t)level
4497 transitionTime:(uint16_t)transitionTime
4498 completionHandler:(ResponseHandler)completionHandler
4500 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4502 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4506 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4509 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4513 CHIP_ERROR err = self.cppCluster.MoveToLevelWithOnOff(onSuccess->Cancel(), onFailure->Cancel(), level, transitionTime);
4514 if (err != CHIP_NO_ERROR) {
4517 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4520 - (void)moveWithOnOff:(uint8_t)moveMode rate:(uint8_t)rate completionHandler:(ResponseHandler)completionHandler
4522 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4524 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4528 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4531 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4535 CHIP_ERROR err = self.cppCluster.MoveWithOnOff(onSuccess->Cancel(), onFailure->Cancel(), moveMode, rate);
4536 if (err != CHIP_NO_ERROR) {
4539 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4542 - (void)step:(uint8_t)stepMode
4543 stepSize:(uint8_t)stepSize
4544 transitionTime:(uint16_t)transitionTime
4545 optionMask:(uint8_t)optionMask
4546 optionOverride:(uint8_t)optionOverride
4547 completionHandler:(ResponseHandler)completionHandler
4549 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4551 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4555 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4558 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4562 CHIP_ERROR err = self.cppCluster.Step(
4563 onSuccess->Cancel(), onFailure->Cancel(), stepMode, stepSize, transitionTime, optionMask, optionOverride);
4564 if (err != CHIP_NO_ERROR) {
4567 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4570 - (void)stepWithOnOff:(uint8_t)stepMode
4571 stepSize:(uint8_t)stepSize
4572 transitionTime:(uint16_t)transitionTime
4573 completionHandler:(ResponseHandler)completionHandler
4575 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4577 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4581 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4584 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4588 CHIP_ERROR err = self.cppCluster.StepWithOnOff(onSuccess->Cancel(), onFailure->Cancel(), stepMode, stepSize, transitionTime);
4589 if (err != CHIP_NO_ERROR) {
4592 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4595 - (void)stop:(uint8_t)optionMask optionOverride:(uint8_t)optionOverride completionHandler:(ResponseHandler)completionHandler
4597 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4599 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4603 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4606 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4610 CHIP_ERROR err = self.cppCluster.Stop(onSuccess->Cancel(), onFailure->Cancel(), optionMask, optionOverride);
4611 if (err != CHIP_NO_ERROR) {
4614 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4617 - (void)stopWithOnOff:(ResponseHandler)completionHandler
4619 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4621 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4625 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4628 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4632 CHIP_ERROR err = self.cppCluster.StopWithOnOff(onSuccess->Cancel(), onFailure->Cancel());
4633 if (err != CHIP_NO_ERROR) {
4636 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4640 - (void)readAttributeCurrentLevel:(ResponseHandler)completionHandler
4642 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4644 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4648 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4651 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4655 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentLevel(onSuccess->Cancel(), onFailure->Cancel());
4656 if (err != CHIP_NO_ERROR) {
4659 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4663 - (void)configureAttributeCurrentLevel:(uint16_t)minInterval
4664 maxInterval:(uint16_t)maxInterval
4665 change:(uint8_t)change
4666 completionHandler:(ResponseHandler)completionHandler
4668 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4670 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4674 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4677 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4681 CHIP_ERROR err = self.cppCluster.ConfigureAttributeCurrentLevel(
4682 onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
4683 if (err != CHIP_NO_ERROR) {
4686 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4690 - (void)reportAttributeCurrentLevel:(ResponseHandler)reportHandler
4692 CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
4694 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4698 CHIP_ERROR err = self.cppCluster.ReportAttributeCurrentLevel(onReport->Cancel());
4699 if (err != CHIP_NO_ERROR) {
4701 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
4705 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
4707 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4709 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4713 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4716 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4720 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
4721 if (err != CHIP_NO_ERROR) {
4724 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4730 @interface CHIPLowPower ()
4731 @property (readonly) Controller::LowPowerCluster cppCluster;
4734 @implementation CHIPLowPower
4736 - (Controller::ClusterBase *)getCluster
4738 return &_cppCluster;
4741 - (void)sleep:(ResponseHandler)completionHandler
4743 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4745 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4749 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4752 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4756 CHIP_ERROR err = self.cppCluster.Sleep(onSuccess->Cancel(), onFailure->Cancel());
4757 if (err != CHIP_NO_ERROR) {
4760 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4764 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
4766 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4768 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4772 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4775 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4779 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
4780 if (err != CHIP_NO_ERROR) {
4783 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4789 @interface CHIPMediaPlayback ()
4790 @property (readonly) Controller::MediaPlaybackCluster cppCluster;
4793 @implementation CHIPMediaPlayback
4795 - (Controller::ClusterBase *)getCluster
4797 return &_cppCluster;
4800 - (void)fastForwardRequest:(ResponseHandler)completionHandler
4802 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4804 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4808 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4811 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4815 CHIP_ERROR err = self.cppCluster.FastForwardRequest(onSuccess->Cancel(), onFailure->Cancel());
4816 if (err != CHIP_NO_ERROR) {
4819 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4822 - (void)nextRequest:(ResponseHandler)completionHandler
4824 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4826 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4830 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4833 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4837 CHIP_ERROR err = self.cppCluster.NextRequest(onSuccess->Cancel(), onFailure->Cancel());
4838 if (err != CHIP_NO_ERROR) {
4841 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4844 - (void)pauseRequest:(ResponseHandler)completionHandler
4846 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4848 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4852 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4855 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4859 CHIP_ERROR err = self.cppCluster.PauseRequest(onSuccess->Cancel(), onFailure->Cancel());
4860 if (err != CHIP_NO_ERROR) {
4863 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4866 - (void)playRequest:(ResponseHandler)completionHandler
4868 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4870 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4874 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4877 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4881 CHIP_ERROR err = self.cppCluster.PlayRequest(onSuccess->Cancel(), onFailure->Cancel());
4882 if (err != CHIP_NO_ERROR) {
4885 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4888 - (void)previousRequest:(ResponseHandler)completionHandler
4890 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4892 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4896 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4899 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4903 CHIP_ERROR err = self.cppCluster.PreviousRequest(onSuccess->Cancel(), onFailure->Cancel());
4904 if (err != CHIP_NO_ERROR) {
4907 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4910 - (void)rewindRequest:(ResponseHandler)completionHandler
4912 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4914 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4918 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4921 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4925 CHIP_ERROR err = self.cppCluster.RewindRequest(onSuccess->Cancel(), onFailure->Cancel());
4926 if (err != CHIP_NO_ERROR) {
4929 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4932 - (void)skipBackwardRequest:(ResponseHandler)completionHandler
4934 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4936 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4940 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4943 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4947 CHIP_ERROR err = self.cppCluster.SkipBackwardRequest(onSuccess->Cancel(), onFailure->Cancel());
4948 if (err != CHIP_NO_ERROR) {
4951 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4954 - (void)skipForwardRequest:(ResponseHandler)completionHandler
4956 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4958 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4962 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4965 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4969 CHIP_ERROR err = self.cppCluster.SkipForwardRequest(onSuccess->Cancel(), onFailure->Cancel());
4970 if (err != CHIP_NO_ERROR) {
4973 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4976 - (void)startOverRequest:(ResponseHandler)completionHandler
4978 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4980 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4984 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4987 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4991 CHIP_ERROR err = self.cppCluster.StartOverRequest(onSuccess->Cancel(), onFailure->Cancel());
4992 if (err != CHIP_NO_ERROR) {
4995 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4998 - (void)stopRequest:(ResponseHandler)completionHandler
5000 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5002 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5006 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5009 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5013 CHIP_ERROR err = self.cppCluster.StopRequest(onSuccess->Cancel(), onFailure->Cancel());
5014 if (err != CHIP_NO_ERROR) {
5017 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5021 - (void)readAttributeCurrentState:(ResponseHandler)completionHandler
5023 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5025 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5029 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5032 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5036 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentState(onSuccess->Cancel(), onFailure->Cancel());
5037 if (err != CHIP_NO_ERROR) {
5040 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5044 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
5046 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5048 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5052 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5055 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5059 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
5060 if (err != CHIP_NO_ERROR) {
5063 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5069 @interface CHIPOnOff ()
5070 @property (readonly) Controller::OnOffCluster cppCluster;
5073 @implementation CHIPOnOff
5075 - (Controller::ClusterBase *)getCluster
5077 return &_cppCluster;
5080 - (void)off:(ResponseHandler)completionHandler
5082 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5084 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5088 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5091 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5095 CHIP_ERROR err = self.cppCluster.Off(onSuccess->Cancel(), onFailure->Cancel());
5096 if (err != CHIP_NO_ERROR) {
5099 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5102 - (void)on:(ResponseHandler)completionHandler
5104 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5106 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5110 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5113 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5117 CHIP_ERROR err = self.cppCluster.On(onSuccess->Cancel(), onFailure->Cancel());
5118 if (err != CHIP_NO_ERROR) {
5121 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5124 - (void)toggle:(ResponseHandler)completionHandler
5126 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5128 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5132 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5135 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5139 CHIP_ERROR err = self.cppCluster.Toggle(onSuccess->Cancel(), onFailure->Cancel());
5140 if (err != CHIP_NO_ERROR) {
5143 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5147 - (void)readAttributeOnOff:(ResponseHandler)completionHandler
5149 CHIPBooleanAttributeCallbackBridge * onSuccess
5150 = new CHIPBooleanAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5152 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5156 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5159 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5163 CHIP_ERROR err = self.cppCluster.ReadAttributeOnOff(onSuccess->Cancel(), onFailure->Cancel());
5164 if (err != CHIP_NO_ERROR) {
5167 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5171 - (void)configureAttributeOnOff:(uint16_t)minInterval
5172 maxInterval:(uint16_t)maxInterval
5173 completionHandler:(ResponseHandler)completionHandler
5175 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5177 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5181 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5184 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5188 CHIP_ERROR err = self.cppCluster.ConfigureAttributeOnOff(onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval);
5189 if (err != CHIP_NO_ERROR) {
5192 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5196 - (void)reportAttributeOnOff:(ResponseHandler)reportHandler
5198 CHIPBooleanAttributeCallbackBridge * onReport
5199 = new CHIPBooleanAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
5201 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5205 CHIP_ERROR err = self.cppCluster.ReportAttributeOnOff(onReport->Cancel());
5206 if (err != CHIP_NO_ERROR) {
5208 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
5212 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
5214 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5216 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5220 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5223 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5227 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
5228 if (err != CHIP_NO_ERROR) {
5231 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5237 @interface CHIPScenes ()
5238 @property (readonly) Controller::ScenesCluster cppCluster;
5241 @implementation CHIPScenes
5243 - (Controller::ClusterBase *)getCluster
5245 return &_cppCluster;
5248 - (void)addScene:(uint16_t)groupId
5249 sceneId:(uint8_t)sceneId
5250 transitionTime:(uint16_t)transitionTime
5251 sceneName:(char *)sceneName
5252 clusterId:(uint16_t)clusterId
5253 length:(uint8_t)length
5254 value:(uint8_t)value
5255 completionHandler:(ResponseHandler)completionHandler
5257 CHIPScenesClusterAddSceneResponseCallbackBridge * onSuccess
5258 = new CHIPScenesClusterAddSceneResponseCallbackBridge(completionHandler, [self callbackQueue]);
5260 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5264 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5267 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5271 CHIP_ERROR err = self.cppCluster.AddScene(
5272 onSuccess->Cancel(), onFailure->Cancel(), groupId, sceneId, transitionTime, sceneName, clusterId, length, value);
5273 if (err != CHIP_NO_ERROR) {
5276 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5279 - (void)getSceneMembership:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler
5281 CHIPScenesClusterGetSceneMembershipResponseCallbackBridge * onSuccess
5282 = new CHIPScenesClusterGetSceneMembershipResponseCallbackBridge(completionHandler, [self callbackQueue]);
5284 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5288 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5291 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5295 CHIP_ERROR err = self.cppCluster.GetSceneMembership(onSuccess->Cancel(), onFailure->Cancel(), groupId);
5296 if (err != CHIP_NO_ERROR) {
5299 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5302 - (void)recallScene:(uint16_t)groupId
5303 sceneId:(uint8_t)sceneId
5304 transitionTime:(uint16_t)transitionTime
5305 completionHandler:(ResponseHandler)completionHandler
5307 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5309 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5313 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5316 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5320 CHIP_ERROR err = self.cppCluster.RecallScene(onSuccess->Cancel(), onFailure->Cancel(), groupId, sceneId, transitionTime);
5321 if (err != CHIP_NO_ERROR) {
5324 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5327 - (void)removeAllScenes:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler
5329 CHIPScenesClusterRemoveAllScenesResponseCallbackBridge * onSuccess
5330 = new CHIPScenesClusterRemoveAllScenesResponseCallbackBridge(completionHandler, [self callbackQueue]);
5332 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5336 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5339 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5343 CHIP_ERROR err = self.cppCluster.RemoveAllScenes(onSuccess->Cancel(), onFailure->Cancel(), groupId);
5344 if (err != CHIP_NO_ERROR) {
5347 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5350 - (void)removeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:(ResponseHandler)completionHandler
5352 CHIPScenesClusterRemoveSceneResponseCallbackBridge * onSuccess
5353 = new CHIPScenesClusterRemoveSceneResponseCallbackBridge(completionHandler, [self callbackQueue]);
5355 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5359 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5362 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5366 CHIP_ERROR err = self.cppCluster.RemoveScene(onSuccess->Cancel(), onFailure->Cancel(), groupId, sceneId);
5367 if (err != CHIP_NO_ERROR) {
5370 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5373 - (void)storeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:(ResponseHandler)completionHandler
5375 CHIPScenesClusterStoreSceneResponseCallbackBridge * onSuccess
5376 = new CHIPScenesClusterStoreSceneResponseCallbackBridge(completionHandler, [self callbackQueue]);
5378 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5382 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5385 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5389 CHIP_ERROR err = self.cppCluster.StoreScene(onSuccess->Cancel(), onFailure->Cancel(), groupId, sceneId);
5390 if (err != CHIP_NO_ERROR) {
5393 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5396 - (void)viewScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:(ResponseHandler)completionHandler
5398 CHIPScenesClusterViewSceneResponseCallbackBridge * onSuccess
5399 = new CHIPScenesClusterViewSceneResponseCallbackBridge(completionHandler, [self callbackQueue]);
5401 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5405 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5408 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5412 CHIP_ERROR err = self.cppCluster.ViewScene(onSuccess->Cancel(), onFailure->Cancel(), groupId, sceneId);
5413 if (err != CHIP_NO_ERROR) {
5416 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5420 - (void)readAttributeSceneCount:(ResponseHandler)completionHandler
5422 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5424 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5428 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5431 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5435 CHIP_ERROR err = self.cppCluster.ReadAttributeSceneCount(onSuccess->Cancel(), onFailure->Cancel());
5436 if (err != CHIP_NO_ERROR) {
5439 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5443 - (void)readAttributeCurrentScene:(ResponseHandler)completionHandler
5445 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5447 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5451 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5454 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5458 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentScene(onSuccess->Cancel(), onFailure->Cancel());
5459 if (err != CHIP_NO_ERROR) {
5462 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5466 - (void)readAttributeCurrentGroup:(ResponseHandler)completionHandler
5468 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5470 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5474 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5477 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5481 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentGroup(onSuccess->Cancel(), onFailure->Cancel());
5482 if (err != CHIP_NO_ERROR) {
5485 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5489 - (void)readAttributeSceneValid:(ResponseHandler)completionHandler
5491 CHIPBooleanAttributeCallbackBridge * onSuccess
5492 = new CHIPBooleanAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5494 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5498 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5501 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5505 CHIP_ERROR err = self.cppCluster.ReadAttributeSceneValid(onSuccess->Cancel(), onFailure->Cancel());
5506 if (err != CHIP_NO_ERROR) {
5509 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5513 - (void)readAttributeNameSupport:(ResponseHandler)completionHandler
5515 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(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.ReadAttributeNameSupport(onSuccess->Cancel(), onFailure->Cancel());
5529 if (err != CHIP_NO_ERROR) {
5532 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5536 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
5538 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5540 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5544 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5547 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5551 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
5552 if (err != CHIP_NO_ERROR) {
5555 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5561 @interface CHIPTemperatureMeasurement ()
5562 @property (readonly) Controller::TemperatureMeasurementCluster cppCluster;
5565 @implementation CHIPTemperatureMeasurement
5567 - (Controller::ClusterBase *)getCluster
5569 return &_cppCluster;
5572 - (void)readAttributeMeasuredValue:(ResponseHandler)completionHandler
5574 CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5576 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5580 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5583 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5587 CHIP_ERROR err = self.cppCluster.ReadAttributeMeasuredValue(onSuccess->Cancel(), onFailure->Cancel());
5588 if (err != CHIP_NO_ERROR) {
5591 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5595 - (void)configureAttributeMeasuredValue:(uint16_t)minInterval
5596 maxInterval:(uint16_t)maxInterval
5597 change:(int16_t)change
5598 completionHandler:(ResponseHandler)completionHandler
5600 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5602 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5606 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5609 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5613 CHIP_ERROR err = self.cppCluster.ConfigureAttributeMeasuredValue(
5614 onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
5615 if (err != CHIP_NO_ERROR) {
5618 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5622 - (void)reportAttributeMeasuredValue:(ResponseHandler)reportHandler
5624 CHIPInt16sAttributeCallbackBridge * onReport = new CHIPInt16sAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
5626 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5630 CHIP_ERROR err = self.cppCluster.ReportAttributeMeasuredValue(onReport->Cancel());
5631 if (err != CHIP_NO_ERROR) {
5633 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
5637 - (void)readAttributeMinMeasuredValue:(ResponseHandler)completionHandler
5639 CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5641 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5645 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5648 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5652 CHIP_ERROR err = self.cppCluster.ReadAttributeMinMeasuredValue(onSuccess->Cancel(), onFailure->Cancel());
5653 if (err != CHIP_NO_ERROR) {
5656 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5660 - (void)readAttributeMaxMeasuredValue:(ResponseHandler)completionHandler
5662 CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5664 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5668 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5671 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5675 CHIP_ERROR err = self.cppCluster.ReadAttributeMaxMeasuredValue(onSuccess->Cancel(), onFailure->Cancel());
5676 if (err != CHIP_NO_ERROR) {
5679 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5683 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
5685 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5687 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5691 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5694 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5698 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
5699 if (err != CHIP_NO_ERROR) {
5702 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);