| {{> header excludeZapComment=true}} |
| |
| #import <Matter/MTRDefines.h> |
| #import <Matter/MTRStructsObjc.h> |
| |
| NS_ASSUME_NONNULL_BEGIN |
| |
| {{#zcl_clusters}} |
| {{#zcl_commands}} |
| {{#*inline "completeDecl"}} |
| {{#if (isSupported cluster command=command isForCommandPayload=true)}} |
| |
| {{availability cluster command=command isForCommandPayload=true deprecationMessage="This command has been removed"}} |
| @interface MTR{{cluster}}Cluster{{command}}Params : NSObject <NSCopying> |
| {{#zcl_command_arguments}} |
| |
| {{> struct_field_decl cluster=parent.parent.name type=type label=label}} {{availability ../cluster command=../command commandField=(asStructPropertyName label)}}; |
| {{#*inline "oldNameFieldDecl"}} |
| |
| {{> struct_field_decl cluster=parent.parent.name type=type label=commandField}} {{availability ../cluster command=../command commandField=commandField deprecationMessage=(concat "Please use " (asStructPropertyName label))}}; |
| {{/inline}} |
| {{#if (and includeRenamedProperties |
| (hasOldName ../cluster command=../command commandField=(asStructPropertyName label)))}} |
| {{> oldNameFieldDecl commandField=(oldName ../cluster command=../command commandField=(asStructPropertyName label))}} |
| {{/if}} |
| {{/zcl_command_arguments}} |
| {{#if (isStrEqual source "client")}} |
| /** |
| * Controls whether the command is a timed command (using Timed Invoke). |
| * |
| * If nil (the default value), a regular invoke is done for commands that do |
| * not require a timed invoke and a timed invoke with some default timed request |
| * timeout is done for commands that require a timed invoke. |
| * |
| * If not nil, a timed invoke is done, with the provided value used as the timed |
| * request timeout. The value should be chosen small enough to provide the |
| * desired security properties but large enough that it will allow a round-trip |
| * from the sever to the client (for the status response and actual invoke |
| * request) within the timeout window. |
| * |
| */ |
| @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; |
| |
| /** |
| * Controls how much time, in seconds, we will allow for the server to process the command. |
| * |
| * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. |
| * |
| * If nil, the framework will try to select an appropriate timeout value itself. |
| */ |
| @property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; |
| {{! This is using the pre-renaming names for the isAvailableBefore test, because the pre-rename things inherit |
| from the post-rename ones and need to have this selector.}} |
| {{else if (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping parent.name) command=(compatCommandNameRemapping parent.name name))}} |
| /** |
| * Controls whether the command is a timed command (using Timed Invoke). |
| * |
| * If nil (the default value), a regular invoke is done for commands that do |
| * not require a timed invoke and a timed invoke with some default timed request |
| * timeout is done for commands that require a timed invoke. |
| * |
| * If not nil, a timed invoke is done, with the provided value used as the timed |
| * request timeout. The value should be chosen small enough to provide the |
| * desired security properties but large enough that it will allow a round-trip |
| * from the sever to the client (for the status response and actual invoke |
| * request) within the timeout window. |
| * |
| */ |
| @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs {{availability "" api="Timed Invoke for server to client commands" deprecationMessage="Timed invoke does not make sense for server to client commands"}}; |
| {{/if}} |
| {{#if (isStrEqual source "server")}} |
| |
| /** |
| * Initialize an MTR{{cluster}}Cluster{{command}}Params with a response-value dictionary |
| * of the sort that MTRDeviceResponseHandler would receive. |
| * |
| * Will return nil and hand out an error if the response-value dictionary is not |
| * a command data response or is not the right command response. |
| * |
| * Will return nil and hand out an error if the data response does not match the known |
| * schema for this command. |
| */ |
| - (nullable instancetype)initWithResponseValue:(NSDictionary<NSString *, id> *)responseValue |
| error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; |
| {{/if}} |
| @end |
| {{/if}} |
| {{/inline}} |
| {{#*inline "oldNameDecl"}} |
| |
| {{availability cluster command=command deprecationMessage=(concat "Please use MTR" (asUpperCamelCase parent.name preserveAcronyms=true) "Cluster" (asUpperCamelCase name preserveAcronyms=true) "Params")}} |
| @interface MTR{{cluster}}Cluster{{command}}Params : MTR{{asUpperCamelCase parent.name preserveAcronyms=true}}Cluster{{asUpperCamelCase name}}Params |
| @end |
| |
| {{/inline}} |
| {{#if (isSupported (asUpperCamelCase parent.name preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true))}} |
| {{> completeDecl cluster=(asUpperCamelCase parent.name preserveAcronyms=true) |
| command=(asUpperCamelCase name preserveAcronyms=true) |
| includeRenamedProperties=false}} |
| {{#if (or (not (isStrEqual (asUpperCamelCase parent.name preserveAcronyms=true) (compatClusterNameRemapping parent.name))) |
| (not (isStrEqual (asUpperCamelCase name preserveAcronyms=true) (compatCommandNameRemapping parent.name name))))}} |
| {{> oldNameDecl cluster=(compatClusterNameRemapping parent.name) |
| command=(compatCommandNameRemapping parent.name name)}} |
| {{/if}} |
| {{#if (hasRenamedFields (asUpperCamelCase parent.name preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true))}} |
| {{#*inline "deprecatedDecl"}} |
| |
| @interface MTR{{cluster}}Cluster{{command}}Params (Deprecated) |
| {{#zcl_command_arguments}} |
| {{#*inline "oldNameFieldDecl"}} |
| |
| {{> struct_field_decl cluster=parent.parent.name type=type label=commandField}} {{availability ../cluster command=../command commandField=commandField deprecationMessage=(concat "Please use " (asStructPropertyName label))}}; |
| {{/inline}} |
| {{#if (hasOldName ../cluster command=../command commandField=(asStructPropertyName label))}} |
| {{> oldNameFieldDecl commandField=(oldName ../cluster command=../command commandField=(asStructPropertyName label))}} |
| {{/if}} |
| {{/zcl_command_arguments}} |
| @end |
| {{/inline}} |
| {{> deprecatedDecl cluster=(asUpperCamelCase parent.name preserveAcronyms=true) |
| command=(asUpperCamelCase name preserveAcronyms=true)}} |
| {{/if}} |
| {{else}} |
| {{> completeDecl cluster=(compatClusterNameRemapping parent.name) |
| command=(compatCommandNameRemapping parent.name name) |
| includeRenamedProperties=true}} |
| {{/if}} |
| {{/zcl_commands}} |
| {{/zcl_clusters}} |
| |
| NS_ASSUME_NONNULL_END |