Improve handling of single structs associated with many clusters. (#26495)
Instead of having a single set of types under "namespace detail" plus namespace
aliases, have actual distinct types in the distinct cluster namespaces, with a
common super-class in the detail namespace to improve code sharing. This
still leaves the fields enums as an alias of the detail bits, but people are
unlikely to be dispatching to overloads on the type of that fields enum.
diff --git a/examples/chip-tool/templates/ComplexArgumentParser-src.zapt b/examples/chip-tool/templates/ComplexArgumentParser-src.zapt
index f9b0f4b..1726283 100644
--- a/examples/chip-tool/templates/ComplexArgumentParser-src.zapt
+++ b/examples/chip-tool/templates/ComplexArgumentParser-src.zapt
@@ -2,16 +2,8 @@
#include <commands/clusters/ComplexArgument.h>
-{{#zcl_structs}}
-{{#if has_more_than_one_cluster}}
-{{> struct_parser_impl namespace="detail"}}
-{{/if}}
-{{/zcl_structs}}
-
{{#zcl_clusters}}
{{#zcl_structs}}
-{{#unless has_more_than_one_cluster}}
{{> struct_parser_impl namespace=(as_camel_cased ../name false)}}
-{{/unless}}
{{/zcl_structs}}
{{/zcl_clusters}}
diff --git a/examples/chip-tool/templates/ComplexArgumentParser.zapt b/examples/chip-tool/templates/ComplexArgumentParser.zapt
index 7364b24..82f6ebf 100644
--- a/examples/chip-tool/templates/ComplexArgumentParser.zapt
+++ b/examples/chip-tool/templates/ComplexArgumentParser.zapt
@@ -5,16 +5,8 @@
#include <lib/core/CHIPError.h>
#include <app-common/zap-generated/cluster-objects.h>
-{{#zcl_structs}}
-{{#if has_more_than_one_cluster}}
-{{> struct_parser_decl namespace="detail"}}
-{{/if}}
-{{/zcl_structs}}
-
{{#zcl_clusters}}
{{#zcl_structs}}
-{{#unless has_more_than_one_cluster}}
{{> struct_parser_decl namespace=(as_camel_cased ../name false)}}
-{{/unless}}
{{/zcl_structs}}
{{/zcl_clusters}}
diff --git a/examples/chip-tool/templates/logging/DataModelLogger-src.zapt b/examples/chip-tool/templates/logging/DataModelLogger-src.zapt
index 167021f..5a918bd 100644
--- a/examples/chip-tool/templates/logging/DataModelLogger-src.zapt
+++ b/examples/chip-tool/templates/logging/DataModelLogger-src.zapt
@@ -4,17 +4,9 @@
using namespace chip::app::Clusters;
-{{#zcl_structs}}
-{{#if has_more_than_one_cluster}}
-{{> struct_logger_impl namespace="detail"}}
-{{/if}}
-{{/zcl_structs}}
-
{{#zcl_clusters}}
{{#zcl_structs}}
-{{#unless has_more_than_one_cluster}}
{{> struct_logger_impl namespace=(as_camel_cased ../name false)}}
-{{/unless}}
{{/zcl_structs}}
{{/zcl_clusters}}
diff --git a/examples/chip-tool/templates/logging/DataModelLogger.zapt b/examples/chip-tool/templates/logging/DataModelLogger.zapt
index befe9d4..1dec72e 100644
--- a/examples/chip-tool/templates/logging/DataModelLogger.zapt
+++ b/examples/chip-tool/templates/logging/DataModelLogger.zapt
@@ -3,17 +3,9 @@
#include <lib/core/CHIPError.h>
#include <app-common/zap-generated/cluster-objects.h>
-{{#zcl_structs}}
-{{#if has_more_than_one_cluster}}
-{{> struct_logger_decl namespace="detail"}}
-{{/if}}
-{{/zcl_structs}}
-
{{#zcl_clusters}}
{{#zcl_structs}}
-{{#unless has_more_than_one_cluster}}
{{> struct_logger_decl namespace=(as_camel_cased ../name false)}}
-{{/unless}}
{{/zcl_structs}}
{{/zcl_clusters}}
diff --git a/src/app/zap-templates/templates/app/cluster-objects.zapt b/src/app/zap-templates/templates/app/cluster-objects.zapt
index 0ed26f7..e8ffcc3 100644
--- a/src/app/zap-templates/templates/app/cluster-objects.zapt
+++ b/src/app/zap-templates/templates/app/cluster-objects.zapt
@@ -54,7 +54,24 @@
namespace Structs {
{{/first}}
{{#if has_more_than_one_cluster}}
-namespace {{asUpperCamelCase name}} = Clusters::detail::Structs::{{asUpperCamelCase name}};
+namespace {{asUpperCamelCase name}} {
+
+using Fields = Clusters::detail::Structs::{{asUpperCamelCase name}}::Fields;
+
+struct Type : public Clusters::detail::Structs::{{asUpperCamelCase name}}::Type
+{
+};
+
+{{#if struct_contains_array}}
+struct DecodableType : public Clusters::detail::Structs::{{asUpperCamelCase name}}::DecodableType
+{
+};
+{{else}}
+using DecodableType = Type;
+{{/if}}
+
+} // namespace {{asUpperCamelCase name}}
+
{{else}}
{{> cluster_objects_struct header=true}}
{{/if}}
diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h
index 6274331..703cec6 100644
--- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h
+++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h
@@ -13175,7 +13175,18 @@
} // namespace GroupKeyManagement
namespace FixedLabel {
namespace Structs {
-namespace LabelStruct = Clusters::detail::Structs::LabelStruct;
+namespace LabelStruct {
+
+using Fields = Clusters::detail::Structs::LabelStruct::Fields;
+
+struct Type : public Clusters::detail::Structs::LabelStruct::Type
+{
+};
+
+using DecodableType = Type;
+
+} // namespace LabelStruct
+
} // namespace Structs
namespace Attributes {
@@ -13251,7 +13262,18 @@
} // namespace FixedLabel
namespace UserLabel {
namespace Structs {
-namespace LabelStruct = Clusters::detail::Structs::LabelStruct;
+namespace LabelStruct {
+
+using Fields = Clusters::detail::Structs::LabelStruct::Fields;
+
+struct Type : public Clusters::detail::Structs::LabelStruct::Type
+{
+};
+
+using DecodableType = Type;
+
+} // namespace LabelStruct
+
} // namespace Structs
namespace Attributes {
@@ -26006,7 +26028,18 @@
} // namespace AudioOutput
namespace ApplicationLauncher {
namespace Structs {
-namespace ApplicationStruct = Clusters::detail::Structs::ApplicationStruct;
+namespace ApplicationStruct {
+
+using Fields = Clusters::detail::Structs::ApplicationStruct::Fields;
+
+struct Type : public Clusters::detail::Structs::ApplicationStruct::Type
+{
+};
+
+using DecodableType = Type;
+
+} // namespace ApplicationStruct
+
namespace ApplicationEPStruct {
enum class Fields : uint8_t
{
@@ -26281,7 +26314,18 @@
} // namespace ApplicationLauncher
namespace ApplicationBasic {
namespace Structs {
-namespace ApplicationStruct = Clusters::detail::Structs::ApplicationStruct;
+namespace ApplicationStruct {
+
+using Fields = Clusters::detail::Structs::ApplicationStruct::Fields;
+
+struct Type : public Clusters::detail::Structs::ApplicationStruct::Type
+{
+};
+
+using DecodableType = Type;
+
+} // namespace ApplicationStruct
+
} // namespace Structs
namespace Attributes {
diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp
index 57b7ee1..5c53b15 100644
--- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp
+++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp
@@ -19,66 +19,6 @@
#include <commands/clusters/ComplexArgument.h>
-CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::detail::Structs::ApplicationStruct::Type & request,
- Json::Value & value)
-{
- VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT);
-
- // Copy to track which members we already processed.
- Json::Value valueCopy(value);
-
- ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ApplicationStruct.catalogVendorID", "catalogVendorID",
- value.isMember("catalogVendorID")));
- ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ApplicationStruct.applicationID", "applicationID",
- value.isMember("applicationID")));
-
- char labelWithMember[kMaxLabelLength];
- snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "catalogVendorID");
- ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.catalogVendorID, value["catalogVendorID"]));
- valueCopy.removeMember("catalogVendorID");
-
- snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "applicationID");
- ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.applicationID, value["applicationID"]));
- valueCopy.removeMember("applicationID");
-
- return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy);
-}
-
-void ComplexArgumentParser::Finalize(chip::app::Clusters::detail::Structs::ApplicationStruct::Type & request)
-{
- ComplexArgumentParser::Finalize(request.catalogVendorID);
- ComplexArgumentParser::Finalize(request.applicationID);
-}
-
-CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::detail::Structs::LabelStruct::Type & request,
- Json::Value & value)
-{
- VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT);
-
- // Copy to track which members we already processed.
- Json::Value valueCopy(value);
-
- ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("LabelStruct.label", "label", value.isMember("label")));
- ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("LabelStruct.value", "value", value.isMember("value")));
-
- char labelWithMember[kMaxLabelLength];
- snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "label");
- ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.label, value["label"]));
- valueCopy.removeMember("label");
-
- snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "value");
- ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.value, value["value"]));
- valueCopy.removeMember("value");
-
- return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy);
-}
-
-void ComplexArgumentParser::Finalize(chip::app::Clusters::detail::Structs::LabelStruct::Type & request)
-{
- ComplexArgumentParser::Finalize(request.label);
- ComplexArgumentParser::Finalize(request.value);
-}
-
CHIP_ERROR ComplexArgumentParser::Setup(const char * label,
chip::app::Clusters::Scenes::Structs::AttributeValuePair::Type & request,
Json::Value & value)
@@ -1766,6 +1706,64 @@
ComplexArgumentParser::Finalize(request.epochStartTime2);
}
+CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::FixedLabel::Structs::LabelStruct::Type & request,
+ Json::Value & value)
+{
+ VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT);
+
+ // Copy to track which members we already processed.
+ Json::Value valueCopy(value);
+
+ ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("LabelStruct.label", "label", value.isMember("label")));
+ ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("LabelStruct.value", "value", value.isMember("value")));
+
+ char labelWithMember[kMaxLabelLength];
+ snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "label");
+ ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.label, value["label"]));
+ valueCopy.removeMember("label");
+
+ snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "value");
+ ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.value, value["value"]));
+ valueCopy.removeMember("value");
+
+ return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy);
+}
+
+void ComplexArgumentParser::Finalize(chip::app::Clusters::FixedLabel::Structs::LabelStruct::Type & request)
+{
+ ComplexArgumentParser::Finalize(request.label);
+ ComplexArgumentParser::Finalize(request.value);
+}
+
+CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::UserLabel::Structs::LabelStruct::Type & request,
+ Json::Value & value)
+{
+ VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT);
+
+ // Copy to track which members we already processed.
+ Json::Value valueCopy(value);
+
+ ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("LabelStruct.label", "label", value.isMember("label")));
+ ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("LabelStruct.value", "value", value.isMember("value")));
+
+ char labelWithMember[kMaxLabelLength];
+ snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "label");
+ ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.label, value["label"]));
+ valueCopy.removeMember("label");
+
+ snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "value");
+ ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.value, value["value"]));
+ valueCopy.removeMember("value");
+
+ return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy);
+}
+
+void ComplexArgumentParser::Finalize(chip::app::Clusters::UserLabel::Structs::LabelStruct::Type & request)
+{
+ ComplexArgumentParser::Finalize(request.label);
+ ComplexArgumentParser::Finalize(request.value);
+}
+
CHIP_ERROR ComplexArgumentParser::Setup(const char * label,
chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::Type & request,
Json::Value & value)
@@ -2435,6 +2433,38 @@
}
CHIP_ERROR ComplexArgumentParser::Setup(const char * label,
+ chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type & request,
+ Json::Value & value)
+{
+ VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT);
+
+ // Copy to track which members we already processed.
+ Json::Value valueCopy(value);
+
+ ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ApplicationStruct.catalogVendorID", "catalogVendorID",
+ value.isMember("catalogVendorID")));
+ ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ApplicationStruct.applicationID", "applicationID",
+ value.isMember("applicationID")));
+
+ char labelWithMember[kMaxLabelLength];
+ snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "catalogVendorID");
+ ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.catalogVendorID, value["catalogVendorID"]));
+ valueCopy.removeMember("catalogVendorID");
+
+ snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "applicationID");
+ ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.applicationID, value["applicationID"]));
+ valueCopy.removeMember("applicationID");
+
+ return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy);
+}
+
+void ComplexArgumentParser::Finalize(chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type & request)
+{
+ ComplexArgumentParser::Finalize(request.catalogVendorID);
+ ComplexArgumentParser::Finalize(request.applicationID);
+}
+
+CHIP_ERROR ComplexArgumentParser::Setup(const char * label,
chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEPStruct::Type & request,
Json::Value & value)
{
@@ -2467,6 +2497,38 @@
ComplexArgumentParser::Finalize(request.endpoint);
}
+CHIP_ERROR ComplexArgumentParser::Setup(const char * label,
+ chip::app::Clusters::ApplicationBasic::Structs::ApplicationStruct::Type & request,
+ Json::Value & value)
+{
+ VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT);
+
+ // Copy to track which members we already processed.
+ Json::Value valueCopy(value);
+
+ ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ApplicationStruct.catalogVendorID", "catalogVendorID",
+ value.isMember("catalogVendorID")));
+ ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ApplicationStruct.applicationID", "applicationID",
+ value.isMember("applicationID")));
+
+ char labelWithMember[kMaxLabelLength];
+ snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "catalogVendorID");
+ ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.catalogVendorID, value["catalogVendorID"]));
+ valueCopy.removeMember("catalogVendorID");
+
+ snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "applicationID");
+ ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.applicationID, value["applicationID"]));
+ valueCopy.removeMember("applicationID");
+
+ return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy);
+}
+
+void ComplexArgumentParser::Finalize(chip::app::Clusters::ApplicationBasic::Structs::ApplicationStruct::Type & request)
+{
+ ComplexArgumentParser::Finalize(request.catalogVendorID);
+ ComplexArgumentParser::Finalize(request.applicationID);
+}
+
CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::UnitTesting::Structs::SimpleStruct::Type & request,
Json::Value & value)
{
diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h
index 6d5368a..9336e56 100644
--- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h
+++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h
@@ -22,15 +22,6 @@
#include <app-common/zap-generated/cluster-objects.h>
#include <lib/core/CHIPError.h>
-static CHIP_ERROR Setup(const char * label, chip::app::Clusters::detail::Structs::ApplicationStruct::Type & request,
- Json::Value & value);
-
-static void Finalize(chip::app::Clusters::detail::Structs::ApplicationStruct::Type & request);
-
-static CHIP_ERROR Setup(const char * label, chip::app::Clusters::detail::Structs::LabelStruct::Type & request, Json::Value & value);
-
-static void Finalize(chip::app::Clusters::detail::Structs::LabelStruct::Type & request);
-
static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Scenes::Structs::AttributeValuePair::Type & request,
Json::Value & value);
@@ -216,6 +207,16 @@
static void Finalize(chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySetStruct::Type & request);
+static CHIP_ERROR Setup(const char * label, chip::app::Clusters::FixedLabel::Structs::LabelStruct::Type & request,
+ Json::Value & value);
+
+static void Finalize(chip::app::Clusters::FixedLabel::Structs::LabelStruct::Type & request);
+
+static CHIP_ERROR Setup(const char * label, chip::app::Clusters::UserLabel::Structs::LabelStruct::Type & request,
+ Json::Value & value);
+
+static void Finalize(chip::app::Clusters::UserLabel::Structs::LabelStruct::Type & request);
+
static CHIP_ERROR Setup(const char * label,
chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::Type & request,
Json::Value & value);
@@ -303,11 +304,21 @@
static void Finalize(chip::app::Clusters::AudioOutput::Structs::OutputInfoStruct::Type & request);
+static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type & request,
+ Json::Value & value);
+
+static void Finalize(chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type & request);
+
static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEPStruct::Type & request,
Json::Value & value);
static void Finalize(chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEPStruct::Type & request);
+static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ApplicationBasic::Structs::ApplicationStruct::Type & request,
+ Json::Value & value);
+
+static void Finalize(chip::app::Clusters::ApplicationBasic::Structs::ApplicationStruct::Type & request);
+
static CHIP_ERROR Setup(const char * label, chip::app::Clusters::UnitTesting::Structs::SimpleStruct::Type & request,
Json::Value & value);
diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp
index 596663c..57fcae9 100644
--- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp
+++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp
@@ -22,56 +22,6 @@
using namespace chip::app::Clusters;
CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent,
- const chip::app::Clusters::detail::Structs::ApplicationStruct::DecodableType & value)
-{
- DataModelLogger::LogString(label, indent, "{");
- {
- CHIP_ERROR err = LogValue("CatalogVendorID", indent + 1, value.catalogVendorID);
- if (err != CHIP_NO_ERROR)
- {
- DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'CatalogVendorID'");
- return err;
- }
- }
- {
- CHIP_ERROR err = LogValue("ApplicationID", indent + 1, value.applicationID);
- if (err != CHIP_NO_ERROR)
- {
- DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ApplicationID'");
- return err;
- }
- }
- DataModelLogger::LogString(indent, "}");
-
- return CHIP_NO_ERROR;
-}
-
-CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent,
- const chip::app::Clusters::detail::Structs::LabelStruct::DecodableType & value)
-{
- DataModelLogger::LogString(label, indent, "{");
- {
- CHIP_ERROR err = LogValue("Label", indent + 1, value.label);
- if (err != CHIP_NO_ERROR)
- {
- DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Label'");
- return err;
- }
- }
- {
- CHIP_ERROR err = LogValue("Value", indent + 1, value.value);
- if (err != CHIP_NO_ERROR)
- {
- DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Value'");
- return err;
- }
- }
- DataModelLogger::LogString(indent, "}");
-
- return CHIP_NO_ERROR;
-}
-
-CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent,
const chip::app::Clusters::Scenes::Structs::AttributeValuePair::DecodableType & value)
{
DataModelLogger::LogString(label, indent, "{");
@@ -1609,6 +1559,56 @@
return CHIP_NO_ERROR;
}
+CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent,
+ const chip::app::Clusters::FixedLabel::Structs::LabelStruct::DecodableType & value)
+{
+ DataModelLogger::LogString(label, indent, "{");
+ {
+ CHIP_ERROR err = LogValue("Label", indent + 1, value.label);
+ if (err != CHIP_NO_ERROR)
+ {
+ DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Label'");
+ return err;
+ }
+ }
+ {
+ CHIP_ERROR err = LogValue("Value", indent + 1, value.value);
+ if (err != CHIP_NO_ERROR)
+ {
+ DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Value'");
+ return err;
+ }
+ }
+ DataModelLogger::LogString(indent, "}");
+
+ return CHIP_NO_ERROR;
+}
+
+CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent,
+ const chip::app::Clusters::UserLabel::Structs::LabelStruct::DecodableType & value)
+{
+ DataModelLogger::LogString(label, indent, "{");
+ {
+ CHIP_ERROR err = LogValue("Label", indent + 1, value.label);
+ if (err != CHIP_NO_ERROR)
+ {
+ DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Label'");
+ return err;
+ }
+ }
+ {
+ CHIP_ERROR err = LogValue("Value", indent + 1, value.value);
+ if (err != CHIP_NO_ERROR)
+ {
+ DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Value'");
+ return err;
+ }
+ }
+ DataModelLogger::LogString(indent, "}");
+
+ return CHIP_NO_ERROR;
+}
+
CHIP_ERROR
DataModelLogger::LogValue(const char * label, size_t indent,
const chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::DecodableType & value)
@@ -2187,6 +2187,32 @@
CHIP_ERROR
DataModelLogger::LogValue(const char * label, size_t indent,
+ const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::DecodableType & value)
+{
+ DataModelLogger::LogString(label, indent, "{");
+ {
+ CHIP_ERROR err = LogValue("CatalogVendorID", indent + 1, value.catalogVendorID);
+ if (err != CHIP_NO_ERROR)
+ {
+ DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'CatalogVendorID'");
+ return err;
+ }
+ }
+ {
+ CHIP_ERROR err = LogValue("ApplicationID", indent + 1, value.applicationID);
+ if (err != CHIP_NO_ERROR)
+ {
+ DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ApplicationID'");
+ return err;
+ }
+ }
+ DataModelLogger::LogString(indent, "}");
+
+ return CHIP_NO_ERROR;
+}
+
+CHIP_ERROR
+DataModelLogger::LogValue(const char * label, size_t indent,
const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEPStruct::DecodableType & value)
{
DataModelLogger::LogString(label, indent, "{");
@@ -2212,6 +2238,31 @@
}
CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent,
+ const chip::app::Clusters::ApplicationBasic::Structs::ApplicationStruct::DecodableType & value)
+{
+ DataModelLogger::LogString(label, indent, "{");
+ {
+ CHIP_ERROR err = LogValue("CatalogVendorID", indent + 1, value.catalogVendorID);
+ if (err != CHIP_NO_ERROR)
+ {
+ DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'CatalogVendorID'");
+ return err;
+ }
+ }
+ {
+ CHIP_ERROR err = LogValue("ApplicationID", indent + 1, value.applicationID);
+ if (err != CHIP_NO_ERROR)
+ {
+ DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ApplicationID'");
+ return err;
+ }
+ }
+ DataModelLogger::LogString(indent, "}");
+
+ return CHIP_NO_ERROR;
+}
+
+CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent,
const chip::app::Clusters::UnitTesting::Structs::SimpleStruct::DecodableType & value)
{
DataModelLogger::LogString(label, indent, "{");
diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h
index 4ca2cb8..7d96f2a 100644
--- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h
+++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h
@@ -21,12 +21,6 @@
#include <lib/core/CHIPError.h>
static CHIP_ERROR LogValue(const char * label, size_t indent,
- const chip::app::Clusters::detail::Structs::ApplicationStruct::DecodableType & value);
-
-static CHIP_ERROR LogValue(const char * label, size_t indent,
- const chip::app::Clusters::detail::Structs::LabelStruct::DecodableType & value);
-
-static CHIP_ERROR LogValue(const char * label, size_t indent,
const chip::app::Clusters::Scenes::Structs::AttributeValuePair::DecodableType & value);
static CHIP_ERROR LogValue(const char * label, size_t indent,
@@ -138,6 +132,12 @@
const chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySetStruct::DecodableType & value);
static CHIP_ERROR LogValue(const char * label, size_t indent,
+ const chip::app::Clusters::FixedLabel::Structs::LabelStruct::DecodableType & value);
+
+static CHIP_ERROR LogValue(const char * label, size_t indent,
+ const chip::app::Clusters::UserLabel::Structs::LabelStruct::DecodableType & value);
+
+static CHIP_ERROR LogValue(const char * label, size_t indent,
const chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::DecodableType & value);
static CHIP_ERROR LogValue(const char * label, size_t indent,
@@ -189,9 +189,15 @@
const chip::app::Clusters::AudioOutput::Structs::OutputInfoStruct::DecodableType & value);
static CHIP_ERROR LogValue(const char * label, size_t indent,
+ const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::DecodableType & value);
+
+static CHIP_ERROR LogValue(const char * label, size_t indent,
const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEPStruct::DecodableType & value);
static CHIP_ERROR LogValue(const char * label, size_t indent,
+ const chip::app::Clusters::ApplicationBasic::Structs::ApplicationStruct::DecodableType & value);
+
+static CHIP_ERROR LogValue(const char * label, size_t indent,
const chip::app::Clusters::UnitTesting::Structs::SimpleStruct::DecodableType & value);
static CHIP_ERROR LogValue(const char * label, size_t indent,