Skip to content

Commit

Permalink
Remove dependency on controller-clusters.zap from DataModelLogger. (#…
Browse files Browse the repository at this point in the history
…26577)

For some reason DataModelLogger was only enabling logging for things enabled in
controller-clusters.zap, even though everything else in chip-tool ignores that
configuration.  This just makes DataModelLogger ignore that configuration too,
so we can log everything we can request.
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed May 8, 2024
1 parent 971d599 commit 1642276
Show file tree
Hide file tree
Showing 4 changed files with 433 additions and 10 deletions.
16 changes: 8 additions & 8 deletions examples/chip-tool/templates/logging/DataModelLogger-src.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const {{
{{/zcl_events}}
{{/zcl_clusters}}

{{#all_user_clusters side='client'}}
{{#zcl_clusters}}
{{#zcl_commands_source_server}}
CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const {{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::DecodableType & value)
{
Expand All @@ -52,7 +52,7 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const {{
return CHIP_NO_ERROR;
}
{{/zcl_commands_source_server}}
{{/all_user_clusters}}
{{/zcl_clusters}}

CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributePath & path, chip::TLV::TLVReader * data)
{
Expand All @@ -61,7 +61,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP

switch (path.mClusterId)
{
{{#all_user_clusters side='client'}}
{{#zcl_clusters}}
{{#zcl_attributes_server}}
{{#first}}
case {{asUpperCamelCase parent.name}}::Id:
Expand All @@ -81,7 +81,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP
}
{{/last}}
{{/zcl_attributes_server}}
{{/all_user_clusters}}
{{/zcl_clusters}}
default:
break;
}
Expand All @@ -96,7 +96,7 @@ CHIP_ERROR DataModelLogger::LogCommand(const chip::app::ConcreteCommandPath & pa

switch (path.mClusterId)
{
{{#all_user_clusters side='client'}}
{{#zcl_clusters}}
{{#zcl_commands_source_server}}
{{#first}}
case {{asUpperCamelCase parent.name}}::Id:
Expand All @@ -116,7 +116,7 @@ CHIP_ERROR DataModelLogger::LogCommand(const chip::app::ConcreteCommandPath & pa
}
{{/last}}
{{/zcl_commands_source_server}}
{{/all_user_clusters}}
{{/zcl_clusters}}
default:
break;
}
Expand Down Expand Up @@ -152,7 +152,7 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip

switch (header.mPath.mClusterId)
{
{{#all_user_clusters side='client'}}
{{#zcl_clusters}}
{{#zcl_events}}
{{#first}}
case {{asUpperCamelCase parent.name}}::Id:
Expand All @@ -172,7 +172,7 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip
}
{{/last}}
{{/zcl_events}}
{{/all_user_clusters}}
{{/zcl_clusters}}
default:
break;
}
Expand Down
4 changes: 2 additions & 2 deletions examples/chip-tool/templates/logging/DataModelLogger.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::C
{{/zcl_events}}
{{/zcl_clusters}}

{{#all_user_clusters side='client'}}
{{#zcl_clusters}}
{{#zcl_commands_source_server}}
static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::{{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::DecodableType & value);
{{/zcl_commands_source_server}}
{{/all_user_clusters}}
{{/zcl_clusters}}
Loading

0 comments on commit 1642276

Please sign in to comment.