From 7242c92db83ff8a339090239859c3070feb4b92f Mon Sep 17 00:00:00 2001 From: Philip Gregor Date: Thu, 21 Mar 2024 16:45:51 -0700 Subject: [PATCH] Addressed comments by bzbarsky-apple part2 unlinked availability.yaml --- .../templates/MCAttributeObjects-src.zapt | 4 --- .../templates/MCAttributeObjects.zapt | 4 --- .../templates/MCClusterObjects-src.zapt | 6 ----- .../templates/MCClusterObjects.zapt | 6 ----- .../templates/MCCommandObjects-src.zapt | 4 --- .../templates/MCCommandObjects.zapt | 4 --- .../templates/MCCommandPayloads-src.zapt | 26 ------------------- .../templates/MCCommandPayloads.zapt | 8 ------ .../templates/partials/decode_value.zapt | 2 -- .../templates/partials/encode_value.zapt | 2 -- .../templates/templates.json | 3 +-- .../zap-generated/MCCommandPayloads.mm | 3 --- 12 files changed, 1 insertion(+), 71 deletions(-) diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCAttributeObjects-src.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCAttributeObjects-src.zapt index c6feac39dc1fcc..52f09bc83c1f8e 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCAttributeObjects-src.zapt +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCAttributeObjects-src.zapt @@ -14,13 +14,11 @@ #import {{#zcl_clusters}} -{{#if (isSupported (asUpperCamelCase name preserveAcronyms=true))}} {{#if (isInConfigList name "MatterCastingClusters")}} // {{asUpperCamelCase name}} cluster attributes: {{#zcl_attributes_server removeKeys='isOptional'}} -{{#if (isSupported (asUpperCamelCase ../name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true))}} @implementation MC{{asUpperCamelCase ../name}}Cluster{{asUpperCamelCase name}}Attribute - (void)read:(void * _Nullable)context completion:(void (^_Nonnull __strong)(void * _Nullable, id _Nullable __strong before, id _Nullable __strong after, NSError * _Nullable __strong error))completion @@ -67,8 +65,6 @@ } @end -{{/if}} {{/zcl_attributes_server}} {{/if}} -{{/if}} {{/zcl_clusters}} \ No newline at end of file diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCAttributeObjects.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCAttributeObjects.zapt index b743625bed8f9b..3f174e14e42ff1 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCAttributeObjects.zapt +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCAttributeObjects.zapt @@ -9,20 +9,16 @@ #define MCAttributeObjects_h {{#zcl_clusters}} -{{#if (isSupported (asUpperCamelCase name))}} {{#if (isInConfigList name "MatterCastingClusters")}} // {{asUpperCamelCase name}} cluster attributes: {{#zcl_attributes_server}} -{{#if (isSupported (asUpperCamelCase ../name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true))}} @interface MC{{asUpperCamelCase ../name}}Cluster{{asUpperCamelCase name}}Attribute : MCAttribute <{{asObjectiveCClass type ../name structTypePrefix="MC"}} *> @end -{{/if}} {{/zcl_attributes_server}} {{/if}} -{{/if}} {{/zcl_clusters}} #endif /* MCAttributeObjects_h */ diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCClusterObjects-src.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCClusterObjects-src.zapt index 5d74b4b74bda66..b760874291e05f 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCClusterObjects-src.zapt +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCClusterObjects-src.zapt @@ -13,7 +13,6 @@ #import {{#zcl_clusters}} -{{#if (isSupported (asUpperCamelCase name))}} {{#if (isInConfigList name "MatterCastingClusters")}} // {{asUpperCamelCase name}} cluster: @@ -24,7 +23,6 @@ {{#zcl_commands}} {{#if (is_str_equal source 'client')}} -{{#if (isSupported (asUpperCamelCase ../name preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true))}} - (id){{asMethodName name}}Command { @@ -32,22 +30,18 @@ return cppCommand != nil ? [[MC{{asUpperCamelCase ../name}}Cluster{{asUpperCamelCase name}}Command alloc] initWithCppCommand:cppCommand] : nil; } -{{/if}} {{/if}} {{/zcl_commands}} // {{asUpperCamelCase name}} cluster attributes: {{#zcl_attributes_server}} -{{#if (isSupported (asUpperCamelCase ../name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true))}} - (id){{asMethodName name}}Attribute { void * cppAttribute = self.cppCluster->GetAttribute(chip::app::Clusters::{{asUpperCamelCase ../name}}::Attributes::{{asUpperCamelCase name}}::Id); return cppAttribute != nil ? [[MC{{asUpperCamelCase ../name}}Cluster{{asUpperCamelCase name}}Attribute alloc] initWithCppAttribute:cppAttribute] : nil; } -{{/if}} {{/zcl_attributes_server}} @end {{/if}} -{{/if}} {{/zcl_clusters}} diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCClusterObjects.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCClusterObjects.zapt index 2fe9cf78fea8bb..1b7fdabe4b3835 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCClusterObjects.zapt +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCClusterObjects.zapt @@ -9,7 +9,6 @@ #define MCClusterObjects_h {{#zcl_clusters}} -{{#if (isSupported (asUpperCamelCase name))}} {{#if (isInConfigList name "MatterCastingClusters")}} // {{asUpperCamelCase name}} cluster: @@ -20,29 +19,24 @@ {{#zcl_commands}} {{#if (is_str_equal source 'client')}} -{{#if (isSupported (asUpperCamelCase ../name preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true))}} /** * @brief Returns non-nil pointer to MC{{asUpperCamelCase ../name}}Cluster{{asUpperCamelCase name}}Command if supported, nil otherwise. */ - (MC{{asUpperCamelCase ../name}}Cluster{{asUpperCamelCase name}}Command * _Nullable){{asMethodName name}}Command; {{/if}} -{{/if}} {{/zcl_commands}} // {{asUpperCamelCase name}} cluster attributes: {{#zcl_attributes_server}} -{{#if (isSupported (asUpperCamelCase ../name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true))}} /** * @brief Returns non-nil pointer to MC{{asUpperCamelCase ../name}}Cluster{{asUpperCamelCase name}}Attribute if supported, nil otherwise. */ - (MC{{asUpperCamelCase ../name}}Cluster{{asUpperCamelCase name}}Attribute * _Nullable){{asMethodName name}}Attribute; -{{/if}} {{/zcl_attributes_server}} @end {{/if}} -{{/if}} {{/zcl_clusters}} #endif /* MCClusterObjects_h */ diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandObjects-src.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandObjects-src.zapt index 612522a7ab4f65..befedb90d6d0ab 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandObjects-src.zapt +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandObjects-src.zapt @@ -21,14 +21,12 @@ @end {{#zcl_clusters}} -{{#if (isSupported (asUpperCamelCase name))}} {{#if (isInConfigList name "MatterCastingClusters")}} // {{asUpperCamelCase name}} cluster: {{#zcl_commands}} {{#if (is_str_equal source 'client')}} -{{#if (isSupported (asUpperCamelCase ../name preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true))}} @implementation MC{{asUpperCamelCase ../name}}Cluster{{asUpperCamelCase name}}Command - (void)invoke:(id)request context:(void * _Nullable)context @@ -80,9 +78,7 @@ } @end -{{/if}} {{/if}} {{/zcl_commands}} {{/if}} -{{/if}} {{/zcl_clusters}} \ No newline at end of file diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandObjects.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandObjects.zapt index 30c746c345c0e4..6c4615d10a2ae9 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandObjects.zapt +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandObjects.zapt @@ -11,21 +11,17 @@ @end {{#zcl_clusters}} -{{#if (isSupported (asUpperCamelCase name))}} {{#if (isInConfigList name "MatterCastingClusters")}} // {{asUpperCamelCase name}} cluster: {{#zcl_commands}} {{#if (is_str_equal source 'client')}} -{{#if (isSupported (asUpperCamelCase ../name preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true))}} @interface MC{{asUpperCamelCase ../name}}Cluster{{asUpperCamelCase name}}Command : MCCommand command_response_type command=.}} *> @end -{{/if}} {{/if}} {{/zcl_commands}} {{/if}} -{{/if}} {{/zcl_clusters}} #endif /* MCCommandObjects_h */ diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandPayloads-src.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandPayloads-src.zapt index a3ed2bbb8ad2b5..7290b4c7e96435 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandPayloads-src.zapt +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandPayloads-src.zapt @@ -9,10 +9,7 @@ #import "../NSStringSpanConversion.h" #include -#include #include -#include -#include NS_ASSUME_NONNULL_BEGIN @@ -42,7 +39,6 @@ NS_ASSUME_NONNULL_BEGIN {{#zcl_commands}} {{#*inline "completeImpl"}} -{{#if (isSupported cluster command=command isForCommandPayload=true)}} @implementation MC{{cluster}}Cluster{{command}}Params - (instancetype)init { @@ -51,9 +47,6 @@ NS_ASSUME_NONNULL_BEGIN {{>init_struct_member label=label type=type cluster=parent.parent.name}} {{/zcl_command_arguments}} -{{#if (or (isStrEqual source "client") - (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping parent.name) command=(compatCommandNameRemapping parent.name name)))}} -{{/if}} {{#if (isStrEqual source "client")}} {{/if}} } @@ -76,13 +69,6 @@ NS_ASSUME_NONNULL_BEGIN NSString *descriptionString = [NSString stringWithFormat:@"<%@: {{#zcl_command_arguments}}{{asStructPropertyName label}}:%@; {{/zcl_command_arguments}}>", NSStringFromClass([self class]) {{#zcl_command_arguments}},{{#if isArray}}_{{asStructPropertyName label}}{{else if (isOctetString type)}}[_{{asStructPropertyName label}} base64EncodedStringWithOptions:0]{{else}}_{{asStructPropertyName label}}{{/if}}{{/zcl_command_arguments}}]; return descriptionString; } -{{#zcl_command_arguments}} -{{#if (and includeRenamedProperties - (hasOldName ../cluster command=../command commandField=(asStructPropertyName label)))}} - -{{> renamed_struct_field_impl cluster=parent.parent.name type=type newName=label oldName=(oldName ../cluster command=../command commandField=(asStructPropertyName label))}} -{{/if}} -{{/zcl_command_arguments}} {{#if (isStrEqual source "client")}} @@ -128,23 +114,11 @@ NS_ASSUME_NONNULL_BEGIN } {{/if}} @end -{{/if}} {{/inline}} - -{{#if (isSupported (asUpperCamelCase parent.name preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true) isForCommandPayload=true)}} {{> completeImpl 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))))}} -{{/if}} - -{{else}} -{{> completeImpl cluster=(compatClusterNameRemapping parent.name) - command=(compatCommandNameRemapping parent.name name) - includeRenamedProperties=true}} -{{/if}} {{/zcl_commands}} {{/if}} {{/zcl_clusters}} diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandPayloads.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandPayloads.zapt index bedca0d7220e02..eb70c385981e38 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandPayloads.zapt +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandPayloads.zapt @@ -13,30 +13,22 @@ NS_ASSUME_NONNULL_BEGIN // {{asUpperCamelCase name}} cluster: {{#zcl_commands}} {{#*inline "completeDecl"}} -{{#if (isSupported cluster command=command isForCommandPayload=true)}} @interface MC{{cluster}}Cluster{{command}}Params : {{base}} {{#zcl_command_arguments}} -{{#if (isSupported ../cluster command=../command commandField=(asStructPropertyName label))}} {{> struct_field_decl cluster=parent.parent.name type=type label=label}}; -{{/if}} {{#*inline "oldNameFieldDecl"}} -{{#if (isSupported ../cluster command=../command commandField=commandField)}} {{> struct_field_decl cluster=parent.parent.name type=type label=commandField}}; -{{/if}} {{/inline}} {{/zcl_command_arguments}} @end -{{/if}} {{/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 deprecationMessage="This command has been removed" base="MCAbstractPayload" includeInitWithResponseValue=true}} -{{/if}} {{/zcl_commands}} {{/if}} {{/zcl_clusters}} diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/decode_value.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/decode_value.zapt index 2900ce04a0561d..36cc8a98b1a4d1 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/decode_value.zapt +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/decode_value.zapt @@ -30,9 +30,7 @@ {{#if_is_struct type}} {{target}} = [{{asObjectiveCClass type cluster forceNotList=true structTypePrefix="MC"}} new]; {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} - {{#if (isSupported (asUpperCamelCase ../cluster preserveAcronyms=true) struct=(asUpperCamelCase ../type preserveAcronyms=true) structField=(asStructPropertyName label))}} {{>decode_value target=(concat ../target "." (asStructPropertyName label)) source=(concat ../source "." (asLowerCamelCase label)) cluster=../cluster errorCode=../errorCode depth=(incrementDepth ../depth) }} - {{/if}} {{/zcl_struct_items_by_struct_and_cluster_name}} {{else}} {{#if_is_strongly_typed_chip_enum type}} diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/encode_value.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/encode_value.zapt index 660db334188686..6ee95bfddacfa1 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/encode_value.zapt +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/encode_value.zapt @@ -46,9 +46,7 @@ {{else}} {{#if_is_struct type}} {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} - {{#if (isSupported (asUpperCamelCase ../cluster preserveAcronyms=true) struct=(asUpperCamelCase ../type preserveAcronyms=true) structField=(asStructPropertyName label))}} {{>encode_value target=(concat ../target "." (asLowerCamelCase label)) source=(concat ../source "." (asStructPropertyName label)) cluster=../cluster errorCode=../errorCode depth=(incrementDepth ../depth)}} - {{/if}} {{/zcl_struct_items_by_struct_and_cluster_name}} {{else}} {{#if_is_strongly_typed_chip_enum type}} diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/templates.json b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/templates.json index c8473493e20879..5eedab0c5ef5b8 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/templates.json +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/templates.json @@ -11,7 +11,6 @@ "darwin/Framework/CHIP/templates/helper.js" ], "resources": { - "availability-data": "../../../../../../src/darwin/Framework/CHIP/templates/availability.yaml", "config-data": "config-data.yaml" }, "override": "../../../../../../src/app/zap-templates/common/override.js", @@ -87,4 +86,4 @@ "output": "examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.mm" } ] -} \ No newline at end of file +} diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.mm index 7e17b667f0905f..fe0676d2f05af7 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.mm +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.mm @@ -27,9 +27,6 @@ #include #include -#include -#include -#include NS_ASSUME_NONNULL_BEGIN