From 3415139c0a2ba7bf9bf384ae18d22bf0ca3e171e Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 31 May 2023 22:16:09 -0400 Subject: [PATCH] Go back to not generating per-cluster types for alias structs for now. (#26958) This is ending up not working quite right because when structs have struct-typed (or list-of-struct-typed) fields, the type expectations people have get messed up. They're still messed up even after this PR, but at least we're not sort of promising they won't be messed up. This reverts #26763 and #26495. --- .../templates/ComplexArgumentParser-src.zapt | 8 + .../templates/ComplexArgumentParser.zapt | 8 + .../logging/DataModelLogger-src.zapt | 8 + .../templates/logging/DataModelLogger.zapt | 8 + .../templates/app/cluster-objects.zapt | 35 +--- .../zap-generated/cluster-objects.h | 96 +-------- .../cluster/ComplexArgumentParser.cpp | 182 ++++++------------ .../cluster/ComplexArgumentParser.h | 29 +-- .../cluster/logging/DataModelLogger.cpp | 151 +++++---------- .../cluster/logging/DataModelLogger.h | 18 +- 10 files changed, 162 insertions(+), 381 deletions(-) diff --git a/examples/chip-tool/templates/ComplexArgumentParser-src.zapt b/examples/chip-tool/templates/ComplexArgumentParser-src.zapt index 1726283f2ef9b7..f9b0f4bef764c5 100644 --- a/examples/chip-tool/templates/ComplexArgumentParser-src.zapt +++ b/examples/chip-tool/templates/ComplexArgumentParser-src.zapt @@ -2,8 +2,16 @@ #include +{{#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 82f6ebfe152c57..7364b243188333 100644 --- a/examples/chip-tool/templates/ComplexArgumentParser.zapt +++ b/examples/chip-tool/templates/ComplexArgumentParser.zapt @@ -5,8 +5,16 @@ #include #include +{{#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 5a918bdd5f13cb..167021f49577d2 100644 --- a/examples/chip-tool/templates/logging/DataModelLogger-src.zapt +++ b/examples/chip-tool/templates/logging/DataModelLogger-src.zapt @@ -4,9 +4,17 @@ 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 1dec72eb32520d..befe9d4210ce07 100644 --- a/examples/chip-tool/templates/logging/DataModelLogger.zapt +++ b/examples/chip-tool/templates/logging/DataModelLogger.zapt @@ -3,9 +3,17 @@ #include #include +{{#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 fbe6e0a320b3c9..0ed26f740fa34d 100644 --- a/src/app/zap-templates/templates/app/cluster-objects.zapt +++ b/src/app/zap-templates/templates/app/cluster-objects.zapt @@ -54,40 +54,7 @@ namespace {{asUpperCamelCase name}} { namespace Structs { {{/first}} {{#if has_more_than_one_cluster}} -namespace {{asUpperCamelCase name}} { - -using Fields = Clusters::detail::Structs::{{asUpperCamelCase name}}::Fields; - -// This is a struct type shared across multiple clusters. Create a type-safe -// declaration in this cluster namespace (so not just pulling in the shared -// implementation via "using", but make sure we can initialize our -// Type/DecodableType from the generic Type/DecodableType as needed. -struct Type : public Clusters::detail::Structs::{{asUpperCamelCase name}}::Type -{ -private: - using Super = Clusters::detail::Structs::{{asUpperCamelCase name}}::Type; -public: - constexpr Type() = default; - constexpr Type(const Super & arg) : Super(arg) {} - constexpr Type(Super && arg) : Super(std::move(arg)) {} -}; - -{{#if struct_contains_array}} -struct DecodableType : public Clusters::detail::Structs::{{asUpperCamelCase name}}::DecodableType -{ -private: - using Super = Clusters::detail::Structs::{{asUpperCamelCase name}}::DecodableType; -public: - DecodableType() = default; - DecodableType(const Super & arg) : Super(arg) {} - DecodableType(Super && arg) : Super(std::move(arg)) {} -}; -{{else}} -using DecodableType = Type; -{{/if}} - -} // namespace {{asUpperCamelCase name}} - +namespace {{asUpperCamelCase name}} = Clusters::detail::Structs::{{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 aba1eeef7cdc8d..3511e17584a67c 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 @@ -13197,29 +13197,7 @@ struct TypeInfo } // namespace GroupKeyManagement namespace FixedLabel { namespace Structs { -namespace LabelStruct { - -using Fields = Clusters::detail::Structs::LabelStruct::Fields; - -// This is a struct type shared across multiple clusters. Create a type-safe -// declaration in this cluster namespace (so not just pulling in the shared -// implementation via "using", but make sure we can initialize our -// Type/DecodableType from the generic Type/DecodableType as needed. -struct Type : public Clusters::detail::Structs::LabelStruct::Type -{ -private: - using Super = Clusters::detail::Structs::LabelStruct::Type; - -public: - constexpr Type() = default; - constexpr Type(const Super & arg) : Super(arg) {} - constexpr Type(Super && arg) : Super(std::move(arg)) {} -}; - -using DecodableType = Type; - -} // namespace LabelStruct - +namespace LabelStruct = Clusters::detail::Structs::LabelStruct; } // namespace Structs namespace Attributes { @@ -13295,29 +13273,7 @@ struct TypeInfo } // namespace FixedLabel namespace UserLabel { namespace Structs { -namespace LabelStruct { - -using Fields = Clusters::detail::Structs::LabelStruct::Fields; - -// This is a struct type shared across multiple clusters. Create a type-safe -// declaration in this cluster namespace (so not just pulling in the shared -// implementation via "using", but make sure we can initialize our -// Type/DecodableType from the generic Type/DecodableType as needed. -struct Type : public Clusters::detail::Structs::LabelStruct::Type -{ -private: - using Super = Clusters::detail::Structs::LabelStruct::Type; - -public: - constexpr Type() = default; - constexpr Type(const Super & arg) : Super(arg) {} - constexpr Type(Super && arg) : Super(std::move(arg)) {} -}; - -using DecodableType = Type; - -} // namespace LabelStruct - +namespace LabelStruct = Clusters::detail::Structs::LabelStruct; } // namespace Structs namespace Attributes { @@ -34938,29 +34894,7 @@ struct TypeInfo } // namespace AudioOutput namespace ApplicationLauncher { namespace Structs { -namespace ApplicationStruct { - -using Fields = Clusters::detail::Structs::ApplicationStruct::Fields; - -// This is a struct type shared across multiple clusters. Create a type-safe -// declaration in this cluster namespace (so not just pulling in the shared -// implementation via "using", but make sure we can initialize our -// Type/DecodableType from the generic Type/DecodableType as needed. -struct Type : public Clusters::detail::Structs::ApplicationStruct::Type -{ -private: - using Super = Clusters::detail::Structs::ApplicationStruct::Type; - -public: - constexpr Type() = default; - constexpr Type(const Super & arg) : Super(arg) {} - constexpr Type(Super && arg) : Super(std::move(arg)) {} -}; - -using DecodableType = Type; - -} // namespace ApplicationStruct - +namespace ApplicationStruct = Clusters::detail::Structs::ApplicationStruct; namespace ApplicationEPStruct { enum class Fields : uint8_t { @@ -35235,29 +35169,7 @@ struct TypeInfo } // namespace ApplicationLauncher namespace ApplicationBasic { namespace Structs { -namespace ApplicationStruct { - -using Fields = Clusters::detail::Structs::ApplicationStruct::Fields; - -// This is a struct type shared across multiple clusters. Create a type-safe -// declaration in this cluster namespace (so not just pulling in the shared -// implementation via "using", but make sure we can initialize our -// Type/DecodableType from the generic Type/DecodableType as needed. -struct Type : public Clusters::detail::Structs::ApplicationStruct::Type -{ -private: - using Super = Clusters::detail::Structs::ApplicationStruct::Type; - -public: - constexpr Type() = default; - constexpr Type(const Super & arg) : Super(arg) {} - constexpr Type(Super && arg) : Super(std::move(arg)) {} -}; - -using DecodableType = Type; - -} // namespace ApplicationStruct - +namespace ApplicationStruct = Clusters::detail::Structs::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 3240478c70981e..04c129470d4a82 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -19,6 +19,66 @@ #include +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) @@ -1715,64 +1775,6 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::GroupKeyManagement::St 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) @@ -2546,38 +2548,6 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::AudioOutput::Structs:: ComplexArgumentParser::Finalize(request.name); } -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) @@ -2611,38 +2581,6 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::ApplicationLauncher::S 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 3393c805021af6..278efc517a3eea 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h @@ -22,6 +22,15 @@ #include #include +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); @@ -209,16 +218,6 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::GroupKeyManagem 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); @@ -322,21 +321,11 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::AudioOutput::St 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 4336af498a6948..7bcf49794650be 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -21,6 +21,56 @@ 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) { @@ -1560,56 +1610,6 @@ DataModelLogger::LogValue(const char * label, size_t indent, 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) @@ -2271,32 +2271,6 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } -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) @@ -2323,31 +2297,6 @@ DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } -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) { 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 62a813d1242ef7..3c435993616a86 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -20,6 +20,12 @@ #include #include +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); @@ -132,12 +138,6 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, 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); @@ -198,15 +198,9 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, 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);