Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / src / app / zap-templates / templates / app / CHIPClustersObjc.zapt
1 {{> header}}
2
3 {{#if (chip_has_client_clusters)}}
4 #ifndef CHIP_CLUSTERS_H
5 #define CHIP_CLUSTERS_H
6
7 #import <Foundation/Foundation.h>
8
9 @class CHIPDevice;
10
11 typedef void (^ResponseHandler)(NSError * _Nullable error, NSDictionary * _Nullable values);
12
13 NS_ASSUME_NONNULL_BEGIN
14
15 /**
16  * CHIPCluster
17  *    This is the base class for clusters.
18  */
19 @interface CHIPCluster : NSObject
20
21 - (nullable instancetype)initWithDevice:(CHIPDevice *)device endpoint:(uint8_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER;
22 - (instancetype)init NS_UNAVAILABLE;
23 + (instancetype)new NS_UNAVAILABLE;
24
25 @end
26
27 {{#chip_client_clusters}}
28
29
30 /**
31  * Cluster {{name}}
32  *    {{description}}
33  */
34 @interface CHIP{{asCamelCased name false}} : CHIPCluster
35
36 {{#chip_server_cluster_commands}}
37 {{#if (zcl_command_arguments_count this.id)}}
38 - (void){{asCamelCased name}}:{{#chip_server_cluster_command_arguments}}{{#if (isFirstElement index)}}{{else}}{{asCamelCased label}}:{{/if}}({{asObjectiveCBasicType type}}){{asCamelCased label}} {{/chip_server_cluster_command_arguments}}completionHandler:(ResponseHandler)completionHandler;
39 {{else}}
40 - (void){{asCamelCased name}}:(ResponseHandler)completionHandler;
41 {{/if}}
42 {{/chip_server_cluster_commands}}
43
44 {{#chip_server_cluster_attributes}}
45 - (void)readAttribute{{asCamelCased name false}}:(ResponseHandler)completionHandler;
46 {{#if (isWritableAttribute)}}
47 - (void)writeAttribute{{asCamelCased name false}}:({{asObjectiveCBasicType type}})value completionHandler:(ResponseHandler)completionHandler;
48 {{/if}}
49 {{#if (isReportableAttribute)}}
50 - (void) configureAttribute{{asCamelCased name false}}:(uint16_t)minInterval  maxInterval:(uint16_t)maxInterval{{#unless (isDiscreteType)}} change:({{chipType}})change{{/unless}} completionHandler:(ResponseHandler)completionHandler;
51 - (void) reportAttribute{{asCamelCased name false}}:(ResponseHandler)reportHandler;
52 {{/if}}
53 {{/chip_server_cluster_attributes}}
54
55 @end
56
57 {{/chip_client_clusters}}
58
59 NS_ASSUME_NONNULL_END
60
61 #endif /* CHIP_CLUSTERS_H */
62 {{/if}}