| {{> header excludeZapComment=true}} |
| |
| #import <Foundation/Foundation.h> |
| |
| #import <Matter/MTRBaseClusters.h> |
| #import <Matter/MTRCluster.h> |
| #import <Matter/MTRCommandPayloadsObjc.h> |
| #import <Matter/MTRDevice.h> |
| |
| NS_ASSUME_NONNULL_BEGIN |
| |
| {{#chip_client_clusters includeAll=true}} |
| |
| |
| /** |
| * Cluster {{name}} |
| * {{description}} |
| */ |
| {{availability (asUpperCamelCase name preserveAcronyms=true)~}} |
| @interface MTRCluster{{asUpperCamelCase name preserveAcronyms=true}} : MTRCluster |
| |
| - (instancetype _Nullable)initWithDevice:(MTRDevice *)device |
| endpointID:(NSNumber *)endpointID |
| queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER {{availability (asUpperCamelCase name preserveAcronyms=true) minimalRelease="First major API revamp"}}; |
| |
| {{#chip_cluster_commands}} |
| {{~#*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 expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:({{>command_completion_type command=.}})completion {{availability (asUpperCamelCase parent.name preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true) minimalRelease="First major API revamp"}}; |
| {{#unless (hasArguments)}} |
| - (void){{asLowerCamelCase name}}WithExpectedValues:(NSArray<NSDictionary<NSString *, id> *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:({{>command_completion_type command=.}})completion {{availability (asUpperCamelCase parent.name preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true) minimalRelease="First major API revamp"}}; |
| {{/unless}} |
| {{/chip_cluster_commands}} |
| |
| {{#chip_server_cluster_attributes}} |
| {{#*inline "attribute"}}Attribute{{asUpperCamelCase name preserveAcronyms=true}}{{/inline}} |
| {{#*inline "availability"}} |
| {{availability (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true)}} |
| {{/inline}} |
| - (NSDictionary<NSString *, id> *)read{{>attribute}}WithParams:(MTRReadParams * _Nullable)params {{> availability}}; |
| {{#if isWritableAttribute}} |
| - (void)write{{>attribute}}WithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs {{> availability}}; |
| - (void)write{{>attribute}}WithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params {{> availability}}; |
| {{/if}} |
| {{/chip_server_cluster_attributes}} |
| |
| - (instancetype)init NS_UNAVAILABLE; |
| + (instancetype)new NS_UNAVAILABLE; |
| |
| @end |
| |
| {{/chip_client_clusters}} |
| |
| {{#chip_client_clusters includeAll=true}} |
| {{#unless (isStrEqual (asUpperCamelCase name preserveAcronyms=true) (compatClusterNameRemapping name))}} |
| {{availability (compatClusterNameRemapping name) deprecationMessage=(concat "Please use MTRCluster" (asUpperCamelCase name preserveAcronyms=true))}} |
| @interface MTRCluster{{compatClusterNameRemapping name}} : MTRCluster{{asUpperCamelCase name preserveAcronyms=true}} |
| @end |
| |
| {{/unless}} |
| {{/chip_client_clusters}} |
| |
| {{#chip_client_clusters includeAll=true}} |
| {{#if (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping name))}} |
| @interface MTRCluster{{compatClusterNameRemapping name}} (Deprecated) |
| |
| - (nullable instancetype)initWithDevice:(MTRDevice *)device |
| endpoint:(uint16_t)endpoint |
| queue:(dispatch_queue_t)queue {{availability (compatClusterNameRemapping name) deprecatedRelease="First major API revamp" deprecationMessage="Please use initWithDevice:endpoindID:queue:"}}; |
| |
| {{#chip_cluster_commands}} |
| {{#if (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping parent.name) command=(asUpperCamelCase name))}} |
| - (void){{asLowerCamelCase name}}WithParams:(MTR{{compatClusterNameRemapping parent.name}}Cluster{{asUpperCamelCase name}}Params * {{#unless (commandHasRequiredField .)}}_Nullable{{/unless}})params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completionHandler:({{>command_completion_type command=. compatRemapClusterName=true}})completionHandler {{availability (compatClusterNameRemapping parent.name) command=(asUpperCamelCase name) deprecatedRelease="First major API revamp" deprecationMessage=(concat "Please use " (asLowerCamelCase name) "WithParams:expectedValues:expectedValueIntervalMs:completion:")}}; |
| {{#unless (hasArguments)}} |
| - (void){{asLowerCamelCase name}}WithExpectedValues:(NSArray<NSDictionary<NSString *, id> *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completionHandler:({{>command_completion_type command=. compatRemapClusterName=true}})completionHandler {{availability (compatClusterNameRemapping parent.name) command=(asUpperCamelCase name) deprecatedRelease="First major API revamp" deprecationMessage=(concat "Please use " (asLowerCamelCase name) "WithExpectedValues:expectedValueIntervalMs:completion:")}}; |
| {{/unless}} |
| {{/if}} |
| {{/chip_cluster_commands}} |
| {{~#chip_server_cluster_attributes}} |
| {{~#*inline "attribute"}}Attribute{{compatAttributeNameRemapping parent.name name}}{{/inline~}} |
| {{~#*inline "attributeDecls"}} |
| - (NSDictionary<NSString *, id> *)read{{>attribute}}WithParams:(MTRReadParams * _Nullable)params {{availability (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name) deprecatedRelease="First major API revamp" deprecationMessage=(concat "Please use readAttribute" (asUpperCamelCase name preserveAcronyms=true) "WithParams on MTRCluster" (asUpperCamelCase parent.name preserveAcronyms=true))}}; |
| {{#if isWritableAttribute}} |
| - (void)write{{>attribute}}WithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs {{availability (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name) deprecationMessage=(concat "Please use writeAttribute" (asUpperCamelCase name preserveAcronyms=true) "WithValue on MTRCluster" (asUpperCamelCase parent.name preserveAcronyms=true))}}; |
| - (void)write{{>attribute}}WithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params {{availability (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name) deprecationMessage=(concat "Please use writeAttribute" (asUpperCamelCase name preserveAcronyms=true) "WithValue on MTRCluster" (asUpperCamelCase parent.name preserveAcronyms=true))}}; |
| {{/if}} |
| {{/inline~}} |
| {{#unless (isStrEqual (asUpperCamelCase name preserveAcronyms=true) (compatAttributeNameRemapping parent.name name))}} |
| {{> attributeDecls}} |
| {{/unless}} |
| {{/chip_server_cluster_attributes}} |
| @end |
| |
| {{/if}} |
| {{/chip_client_clusters}} |
| |
| NS_ASSUME_NONNULL_END |