Skip to content

Commit

Permalink
Remove an unused partial (#29690)
Browse files Browse the repository at this point in the history
* Remove an unused partial

Problem:

- `src/app/zap-templates/partials/im_command_handler_cluster_commands.zapt` had
  legacy-preserving code that is now 100% obsolete. The remaining part of it
  that was used can now be inlined in the primary command handling template.

This PR:

- Removed the dead partial and updated templates

Testing done:

- Regenerated ZAP and found no changes to code.

* Restyled by prettier-json

* Fix build

---------

Co-authored-by: tennessee.carmelveilleux@gmail.com <tennessee@google.com>
Co-authored-by: Restyled.io <commits@restyled.io>
  • Loading branch information
3 people authored and pull[bot] committed Feb 2, 2024
1 parent fc17006 commit 1069336
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 98 deletions.
1 change: 0 additions & 1 deletion build/chip/chip_codegen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ function(chip_zapgen TARGET_NAME)
# out links of template files and zap files and such
SET(EXTRA_DEPENDENCIES
"${CHIP_ROOT}/src/app/zap-templates/partials/header.zapt"
"${CHIP_ROOT}/src/app/zap-templates/partials/im_command_handler_cluster_commands.zapt"
"${CHIP_ROOT}/src/app/zap-templates/templates/app/access.zapt"
"${CHIP_ROOT}/src/app/zap-templates/templates/app/CHIPClusters.zapt"
"${CHIP_ROOT}/src/app/zap-templates/templates/app/endpoint_config.zapt"
Expand Down
1 change: 0 additions & 1 deletion build/chip/chip_codegen.gni
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ template("_chip_build_time_zapgen") {
# out links of template files and zap files and such
_extra_dependencies = [
"${_partials_dir}/header.zapt",
"${_partials_dir}/im_command_handler_cluster_commands.zapt",

# Application templates, actually generating files
"${_template_dir}/access.zapt",
Expand Down
4 changes: 0 additions & 4 deletions src/app/zap-templates/app-templates.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
{
"name": "header",
"path": "partials/header.zapt"
},
{
"name": "im_command_handler_cluster_commands",
"path": "partials/im_command_handler_cluster_commands.zapt"
}
],
"templates": [
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP
{
{{/first}}
case Commands::{{asUpperCamelCase commandName}}::Id: {
{{> im_command_handler_cluster_commands}}
Commands::{{asUpperCamelCase commandName}}::DecodableType commandData;
TLVError = DataModel::Decode(aDataTlv, commandData);
if (TLVError == CHIP_NO_ERROR)
{
wasHandled = emberAf{{asUpperCamelCase parent.clusterName}}Cluster{{asUpperCamelCase commandName}}Callback(apCommandObj, aCommandPath, commandData);
}
break;
}
{{#last}}
Expand Down

0 comments on commit 1069336

Please sign in to comment.