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 #ifndef CHIP_CLUSTERS_H
21 #define CHIP_CLUSTERS_H
23 #import <Foundation/Foundation.h>
27 typedef void (^ResponseHandler)(NSError * _Nullable error, NSDictionary * _Nullable values);
29 NS_ASSUME_NONNULL_BEGIN
33 * This is the base class for clusters.
35 @interface CHIPCluster : NSObject
37 - (nullable instancetype)initWithDevice:(CHIPDevice *)device
38 endpoint:(uint8_t)endpoint
39 queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER;
40 - (instancetype)init NS_UNAVAILABLE;
41 + (instancetype)new NS_UNAVAILABLE;
46 * Cluster Level Control
49 @interface CHIPLevelControl : CHIPCluster
51 - (void)move:(uint8_t)moveMode
53 optionMask:(uint8_t)optionMask
54 optionOverride:(uint8_t)optionOverride
55 completionHandler:(ResponseHandler)completionHandler;
56 - (void)moveToLevel:(uint8_t)level
57 transitionTime:(uint16_t)transitionTime
58 optionMask:(uint8_t)optionMask
59 optionOverride:(uint8_t)optionOverride
60 completionHandler:(ResponseHandler)completionHandler;
61 - (void)moveToLevelWithOnOff:(uint8_t)level
62 transitionTime:(uint16_t)transitionTime
63 completionHandler:(ResponseHandler)completionHandler;
64 - (void)moveWithOnOff:(uint8_t)moveMode rate:(uint8_t)rate completionHandler:(ResponseHandler)completionHandler;
65 - (void)step:(uint8_t)stepMode
66 stepSize:(uint8_t)stepSize
67 transitionTime:(uint16_t)transitionTime
68 optionMask:(uint8_t)optionMask
69 optionOverride:(uint8_t)optionOverride
70 completionHandler:(ResponseHandler)completionHandler;
71 - (void)stepWithOnOff:(uint8_t)stepMode
72 stepSize:(uint8_t)stepSize
73 transitionTime:(uint16_t)transitionTime
74 completionHandler:(ResponseHandler)completionHandler;
75 - (void)stop:(uint8_t)optionMask optionOverride:(uint8_t)optionOverride completionHandler:(ResponseHandler)completionHandler;
76 - (void)stopWithOnOff:(ResponseHandler)completionHandler;
78 - (void)readAttributeCurrentLevel:(ResponseHandler)completionHandler;
79 - (void)configureAttributeCurrentLevel:(uint16_t)minInterval
80 maxInterval:(uint16_t)maxInterval
81 change:(uint8_t)change
82 completionHandler:(ResponseHandler)completionHandler;
83 - (void)reportAttributeCurrentLevel:(ResponseHandler)reportHandler;
84 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler;
89 * Cluster Network Commissioning
92 @interface CHIPNetworkCommissioning : CHIPCluster
94 - (void)addThreadNetwork:(NSData *)operationalDataset
95 breadcrumb:(uint64_t)breadcrumb
96 timeoutMs:(uint32_t)timeoutMs
97 completionHandler:(ResponseHandler)completionHandler;
98 - (void)addWiFiNetwork:(NSData *)ssid
99 credentials:(NSData *)credentials
100 breadcrumb:(uint64_t)breadcrumb
101 timeoutMs:(uint32_t)timeoutMs
102 completionHandler:(ResponseHandler)completionHandler;
103 - (void)disableNetwork:(NSData *)networkID
104 breadcrumb:(uint64_t)breadcrumb
105 timeoutMs:(uint32_t)timeoutMs
106 completionHandler:(ResponseHandler)completionHandler;
107 - (void)enableNetwork:(NSData *)networkID
108 breadcrumb:(uint64_t)breadcrumb
109 timeoutMs:(uint32_t)timeoutMs
110 completionHandler:(ResponseHandler)completionHandler;
111 - (void)getLastNetworkCommissioningResult:(uint32_t)timeoutMs completionHandler:(ResponseHandler)completionHandler;
112 - (void)removeNetwork:(NSData *)networkID
113 breadcrumb:(uint64_t)breadcrumb
114 timeoutMs:(uint32_t)timeoutMs
115 completionHandler:(ResponseHandler)completionHandler;
116 - (void)scanNetworks:(NSData *)ssid
117 breadcrumb:(uint64_t)breadcrumb
118 timeoutMs:(uint32_t)timeoutMs
119 completionHandler:(ResponseHandler)completionHandler;
120 - (void)updateThreadNetwork:(NSData *)operationalDataset
121 breadcrumb:(uint64_t)breadcrumb
122 timeoutMs:(uint32_t)timeoutMs
123 completionHandler:(ResponseHandler)completionHandler;
124 - (void)updateWiFiNetwork:(NSData *)ssid
125 credentials:(NSData *)credentials
126 breadcrumb:(uint64_t)breadcrumb
127 timeoutMs:(uint32_t)timeoutMs
128 completionHandler:(ResponseHandler)completionHandler;
130 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler;
138 @interface CHIPOnOff : CHIPCluster
140 - (void)off:(ResponseHandler)completionHandler;
141 - (void)on:(ResponseHandler)completionHandler;
142 - (void)toggle:(ResponseHandler)completionHandler;
144 - (void)readAttributeOnOff:(ResponseHandler)completionHandler;
145 - (void)configureAttributeOnOff:(uint16_t)minInterval
146 maxInterval:(uint16_t)maxInterval
147 completionHandler:(ResponseHandler)completionHandler;
148 - (void)reportAttributeOnOff:(ResponseHandler)reportHandler;
149 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler;
153 NS_ASSUME_NONNULL_END
155 #endif /* CHIP_CLUSTERS_H */