diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/attribute_data_callback_name.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/attribute_data_callback_name.zapt deleted file mode 100644 index ada5f127ffd0b1..00000000000000 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/attribute_data_callback_name.zapt +++ /dev/null @@ -1,33 +0,0 @@ -{{~#if isArray~}} - {{asUpperCamelCase parent.name preserveAcronyms=true}}{{asUpperCamelCase name preserveAcronyms=true}}List -{{~else~}} - {{~#if_is_struct type~}} - {{~! Structs are not used as types of attributes much, so it's - less code to generate the callbacks on a per-attribute basis - than a per-struct-type basis. ~}} - {{asUpperCamelCase parent.name preserveAcronyms=true}}{{asUpperCamelCase name preserveAcronyms=true}}Struct - {{~else if_is_strongly_typed_bitmap type~}} - {{asUpperCamelCase parent.name preserveAcronyms=true}}{{asUpperCamelCase name preserveAcronyms=true}} - {{~else~}} - {{~#if isNullable}}Nullable{{/if~}} - {{~#if (isStrEqual (asUpperCamelCase type) (asUpperCamelCase "vendor_id"))~}} - VendorId - {{~else if_is_strongly_typed_chip_enum type~}} - {{asUpperCamelCase parent.name preserveAcronyms=true}}Cluster{{asUpperCamelCase type preserveAcronyms=true}} - {{~else if (isOctetString type)~}} - OctetString - {{~else if (isCharString type)~}} - CharString - {{~else if (or (is_str_equal type "float") - (is_str_equal type "single"))~}} - Float - {{~else if (is_str_equal type "double")~}} - Double - {{~else if (is_str_equal type "boolean")~}} - Boolean - {{~else~}} - Int{{as_zcl_data_type_size type parent.id sizeIn='bits' roundUpToPowerOfTwo=1}}{{~#if_is_data_type_signed type parent.id~}}s{{else}}u{{/if_is_data_type_signed}} - {{~/if~}} - {{~/if_is_struct~}} -{{~/if~}} -Attribute{{~"remove_extra_spaces"~}} diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/command_completion_type.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/command_completion_type.zapt deleted file mode 100644 index 82707950af35aa..00000000000000 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/command_completion_type.zapt +++ /dev/null @@ -1,19 +0,0 @@ -{{#if command.hasSpecificResponse}} -{{#*inline "clusterName"}} -{{~#if compatRemapNames~}} -{{compatClusterNameRemapping command.parent.name}} -{{~else~}} -{{asUpperCamelCase command.parent.name preserveAcronyms=true}} -{{~/if~}} -{{/inline}} -{{#*inline "responseName"}} -{{~#if compatRemapNames~}} -{{compatCommandNameRemapping command.parent.name command.responseName}} -{{~else~}} -{{asUpperCamelCase command.responseName preserveAcronyms=true}} -{{~/if~}} -{{/inline}} -void (^)(MTR{{> clusterName}}Cluster{{> responseName}}Params * _Nullable data, NSError * _Nullable error) -{{else}} -MTRStatusCompletion -{{/if}} 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 deleted file mode 100644 index f2f4d076b72bfc..00000000000000 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/encode_value.zapt +++ /dev/null @@ -1,64 +0,0 @@ -{{#if isOptional}} - if ({{source}} != nil) { - auto & definedValue_{{depth}} = {{target}}.Emplace(); - {{>encode_value target=(concat "definedValue_" depth) source=source cluster=cluster errorCode=errorCode depth=(incrementDepth depth) isOptional=false}} - } -{{else if isNullable}} - if ({{source}} == nil) { - {{target}}.SetNull(); - } else { - auto & nonNullValue_{{depth}} = {{target}}.SetNonNull(); - {{>encode_value target=(concat "nonNullValue_" depth) source=source cluster=cluster errorCode=errorCode depth=(incrementDepth depth) isNullable=false}} - } -{{else if isArray}} - {{! TODO: This is not great, with its fallible allocation and - whatnot. Maybe we should just switch to encoding our ObjC types - directly to TLV... We need the listFreer thing because we want - our allocation to live long enough, and if it's scoped to where - we are right now it may not (e.g. for a nullable list we're - inside an "else" block here). }} - { - using ListType_{{depth}} = std::remove_reference_t; - using ListMemberType_{{depth}} = ListMemberTypeGetter::Type; - if ({{source}}.count != 0) { - auto * listHolder_{{depth}} = new ListHolder({{source}}.count); - if (listHolder_{{depth}} == nullptr || listHolder_{{depth}}->mList == nullptr) { - {{errorCode}} - } - listFreer.add(listHolder_{{depth}}); - for (size_t i_{{depth}} = 0; i_{{depth}} < {{source}}.count; ++i_{{depth}}) { - if ( ! [{{source}}[i_{{depth}}] isKindOfClass: [{{asObjectiveCClass type cluster forceNotList=true}} class]] ) { - // Wrong kind of value. - {{errorCode}} - } - auto element_{{depth}} = ({{asObjectiveCClass type cluster forceNotList=true}} *){{source}}[i_{{depth}}]; - {{>encode_value target=(concat "listHolder_" depth "->mList[i_" depth "]") source=(concat "element_" depth) cluster=cluster errorCode=errorCode depth=(incrementDepth depth) isArray=false}} - } - {{target}} = ListType_{{depth}}(listHolder_{{depth}}->mList, {{source}}.count); - } else { - {{target}} = ListType_{{depth}}(); - } - } -{{else if (isOctetString type)}} - {{target}} = AsByteSpan({{source}}); -{{else if (isCharString type)}} - {{target}} = AsCharSpan({{source}}); -{{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}} - {{target}} = static_cast>({{source}}.{{asObjectiveCNumberType source type true}}Value); - {{else}} - {{#if_is_strongly_typed_bitmap type}} - {{target}} = static_cast>({{source}}.{{asObjectiveCNumberType source type true}}Value); - {{else}} - {{target}} = {{source}}.{{asObjectiveCNumberType source type true}}Value; - {{/if_is_strongly_typed_bitmap}} - {{/if_is_strongly_typed_chip_enum}} - {{/if_is_struct}} -{{/if}} diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/init_struct_member.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/init_struct_member.zapt deleted file mode 100644 index 3583c7f9d174a3..00000000000000 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/init_struct_member.zapt +++ /dev/null @@ -1,19 +0,0 @@ -{{#*inline "memberName"}}_{{asStructPropertyName label}}{{/inline}} -{{#if isOptional}} -{{>memberName}} = nil; -{{else if isNullable}} -{{>memberName}} = nil; -{{else if isArray}} - {{>memberName}} = [NSArray array]; -{{else if (isOctetString type)}} - {{>memberName}} = [NSData data]; -{{else if (isCharString type)}} - {{>memberName}} = @""; -{{else}} - {{! Our memberName inline partial won't work inside the async if_is_struct }} - {{#if_is_struct type}} - _{{asStructPropertyName label}} = [{{asObjectiveCClass type cluster}} new]; - {{else}} - _{{asStructPropertyName label}} = @(0); - {{/if_is_struct}} -{{/if}} \ No newline at end of file diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/renamed_struct_field_impl.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/renamed_struct_field_impl.zapt deleted file mode 100644 index 2bd52e82f6701b..00000000000000 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/renamed_struct_field_impl.zapt +++ /dev/null @@ -1,9 +0,0 @@ -- (void)set{{asUpperCamelCase oldName}}:({{asObjectiveCType type cluster}}){{asStructPropertyName oldName}} -{ - self.{{asStructPropertyName newName}} = {{asStructPropertyName oldName}}; -} - -- ({{asObjectiveCType type cluster}}){{asGetterName oldName}} -{ - return self.{{asStructPropertyName newName}}; -} diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/struct_field_decl.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/struct_field_decl.zapt deleted file mode 100644 index c5e398facaaf35..00000000000000 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/struct_field_decl.zapt +++ /dev/null @@ -1,3 +0,0 @@ -{{! Override the getter name because some of our properties start with things - like "new" or "init" }} -@property (nonatomic, copy{{#unless (isStrEqual (asGetterName label) (asStructPropertyName label))}}, getter={{asGetterName label}}{{/unless}}) {{asObjectiveCType type cluster}} {{asStructPropertyName label}} {{! Caller provides availability~}} 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 26e1f460bb9599..b746adbd625967 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/templates.json +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/templates.json @@ -20,33 +20,9 @@ "name": "header", "path": "../../../../../../src/app/zap-templates/partials/header.zapt" }, - { - "name": "encode_value", - "path": "partials/encode_value.zapt" - }, { "name": "decode_value", "path": "partials/decode_value.zapt" - }, - { - "name": "init_struct_member", - "path": "partials/init_struct_member.zapt" - }, - { - "name": "command_completion_type", - "path": "partials/command_completion_type.zapt" - }, - { - "name": "attribute_data_callback_name", - "path": "partials/attribute_data_callback_name.zapt" - }, - { - "name": "struct_field_decl", - "path": "partials/struct_field_decl.zapt" - }, - { - "name": "renamed_struct_field_impl", - "path": "partials/renamed_struct_field_impl.zapt" } ], "templates": [