blob: 5db875e21cf4b3633f6a4f0a4d823b846f9f55f9 [file] [log] [blame]
{{> header excludeZapComment=true}}
#import <Foundation/Foundation.h>
#import <Matter/MTRClusterStateCacheContainer.h>
#import <Matter/MTRCluster.h>
#import <Matter/MTRCommandPayloadsObjc.h>
NS_ASSUME_NONNULL_BEGIN
{{#chip_client_clusters includeAll=true}}
/**
* Cluster {{name}}
*
* {{description}}
*/
@interface MTRBaseCluster{{asUpperCamelCase name preserveAcronyms=true}} : MTRCluster
- (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device
endpoint:(NSNumber *)endpoint
queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER;
{{#chip_cluster_commands}}
/**
* Command {{name}}
*
* {{description}}
*/
{{~#*inline "cluster"}}{{asUpperCamelCase parent.name preserveAcronyms=true}}{{/inline~}}
{{~#*inline "command"}}{{asUpperCamelCase name preserveAcronyms=true}}{{/inline~}}
- (void){{asLowerCamelCase name}}WithParams:(MTR{{>cluster}}Cluster{{>command}}Params * {{#unless (commandHasRequiredField .)}}_Nullable{{/unless}})params completion:({{>command_completion_type command=.}})completion;
{{#unless (hasArguments)}}
- (void){{asLowerCamelCase name}}WithCompletion:({{>command_completion_type command=.}})completion;
{{/unless}}
{{/chip_cluster_commands}}
{{#chip_server_cluster_attributes}}
{{#*inline "attribute"}}Attribute{{asUpperCamelCase name preserveAcronyms=true}}{{/inline}}
- (void)read{{>attribute}}With
{{~#if_is_fabric_scoped_struct type~}}
Params:(MTRReadParams * _Nullable)params completion:
{{~else~}}
Completion:
{{~/if_is_fabric_scoped_struct~}}
(void (^)({{asObjectiveCClass type parent.name}} * _Nullable value, NSError * _Nullable error))completion;
{{#if isWritableAttribute}}
- (void)write{{>attribute}}WithValue:({{asObjectiveCType type parent.name}})value completion:(MTRStatusCompletion)completion;
- (void)write{{>attribute}}WithValue:({{asObjectiveCType type parent.name}})value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion;
{{/if}}
{{#if isReportableAttribute}}
/**
* This API does not support setting autoResubscribe to NO in the
* MTRSubscribeParams.
*/
- (void) subscribe{{>attribute}}WithParams:(MTRSubscribeParams *)params
subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished
reportHandler:(void (^)({{asObjectiveCClass type parent.name}} * _Nullable value, NSError * _Nullable error))reportHandler;
+ (void) read{{>attribute}}WithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)({{asObjectiveCClass type parent.name}} * _Nullable value, NSError * _Nullable error))completion;
{{/if}}
{{/chip_server_cluster_attributes}}
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;
@end
{{/chip_client_clusters}}
{{#zcl_clusters}}
{{#zcl_enums}}
typedef NS_ENUM({{asUnderlyingZclType name}}, {{objCEnumName ../name label}}) {
{{#zcl_enum_items}}
{{objCEnumName ../../name ../label}}{{objCEnumItemLabel label}} = {{asHex value 2}},
{{/zcl_enum_items}}
};
{{/zcl_enums}}
{{#zcl_bitmaps}}
typedef NS_OPTIONS({{asUnderlyingZclType name}}, {{objCEnumName ../name label}}) {
{{#zcl_bitmap_items}}
{{objCEnumName ../../name ../label}}{{objCEnumItemLabel label}} = {{asHex mask}},
{{/zcl_bitmap_items}}
};
{{/zcl_bitmaps}}
{{/zcl_clusters}}
NS_ASSUME_NONNULL_END