From e91f9b2bb87316727e4f9a70e501453d177671b5 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Tue, 5 Oct 2021 14:43:56 +0200 Subject: [PATCH 1/2] Use chip::app::ConcreteCommandPath for DispatchSingleClusterCommand, DispatchSingleClusterCommandResponse and ServerClusterCommandExists --- .../commands/clusters/ModelCommand.cpp | 11 ---- src/app/CommandHandler.cpp | 8 ++- src/app/CommandSender.cpp | 3 +- src/app/InteractionModelEngine.h | 11 ++-- src/app/tests/TestCommandInteraction.cpp | 26 ++++----- .../tests/integration/chip_im_initiator.cpp | 13 +++-- .../tests/integration/chip_im_responder.cpp | 20 ++++--- .../util/ember-compatibility-functions.cpp | 12 ++-- src/app/util/ember-compatibility-functions.h | 3 +- .../app/im-cluster-command-handler.zapt | 58 ++++++++++--------- 10 files changed, 85 insertions(+), 80 deletions(-) diff --git a/examples/chip-tool/commands/clusters/ModelCommand.cpp b/examples/chip-tool/commands/clusters/ModelCommand.cpp index c6a7c658c1495e..35946ec6ed97be 100644 --- a/examples/chip-tool/commands/clusters/ModelCommand.cpp +++ b/examples/chip-tool/commands/clusters/ModelCommand.cpp @@ -23,17 +23,6 @@ using namespace ::chip; -void DispatchSingleClusterCommand(chip::ClusterId aClusterId, chip::CommandId aCommandId, chip::EndpointId aEndPointId, - chip::TLV::TLVReader & aReader, Command * apCommandObj) -{ - ChipLogDetail(Controller, - "Received Cluster Command: Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI " Endpoint=%" PRIx16, - ChipLogValueMEI(aClusterId), ChipLogValueMEI(aCommandId), aEndPointId); - ChipLogError( - Controller, - "Default DispatchSingleClusterCommand is called, this should be replaced by actual dispatched for cluster commands"); -} - CHIP_ERROR ModelCommand::Run() { CHIP_ERROR err = CHIP_NO_ERROR; diff --git a/src/app/CommandHandler.cpp b/src/app/CommandHandler.cpp index ed1c7c532e3ef0..98a6d687a26fd0 100644 --- a/src/app/CommandHandler.cpp +++ b/src/app/CommandHandler.cpp @@ -86,14 +86,18 @@ CHIP_ERROR CommandHandler::ProcessCommandDataElement(CommandDataElement::Parser err = aCommandElement.GetCommandPath(&commandPath); SuccessOrExit(err); + err = commandPath.GetClusterId(&clusterId); SuccessOrExit(err); + err = commandPath.GetCommandId(&commandId); SuccessOrExit(err); + err = commandPath.GetEndpointId(&endpointId); SuccessOrExit(err); - VerifyOrExit(ServerClusterCommandExists(clusterId, commandId, endpointId), err = CHIP_ERROR_INVALID_PROFILE_ID); + VerifyOrExit(ServerClusterCommandExists(ConcreteCommandPath(endpointId, clusterId, commandId)), + err = CHIP_ERROR_INVALID_PROFILE_ID); err = aCommandElement.GetData(&commandDataReader); if (CHIP_END_OF_TLV == err) @@ -103,7 +107,7 @@ CHIP_ERROR CommandHandler::ProcessCommandDataElement(CommandDataElement::Parser } if (CHIP_NO_ERROR == err) { - DispatchSingleClusterCommand(clusterId, commandId, endpointId, commandDataReader, this); + DispatchSingleClusterCommand(ConcreteCommandPath(endpointId, clusterId, commandId), commandDataReader, this); } exit: diff --git a/src/app/CommandSender.cpp b/src/app/CommandSender.cpp index f7f549f6b54dae..25e1b74f2fd224 100644 --- a/src/app/CommandSender.cpp +++ b/src/app/CommandSender.cpp @@ -130,6 +130,7 @@ CHIP_ERROR CommandSender::ProcessCommandDataElement(CommandDataElement::Parser & err = commandPath.GetClusterId(&clusterId); SuccessOrExit(err); + err = commandPath.GetCommandId(&commandId); SuccessOrExit(err); @@ -153,7 +154,7 @@ CHIP_ERROR CommandSender::ProcessCommandDataElement(CommandDataElement::Parser & err = aCommandElement.GetData(&commandDataReader); SuccessOrExit(err); // TODO(#4503): Should call callbacks of cluster that sends the command. - DispatchSingleClusterResponseCommand(clusterId, commandId, endpointId, commandDataReader, this); + DispatchSingleClusterResponseCommand(ConcreteCommandPath(endpointId, clusterId, commandId), commandDataReader, this); } exit: diff --git a/src/app/InteractionModelEngine.h b/src/app/InteractionModelEngine.h index 3e0dd9e1e30ca3..30d5844c244929 100644 --- a/src/app/InteractionModelEngine.h +++ b/src/app/InteractionModelEngine.h @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -210,10 +211,10 @@ class InteractionModelEngine : public Messaging::ExchangeDelegate ClusterInfo * mpNextAvailableClusterInfo = nullptr; }; -void DispatchSingleClusterCommand(chip::ClusterId aClusterId, chip::CommandId aCommandId, chip::EndpointId aEndPointId, - chip::TLV::TLVReader & aReader, CommandHandler * apCommandObj); -void DispatchSingleClusterResponseCommand(chip::ClusterId aClusterId, chip::CommandId aCommandId, chip::EndpointId aEndPointId, - chip::TLV::TLVReader & aReader, CommandSender * apCommandObj); +void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, chip::TLV::TLVReader & aReader, + CommandHandler * apCommandObj); +void DispatchSingleClusterResponseCommand(const ConcreteCommandPath & aCommandPath, chip::TLV::TLVReader & aReader, + CommandSender * apCommandObj); /** * Check whether the given cluster exists on the given endpoint and supports the given command. @@ -225,7 +226,7 @@ void DispatchSingleClusterResponseCommand(chip::ClusterId aClusterId, chip::Comm * @retval True if the endpoint contains the server side of the given cluster and that cluster implements the given command, false * otherwise. */ -bool ServerClusterCommandExists(chip::ClusterId aClusterId, chip::CommandId aCommandId, chip::EndpointId aEndPointId); +bool ServerClusterCommandExists(const ConcreteCommandPath & aCommandPath); /** * Fetch attribute value and version info and write to the TLVWriter provided. diff --git a/src/app/tests/TestCommandInteraction.cpp b/src/app/tests/TestCommandInteraction.cpp index fff01f017f5f41..3b7f929a674977 100644 --- a/src/app/tests/TestCommandInteraction.cpp +++ b/src/app/tests/TestCommandInteraction.cpp @@ -65,33 +65,33 @@ constexpr CommandId kTestCommandId = 4; namespace app { -void DispatchSingleClusterCommand(chip::ClusterId aClusterId, chip::CommandId aCommandId, chip::EndpointId aEndPointId, - chip::TLV::TLVReader & aReader, CommandHandler * apCommandObj) +void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, chip::TLV::TLVReader & aReader, + CommandHandler * apCommandObj) { - chip::app::ConcreteCommandPath commandPath(aEndPointId, aClusterId, aCommandId); - ChipLogDetail(Controller, - "Received Cluster Command: Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI " Endpoint=%" PRIx16, - ChipLogValueMEI(aClusterId), ChipLogValueMEI(aCommandId), aEndPointId); + "Received Cluster Command: Endpoint=%" PRIx16 " Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, + aCommandPath.mEndpointId, ChipLogValueMEI(aCommandPath.mClusterId), ChipLogValueMEI(aCommandPath.mCommandId)); - apCommandObj->AddStatusCode(commandPath, Protocols::SecureChannel::GeneralStatusCode::kSuccess, Protocols::SecureChannel::Id, + apCommandObj->AddStatusCode(aCommandPath, Protocols::SecureChannel::GeneralStatusCode::kSuccess, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::Success); chip::isCommandDispatched = true; } -void DispatchSingleClusterResponseCommand(chip::ClusterId aClusterId, chip::CommandId aCommandId, chip::EndpointId aEndPointId, - chip::TLV::TLVReader & aReader, CommandSender * apCommandObj) +void DispatchSingleClusterResponseCommand(const ConcreteCommandPath & aCommandPath, chip::TLV::TLVReader & aReader, + CommandSender * apCommandObj) { - ChipLogDetail(Controller, "Received Cluster Command: Cluster=%" PRIx32 " Command=%" PRIx32 " Endpoint=%" PRIx16, aClusterId, - aCommandId, aEndPointId); + ChipLogDetail(Controller, + "Received Cluster Command: Endpoint=%" PRIx16 " Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, + aCommandPath.mEndpointId, ChipLogValueMEI(aCommandPath.mClusterId), ChipLogValueMEI(aCommandPath.mCommandId)); // Nothing todo. } -bool ServerClusterCommandExists(chip::ClusterId aClusterId, chip::CommandId aCommandId, chip::EndpointId aEndPointId) +bool ServerClusterCommandExists(const ConcreteCommandPath & aCommandPath) { // Mock cluster catalog, only support one command on one cluster on one endpoint. - return (aEndPointId == kTestEndpointId && aClusterId == kTestClusterId && aCommandId == kTestCommandId); + return (aCommandPath.mEndpointId == kTestEndpointId && aCommandPath.mClusterId == kTestClusterId && + aCommandPath.mCommandId == kTestCommandId); } class TestCommandInteraction diff --git a/src/app/tests/integration/chip_im_initiator.cpp b/src/app/tests/integration/chip_im_initiator.cpp index a4d67460153fe3..24cc32c13ee9d5 100644 --- a/src/app/tests/integration/chip_im_initiator.cpp +++ b/src/app/tests/integration/chip_im_initiator.cpp @@ -620,22 +620,23 @@ class MockInteractionModelApp : public chip::app::InteractionModelDelegate namespace chip { namespace app { -bool ServerClusterCommandExists(chip::ClusterId aClusterId, chip::CommandId aCommandId, chip::EndpointId aEndPointId) +bool ServerClusterCommandExists(const ConcreteCommandPath & aCommandPath) { // Always return true in test. return true; } -void DispatchSingleClusterCommand(chip::ClusterId aClusterId, chip::CommandId aCommandId, chip::EndpointId aEndPointId, - chip::TLV::TLVReader & aReader, CommandHandler * apCommandObj) +void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, chip::TLV::TLVReader & aReader, + CommandHandler * apCommandObj) { // Nothing todo. } -void DispatchSingleClusterResponseCommand(chip::ClusterId aClusterId, chip::CommandId aCommandId, chip::EndpointId aEndPointId, - chip::TLV::TLVReader & aReader, CommandSender * apCommandObj) +void DispatchSingleClusterResponseCommand(const ConcreteCommandPath & aCommandPath, chip::TLV::TLVReader & aReader, + CommandSender * apCommandObj) { - if (aClusterId != kTestClusterId || aCommandId != kTestCommandId || aEndPointId != kTestEndpointId) + if (aCommandPath.mClusterId != kTestClusterId || aCommandPath.mCommandId != kTestCommandId || + aCommandPath.mEndpointId != kTestEndpointId) { return; } diff --git a/src/app/tests/integration/chip_im_responder.cpp b/src/app/tests/integration/chip_im_responder.cpp index 97d11f82287342..10f86ed483660f 100644 --- a/src/app/tests/integration/chip_im_responder.cpp +++ b/src/app/tests/integration/chip_im_responder.cpp @@ -44,18 +44,19 @@ namespace chip { namespace app { -bool ServerClusterCommandExists(chip::ClusterId aClusterId, chip::CommandId aCommandId, chip::EndpointId aEndPointId) +bool ServerClusterCommandExists(const ConcreteCommandPath & aCommandPath) { // The Mock cluster catalog -- only have one command on one cluster on one endpoint. - return (aEndPointId == kTestEndpointId && aClusterId == kTestClusterId && aCommandId == kTestCommandId); + return (aCommandPath.mEndpointId == kTestEndpointId && aCommandPath.mClusterId == kTestClusterId && + aCommandPath.mCommandId == kTestCommandId); } -void DispatchSingleClusterCommand(chip::ClusterId aClusterId, chip::CommandId aCommandId, chip::EndpointId aEndPointId, - chip::TLV::TLVReader & aReader, CommandHandler * apCommandObj) +void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, chip::TLV::TLVReader & aReader, + CommandHandler * apCommandObj) { static bool statusCodeFlipper = false; - if (aClusterId != kTestClusterId || aCommandId != kTestCommandId || aEndPointId != kTestEndpointId) + if (!ServerClusterCommandExists(aCommandPath)) { return; } @@ -100,11 +101,12 @@ void DispatchSingleClusterCommand(chip::ClusterId aClusterId, chip::CommandId aC statusCodeFlipper = !statusCodeFlipper; } -void DispatchSingleClusterResponseCommand(chip::ClusterId aClusterId, chip::CommandId aCommandId, chip::EndpointId aEndPointId, - chip::TLV::TLVReader & aReader, CommandSender * apCommandObj) +void DispatchSingleClusterResponseCommand(const ConcreteCommandPath & aCommandPath, chip::TLV::TLVReader & aReader, + CommandSender * apCommandObj) { - ChipLogDetail(Controller, "Received Cluster Command: Cluster=%" PRIx32 " Command=%" PRIx32 " Endpoint=%" PRIx16, aClusterId, - aCommandId, aEndPointId); + ChipLogDetail(Controller, + "Received Cluster Command: Endpoint=%" PRIx16 " Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, + aCommandPath.mEndpointId, ChipLogValueMEI(aCommandPath.mClusterId), ChipLogValueMEI(aCommandPath.mCommandId)); // Nothing todo. } diff --git a/src/app/util/ember-compatibility-functions.cpp b/src/app/util/ember-compatibility-functions.cpp index ef552f20106460..10df6747fb84e4 100644 --- a/src/app/util/ember-compatibility-functions.cpp +++ b/src/app/util/ember-compatibility-functions.cpp @@ -133,17 +133,17 @@ EmberAfAttributeType BaseType(EmberAfAttributeType type) } // namespace -void SetupEmberAfObjects(Command * command, ClusterId clusterId, CommandId commandId, EndpointId endpointId) +void SetupEmberAfObjects(Command * command, const ConcreteCommandPath & commandPath) { Messaging::ExchangeContext * commandExchangeCtx = command->GetExchangeContext(); - imCompatibilityEmberApsFrame.clusterId = clusterId; - imCompatibilityEmberApsFrame.destinationEndpoint = endpointId; + imCompatibilityEmberApsFrame.clusterId = commandPath.mClusterId; + imCompatibilityEmberApsFrame.destinationEndpoint = commandPath.mEndpointId; imCompatibilityEmberApsFrame.sourceEndpoint = 1; // source endpoint is fixed to 1 for now. imCompatibilityEmberApsFrame.sequence = (commandExchangeCtx != nullptr ? static_cast(commandExchangeCtx->GetExchangeId() & 0xFF) : 0); - imCompatibilityEmberAfCluster.commandId = commandId; + imCompatibilityEmberAfCluster.commandId = commandPath.mCommandId; imCompatibilityEmberAfCluster.apsFrame = &imCompatibilityEmberApsFrame; imCompatibilityEmberAfCluster.interPanHeader = &imCompatibilityInterpanHeader; imCompatibilityEmberAfCluster.source = commandExchangeCtx; @@ -184,11 +184,11 @@ namespace { uint8_t attributeData[kAttributeReadBufferSize]; } // namespace -bool ServerClusterCommandExists(chip::ClusterId aClusterId, chip::CommandId aCommandId, chip::EndpointId aEndPointId) +bool ServerClusterCommandExists(const ConcreteCommandPath & aCommandPath) { // TODO: Currently, we are using cluster catalog from the ember library, this should be modified or replaced after several // updates to Commands. - return emberAfContainsServer(aEndPointId, aClusterId); + return emberAfContainsServer(aCommandPath.mEndpointId, aCommandPath.mClusterId); } CHIP_ERROR ReadSingleClusterData(ClusterInfo & aClusterInfo, TLV::TLVWriter * apWriter, bool * apDataExists) diff --git a/src/app/util/ember-compatibility-functions.h b/src/app/util/ember-compatibility-functions.h index 2bb91b481182c1..12f2527d8428e5 100644 --- a/src/app/util/ember-compatibility-functions.h +++ b/src/app/util/ember-compatibility-functions.h @@ -24,6 +24,7 @@ #pragma once #include +#include #include #include @@ -31,7 +32,7 @@ namespace chip { namespace app { namespace Compatibility { -void SetupEmberAfObjects(Command * command, ClusterId clusterId, CommandId commandId, EndpointId endpointId); +void SetupEmberAfObjects(Command * command, const ConcreteCommandPath & commandPath); bool IMEmberAfSendDefaultResponseWithCallback(EmberAfStatus status); void ResetEmberAfObjects(); diff --git a/src/app/zap-templates/templates/app/im-cluster-command-handler.zapt b/src/app/zap-templates/templates/app/im-cluster-command-handler.zapt index ed27a13157c2f4..31103b23607077 100644 --- a/src/app/zap-templates/templates/app/im-cluster-command-handler.zapt +++ b/src/app/zap-templates/templates/app/im-cluster-command-handler.zapt @@ -89,64 +89,70 @@ void Dispatch{{asUpperCamelCase side}}Command({{#if (isServer side)}}CommandHand } // namespace Clusters -void DispatchSingleClusterCommand(ClusterId aClusterId, CommandId aCommandId, EndpointId aEndPointId, - TLV::TLVReader & aReader, CommandHandler * apCommandObj) +void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, CommandHandler * apCommandObj) { - ChipLogDetail(Zcl, "Received Cluster Command: Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI " Endpoint=%" PRIx16, ChipLogValueMEI(aClusterId), - ChipLogValueMEI(aCommandId), aEndPointId); - Compatibility::SetupEmberAfObjects(apCommandObj, aClusterId, aCommandId, aEndPointId); - ConcreteCommandPath commandPath(aEndPointId, aClusterId, aCommandId); + ChipLogDetail(Zcl, "Received Cluster Command: Endpoint=%" PRIx16 " Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, aCommandPath.mEndpointId, ChipLogValueMEI(aCommandPath.mClusterId), ChipLogValueMEI(aCommandPath.mCommandId)); + + Compatibility::SetupEmberAfObjects(apCommandObj, aCommandPath); + TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); - switch (aClusterId) + switch (aCommandPath.mClusterId) { {{#chip_server_clusters}} {{#if (user_cluster_has_enabled_command name side)}} case Clusters::{{asUpperCamelCase name}}::Id: - Clusters::{{asUpperCamelCase name}}::Dispatch{{asUpperCamelCase side}}Command(apCommandObj, commandPath, aReader); + Clusters::{{asUpperCamelCase name}}::Dispatch{{asUpperCamelCase side}}Command(apCommandObj, aCommandPath, aReader); break; {{/if}} {{/chip_server_clusters}} default: - // Unrecognized cluster ID, error status will apply. - apCommandObj->AddStatusCode(commandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, Protocols::SecureChannel::Id, - Protocols::InteractionModel::Status::InvalidCommand); - ChipLogError(Zcl, "Unknown cluster %" PRIx32, aClusterId); + ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandPath.mClusterId)); + apCommandObj->AddStatusCode( + aCommandPath, + Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::InteractionModel::Id, + Protocols::InteractionModel::Status::UnsupportedCluster + ); break; } + exit: - Compatibility::ResetEmberAfObjects(); aReader.ExitContainer(dataTlvType); + Compatibility::ResetEmberAfObjects(); } -void DispatchSingleClusterResponseCommand(ClusterId aClusterId, CommandId aCommandId, EndpointId aEndPointId, - TLV::TLVReader & aReader, CommandSender * apCommandObj) +void DispatchSingleClusterResponseCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, CommandSender * apCommandObj) { - ChipLogDetail(Zcl, "Received Cluster Command: Cluster=%" PRIx32 " Command=%" PRIx32 " Endpoint=%" PRIx16, aClusterId, - aCommandId, aEndPointId); - Compatibility::SetupEmberAfObjects(apCommandObj, aClusterId, aCommandId, aEndPointId); - ConcreteCommandPath commandPath(aEndPointId, aClusterId, aCommandId); + ChipLogDetail(Zcl, "Received Cluster Command: Endpoint=%" PRIx16 " Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, aCommandPath.mEndpointId, ChipLogValueMEI(aCommandPath.mClusterId), ChipLogValueMEI(aCommandPath.mCommandId)); + + Compatibility::SetupEmberAfObjects(apCommandObj, aCommandPath); + TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); - switch (aClusterId) + switch (aCommandPath.mClusterId) { {{#chip_client_clusters}} {{#if (user_cluster_has_enabled_command name side)}} case Clusters::{{asUpperCamelCase name}}::Id: - Clusters::{{asUpperCamelCase name}}::Dispatch{{asUpperCamelCase side}}Command(apCommandObj, commandPath, aReader); + Clusters::{{asUpperCamelCase name}}::Dispatch{{asUpperCamelCase side}}Command(apCommandObj, aCommandPath, aReader); break; {{/if}} {{/chip_client_clusters}} default: - // Unrecognized cluster ID, error status will apply. - apCommandObj->AddStatusCode(commandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, Protocols::SecureChannel::Id, - Protocols::InteractionModel::Status::InvalidCommand); - ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aClusterId)); + ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandPath.mClusterId)); + apCommandObj->AddStatusCode( + aCommandPath, + Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::InteractionModel::Id, + Protocols::InteractionModel::Status::UnsupportedCluster + ); break; } + exit: - Compatibility::ResetEmberAfObjects(); aReader.ExitContainer(dataTlvType); + Compatibility::ResetEmberAfObjects(); } } // namespace app From dd02d5175ded9ede7ef5859115d93f356647323e Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Tue, 5 Oct 2021 22:47:21 +0200 Subject: [PATCH 2/2] Update generated content --- .../zap-generated/IMClusterCommandHandler.cpp | 97 ++++++++++--------- .../zap-generated/IMClusterCommandHandler.cpp | 63 ++++++------ .../zap-generated/IMClusterCommandHandler.cpp | 81 ++++++++-------- .../zap-generated/IMClusterCommandHandler.cpp | 73 +++++++------- .../zap-generated/IMClusterCommandHandler.cpp | 61 ++++++------ .../zap-generated/IMClusterCommandHandler.cpp | 53 +++++----- .../zap-generated/IMClusterCommandHandler.cpp | 51 +++++----- .../zap-generated/IMClusterCommandHandler.cpp | 65 +++++++------ .../zap-generated/IMClusterCommandHandler.cpp | 61 ++++++------ .../zap-generated/IMClusterCommandHandler.cpp | 59 +++++------ .../zap-generated/IMClusterCommandHandler.cpp | 89 ++++++++--------- .../zap-generated/IMClusterCommandHandler.cpp | 97 ++++++++++--------- .../zap-generated/IMClusterCommandHandler.cpp | 85 ++++++++-------- .../zap-generated/IMClusterCommandHandler.cpp | 59 +++++------ 14 files changed, 504 insertions(+), 490 deletions(-) diff --git a/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp index df0788aab77652..7ed441d063cd69 100644 --- a/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp @@ -7376,122 +7376,123 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } // namespace Clusters -void DispatchSingleClusterCommand(ClusterId aClusterId, CommandId aCommandId, EndpointId aEndPointId, TLV::TLVReader & aReader, - CommandHandler * apCommandObj) +void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, CommandHandler * apCommandObj) { - ChipLogDetail(Zcl, "Received Cluster Command: Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI " Endpoint=%" PRIx16, - ChipLogValueMEI(aClusterId), ChipLogValueMEI(aCommandId), aEndPointId); - Compatibility::SetupEmberAfObjects(apCommandObj, aClusterId, aCommandId, aEndPointId); - ConcreteCommandPath commandPath(aEndPointId, aClusterId, aCommandId); + ChipLogDetail(Zcl, "Received Cluster Command: Endpoint=%" PRIx16 " Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, + aCommandPath.mEndpointId, ChipLogValueMEI(aCommandPath.mClusterId), ChipLogValueMEI(aCommandPath.mCommandId)); + + Compatibility::SetupEmberAfObjects(apCommandObj, aCommandPath); + TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); - switch (aClusterId) + switch (aCommandPath.mClusterId) { case Clusters::AdministratorCommissioning::Id: - Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::BarrierControl::Id: - Clusters::BarrierControl::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::BarrierControl::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::Basic::Id: - Clusters::Basic::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::Basic::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::Binding::Id: - Clusters::Binding::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::Binding::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::ColorControl::Id: - Clusters::ColorControl::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::ColorControl::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::DiagnosticLogs::Id: - Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::DoorLock::Id: - Clusters::DoorLock::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::DoorLock::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::EthernetNetworkDiagnostics::Id: - Clusters::EthernetNetworkDiagnostics::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::EthernetNetworkDiagnostics::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::GeneralCommissioning::Id: - Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::Groups::Id: - Clusters::Groups::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::Groups::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::IasZone::Id: - Clusters::IasZone::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::IasZone::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::Identify::Id: - Clusters::Identify::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::Identify::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::LevelControl::Id: - Clusters::LevelControl::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::LevelControl::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::LowPower::Id: - Clusters::LowPower::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::LowPower::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::NetworkCommissioning::Id: - Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::OtaSoftwareUpdateProvider::Id: - Clusters::OtaSoftwareUpdateProvider::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::OtaSoftwareUpdateProvider::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::OnOff::Id: - Clusters::OnOff::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::OnOff::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::OperationalCredentials::Id: - Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::Scenes::Id: - Clusters::Scenes::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::Scenes::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::SoftwareDiagnostics::Id: - Clusters::SoftwareDiagnostics::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::SoftwareDiagnostics::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::TestCluster::Id: - Clusters::TestCluster::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::TestCluster::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::ThreadNetworkDiagnostics::Id: - Clusters::ThreadNetworkDiagnostics::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::ThreadNetworkDiagnostics::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::WiFiNetworkDiagnostics::Id: - Clusters::WiFiNetworkDiagnostics::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::WiFiNetworkDiagnostics::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::WindowCovering::Id: - Clusters::WindowCovering::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::WindowCovering::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; default: - // Unrecognized cluster ID, error status will apply. - apCommandObj->AddStatusCode(commandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogError(Zcl, "Unknown cluster %" PRIx32, aClusterId); + ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandPath.mClusterId)); + apCommandObj->AddStatusCode(aCommandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::InteractionModel::Id, Protocols::InteractionModel::Status::UnsupportedCluster); break; } + exit: - Compatibility::ResetEmberAfObjects(); aReader.ExitContainer(dataTlvType); + Compatibility::ResetEmberAfObjects(); } -void DispatchSingleClusterResponseCommand(ClusterId aClusterId, CommandId aCommandId, EndpointId aEndPointId, - TLV::TLVReader & aReader, CommandSender * apCommandObj) +void DispatchSingleClusterResponseCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, + CommandSender * apCommandObj) { - ChipLogDetail(Zcl, "Received Cluster Command: Cluster=%" PRIx32 " Command=%" PRIx32 " Endpoint=%" PRIx16, aClusterId, - aCommandId, aEndPointId); - Compatibility::SetupEmberAfObjects(apCommandObj, aClusterId, aCommandId, aEndPointId); - ConcreteCommandPath commandPath(aEndPointId, aClusterId, aCommandId); + ChipLogDetail(Zcl, "Received Cluster Command: Endpoint=%" PRIx16 " Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, + aCommandPath.mEndpointId, ChipLogValueMEI(aCommandPath.mClusterId), ChipLogValueMEI(aCommandPath.mCommandId)); + + Compatibility::SetupEmberAfObjects(apCommandObj, aCommandPath); + TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); - switch (aClusterId) + switch (aCommandPath.mClusterId) { default: - // Unrecognized cluster ID, error status will apply. - apCommandObj->AddStatusCode(commandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aClusterId)); + ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandPath.mClusterId)); + apCommandObj->AddStatusCode(aCommandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::InteractionModel::Id, Protocols::InteractionModel::Status::UnsupportedCluster); break; } + exit: - Compatibility::ResetEmberAfObjects(); aReader.ExitContainer(dataTlvType); + Compatibility::ResetEmberAfObjects(); } } // namespace app diff --git a/zzz_generated/bridge-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/bridge-app/zap-generated/IMClusterCommandHandler.cpp index e3598d5fffc4cd..4395babe1c70e4 100644 --- a/zzz_generated/bridge-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/bridge-app/zap-generated/IMClusterCommandHandler.cpp @@ -2392,71 +2392,72 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } // namespace Clusters -void DispatchSingleClusterCommand(ClusterId aClusterId, CommandId aCommandId, EndpointId aEndPointId, TLV::TLVReader & aReader, - CommandHandler * apCommandObj) +void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, CommandHandler * apCommandObj) { - ChipLogDetail(Zcl, "Received Cluster Command: Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI " Endpoint=%" PRIx16, - ChipLogValueMEI(aClusterId), ChipLogValueMEI(aCommandId), aEndPointId); - Compatibility::SetupEmberAfObjects(apCommandObj, aClusterId, aCommandId, aEndPointId); - ConcreteCommandPath commandPath(aEndPointId, aClusterId, aCommandId); + ChipLogDetail(Zcl, "Received Cluster Command: Endpoint=%" PRIx16 " Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, + aCommandPath.mEndpointId, ChipLogValueMEI(aCommandPath.mClusterId), ChipLogValueMEI(aCommandPath.mCommandId)); + + Compatibility::SetupEmberAfObjects(apCommandObj, aCommandPath); + TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); - switch (aClusterId) + switch (aCommandPath.mClusterId) { case Clusters::AdministratorCommissioning::Id: - Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::DiagnosticLogs::Id: - Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::GeneralCommissioning::Id: - Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::LevelControl::Id: - Clusters::LevelControl::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::LevelControl::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::NetworkCommissioning::Id: - Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::OnOff::Id: - Clusters::OnOff::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::OnOff::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::OperationalCredentials::Id: - Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; default: - // Unrecognized cluster ID, error status will apply. - apCommandObj->AddStatusCode(commandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogError(Zcl, "Unknown cluster %" PRIx32, aClusterId); + ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandPath.mClusterId)); + apCommandObj->AddStatusCode(aCommandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::InteractionModel::Id, Protocols::InteractionModel::Status::UnsupportedCluster); break; } + exit: - Compatibility::ResetEmberAfObjects(); aReader.ExitContainer(dataTlvType); + Compatibility::ResetEmberAfObjects(); } -void DispatchSingleClusterResponseCommand(ClusterId aClusterId, CommandId aCommandId, EndpointId aEndPointId, - TLV::TLVReader & aReader, CommandSender * apCommandObj) +void DispatchSingleClusterResponseCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, + CommandSender * apCommandObj) { - ChipLogDetail(Zcl, "Received Cluster Command: Cluster=%" PRIx32 " Command=%" PRIx32 " Endpoint=%" PRIx16, aClusterId, - aCommandId, aEndPointId); - Compatibility::SetupEmberAfObjects(apCommandObj, aClusterId, aCommandId, aEndPointId); - ConcreteCommandPath commandPath(aEndPointId, aClusterId, aCommandId); + ChipLogDetail(Zcl, "Received Cluster Command: Endpoint=%" PRIx16 " Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, + aCommandPath.mEndpointId, ChipLogValueMEI(aCommandPath.mClusterId), ChipLogValueMEI(aCommandPath.mCommandId)); + + Compatibility::SetupEmberAfObjects(apCommandObj, aCommandPath); + TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); - switch (aClusterId) + switch (aCommandPath.mClusterId) { default: - // Unrecognized cluster ID, error status will apply. - apCommandObj->AddStatusCode(commandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aClusterId)); + ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandPath.mClusterId)); + apCommandObj->AddStatusCode(aCommandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::InteractionModel::Id, Protocols::InteractionModel::Status::UnsupportedCluster); break; } + exit: - Compatibility::ResetEmberAfObjects(); aReader.ExitContainer(dataTlvType); + Compatibility::ResetEmberAfObjects(); } } // namespace app diff --git a/zzz_generated/controller-clusters/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/controller-clusters/zap-generated/IMClusterCommandHandler.cpp index d8c63a516ceb0f..3896f197465e08 100644 --- a/zzz_generated/controller-clusters/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/controller-clusters/zap-generated/IMClusterCommandHandler.cpp @@ -5256,98 +5256,99 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa } // namespace Clusters -void DispatchSingleClusterCommand(ClusterId aClusterId, CommandId aCommandId, EndpointId aEndPointId, TLV::TLVReader & aReader, - CommandHandler * apCommandObj) +void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, CommandHandler * apCommandObj) { - ChipLogDetail(Zcl, "Received Cluster Command: Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI " Endpoint=%" PRIx16, - ChipLogValueMEI(aClusterId), ChipLogValueMEI(aCommandId), aEndPointId); - Compatibility::SetupEmberAfObjects(apCommandObj, aClusterId, aCommandId, aEndPointId); - ConcreteCommandPath commandPath(aEndPointId, aClusterId, aCommandId); + ChipLogDetail(Zcl, "Received Cluster Command: Endpoint=%" PRIx16 " Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, + aCommandPath.mEndpointId, ChipLogValueMEI(aCommandPath.mClusterId), ChipLogValueMEI(aCommandPath.mCommandId)); + + Compatibility::SetupEmberAfObjects(apCommandObj, aCommandPath); + TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); - switch (aClusterId) + switch (aCommandPath.mClusterId) { default: - // Unrecognized cluster ID, error status will apply. - apCommandObj->AddStatusCode(commandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogError(Zcl, "Unknown cluster %" PRIx32, aClusterId); + ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandPath.mClusterId)); + apCommandObj->AddStatusCode(aCommandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::InteractionModel::Id, Protocols::InteractionModel::Status::UnsupportedCluster); break; } + exit: - Compatibility::ResetEmberAfObjects(); aReader.ExitContainer(dataTlvType); + Compatibility::ResetEmberAfObjects(); } -void DispatchSingleClusterResponseCommand(ClusterId aClusterId, CommandId aCommandId, EndpointId aEndPointId, - TLV::TLVReader & aReader, CommandSender * apCommandObj) +void DispatchSingleClusterResponseCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, + CommandSender * apCommandObj) { - ChipLogDetail(Zcl, "Received Cluster Command: Cluster=%" PRIx32 " Command=%" PRIx32 " Endpoint=%" PRIx16, aClusterId, - aCommandId, aEndPointId); - Compatibility::SetupEmberAfObjects(apCommandObj, aClusterId, aCommandId, aEndPointId); - ConcreteCommandPath commandPath(aEndPointId, aClusterId, aCommandId); + ChipLogDetail(Zcl, "Received Cluster Command: Endpoint=%" PRIx16 " Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, + aCommandPath.mEndpointId, ChipLogValueMEI(aCommandPath.mClusterId), ChipLogValueMEI(aCommandPath.mCommandId)); + + Compatibility::SetupEmberAfObjects(apCommandObj, aCommandPath); + TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); - switch (aClusterId) + switch (aCommandPath.mClusterId) { case Clusters::AccountLogin::Id: - Clusters::AccountLogin::DispatchClientCommand(apCommandObj, commandPath, aReader); + Clusters::AccountLogin::DispatchClientCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::ApplicationLauncher::Id: - Clusters::ApplicationLauncher::DispatchClientCommand(apCommandObj, commandPath, aReader); + Clusters::ApplicationLauncher::DispatchClientCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::ContentLauncher::Id: - Clusters::ContentLauncher::DispatchClientCommand(apCommandObj, commandPath, aReader); + Clusters::ContentLauncher::DispatchClientCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::DoorLock::Id: - Clusters::DoorLock::DispatchClientCommand(apCommandObj, commandPath, aReader); + Clusters::DoorLock::DispatchClientCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::GeneralCommissioning::Id: - Clusters::GeneralCommissioning::DispatchClientCommand(apCommandObj, commandPath, aReader); + Clusters::GeneralCommissioning::DispatchClientCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::Groups::Id: - Clusters::Groups::DispatchClientCommand(apCommandObj, commandPath, aReader); + Clusters::Groups::DispatchClientCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::Identify::Id: - Clusters::Identify::DispatchClientCommand(apCommandObj, commandPath, aReader); + Clusters::Identify::DispatchClientCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::KeypadInput::Id: - Clusters::KeypadInput::DispatchClientCommand(apCommandObj, commandPath, aReader); + Clusters::KeypadInput::DispatchClientCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::MediaPlayback::Id: - Clusters::MediaPlayback::DispatchClientCommand(apCommandObj, commandPath, aReader); + Clusters::MediaPlayback::DispatchClientCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::NetworkCommissioning::Id: - Clusters::NetworkCommissioning::DispatchClientCommand(apCommandObj, commandPath, aReader); + Clusters::NetworkCommissioning::DispatchClientCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::OtaSoftwareUpdateProvider::Id: - Clusters::OtaSoftwareUpdateProvider::DispatchClientCommand(apCommandObj, commandPath, aReader); + Clusters::OtaSoftwareUpdateProvider::DispatchClientCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::OperationalCredentials::Id: - Clusters::OperationalCredentials::DispatchClientCommand(apCommandObj, commandPath, aReader); + Clusters::OperationalCredentials::DispatchClientCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::Scenes::Id: - Clusters::Scenes::DispatchClientCommand(apCommandObj, commandPath, aReader); + Clusters::Scenes::DispatchClientCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::TvChannel::Id: - Clusters::TvChannel::DispatchClientCommand(apCommandObj, commandPath, aReader); + Clusters::TvChannel::DispatchClientCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::TargetNavigator::Id: - Clusters::TargetNavigator::DispatchClientCommand(apCommandObj, commandPath, aReader); + Clusters::TargetNavigator::DispatchClientCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::TestCluster::Id: - Clusters::TestCluster::DispatchClientCommand(apCommandObj, commandPath, aReader); + Clusters::TestCluster::DispatchClientCommand(apCommandObj, aCommandPath, aReader); break; default: - // Unrecognized cluster ID, error status will apply. - apCommandObj->AddStatusCode(commandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aClusterId)); + ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandPath.mClusterId)); + apCommandObj->AddStatusCode(aCommandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::InteractionModel::Id, Protocols::InteractionModel::Status::UnsupportedCluster); break; } + exit: - Compatibility::ResetEmberAfObjects(); aReader.ExitContainer(dataTlvType); + Compatibility::ResetEmberAfObjects(); } } // namespace app diff --git a/zzz_generated/lighting-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/lighting-app/zap-generated/IMClusterCommandHandler.cpp index 8d1787b740d83a..175026107d05bb 100644 --- a/zzz_generated/lighting-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/lighting-app/zap-generated/IMClusterCommandHandler.cpp @@ -4074,86 +4074,87 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } // namespace Clusters -void DispatchSingleClusterCommand(ClusterId aClusterId, CommandId aCommandId, EndpointId aEndPointId, TLV::TLVReader & aReader, - CommandHandler * apCommandObj) +void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, CommandHandler * apCommandObj) { - ChipLogDetail(Zcl, "Received Cluster Command: Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI " Endpoint=%" PRIx16, - ChipLogValueMEI(aClusterId), ChipLogValueMEI(aCommandId), aEndPointId); - Compatibility::SetupEmberAfObjects(apCommandObj, aClusterId, aCommandId, aEndPointId); - ConcreteCommandPath commandPath(aEndPointId, aClusterId, aCommandId); + ChipLogDetail(Zcl, "Received Cluster Command: Endpoint=%" PRIx16 " Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, + aCommandPath.mEndpointId, ChipLogValueMEI(aCommandPath.mClusterId), ChipLogValueMEI(aCommandPath.mCommandId)); + + Compatibility::SetupEmberAfObjects(apCommandObj, aCommandPath); + TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); - switch (aClusterId) + switch (aCommandPath.mClusterId) { case Clusters::AdministratorCommissioning::Id: - Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::ColorControl::Id: - Clusters::ColorControl::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::ColorControl::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::DiagnosticLogs::Id: - Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::EthernetNetworkDiagnostics::Id: - Clusters::EthernetNetworkDiagnostics::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::EthernetNetworkDiagnostics::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::GeneralCommissioning::Id: - Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::LevelControl::Id: - Clusters::LevelControl::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::LevelControl::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::NetworkCommissioning::Id: - Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::OnOff::Id: - Clusters::OnOff::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::OnOff::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::OperationalCredentials::Id: - Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::SoftwareDiagnostics::Id: - Clusters::SoftwareDiagnostics::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::SoftwareDiagnostics::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::ThreadNetworkDiagnostics::Id: - Clusters::ThreadNetworkDiagnostics::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::ThreadNetworkDiagnostics::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::WiFiNetworkDiagnostics::Id: - Clusters::WiFiNetworkDiagnostics::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::WiFiNetworkDiagnostics::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; default: - // Unrecognized cluster ID, error status will apply. - apCommandObj->AddStatusCode(commandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogError(Zcl, "Unknown cluster %" PRIx32, aClusterId); + ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandPath.mClusterId)); + apCommandObj->AddStatusCode(aCommandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::InteractionModel::Id, Protocols::InteractionModel::Status::UnsupportedCluster); break; } + exit: - Compatibility::ResetEmberAfObjects(); aReader.ExitContainer(dataTlvType); + Compatibility::ResetEmberAfObjects(); } -void DispatchSingleClusterResponseCommand(ClusterId aClusterId, CommandId aCommandId, EndpointId aEndPointId, - TLV::TLVReader & aReader, CommandSender * apCommandObj) +void DispatchSingleClusterResponseCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, + CommandSender * apCommandObj) { - ChipLogDetail(Zcl, "Received Cluster Command: Cluster=%" PRIx32 " Command=%" PRIx32 " Endpoint=%" PRIx16, aClusterId, - aCommandId, aEndPointId); - Compatibility::SetupEmberAfObjects(apCommandObj, aClusterId, aCommandId, aEndPointId); - ConcreteCommandPath commandPath(aEndPointId, aClusterId, aCommandId); + ChipLogDetail(Zcl, "Received Cluster Command: Endpoint=%" PRIx16 " Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, + aCommandPath.mEndpointId, ChipLogValueMEI(aCommandPath.mClusterId), ChipLogValueMEI(aCommandPath.mCommandId)); + + Compatibility::SetupEmberAfObjects(apCommandObj, aCommandPath); + TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); - switch (aClusterId) + switch (aCommandPath.mClusterId) { default: - // Unrecognized cluster ID, error status will apply. - apCommandObj->AddStatusCode(commandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aClusterId)); + ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandPath.mClusterId)); + apCommandObj->AddStatusCode(aCommandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::InteractionModel::Id, Protocols::InteractionModel::Status::UnsupportedCluster); break; } + exit: - Compatibility::ResetEmberAfObjects(); aReader.ExitContainer(dataTlvType); + Compatibility::ResetEmberAfObjects(); } } // namespace app diff --git a/zzz_generated/lock-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/lock-app/zap-generated/IMClusterCommandHandler.cpp index 63619f14e56595..bb94b39f82829b 100644 --- a/zzz_generated/lock-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/lock-app/zap-generated/IMClusterCommandHandler.cpp @@ -1861,68 +1861,69 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } // namespace Clusters -void DispatchSingleClusterCommand(ClusterId aClusterId, CommandId aCommandId, EndpointId aEndPointId, TLV::TLVReader & aReader, - CommandHandler * apCommandObj) +void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, CommandHandler * apCommandObj) { - ChipLogDetail(Zcl, "Received Cluster Command: Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI " Endpoint=%" PRIx16, - ChipLogValueMEI(aClusterId), ChipLogValueMEI(aCommandId), aEndPointId); - Compatibility::SetupEmberAfObjects(apCommandObj, aClusterId, aCommandId, aEndPointId); - ConcreteCommandPath commandPath(aEndPointId, aClusterId, aCommandId); + ChipLogDetail(Zcl, "Received Cluster Command: Endpoint=%" PRIx16 " Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, + aCommandPath.mEndpointId, ChipLogValueMEI(aCommandPath.mClusterId), ChipLogValueMEI(aCommandPath.mCommandId)); + + Compatibility::SetupEmberAfObjects(apCommandObj, aCommandPath); + TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); - switch (aClusterId) + switch (aCommandPath.mClusterId) { case Clusters::AdministratorCommissioning::Id: - Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::DiagnosticLogs::Id: - Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::GeneralCommissioning::Id: - Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::NetworkCommissioning::Id: - Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::OnOff::Id: - Clusters::OnOff::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::OnOff::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::OperationalCredentials::Id: - Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; default: - // Unrecognized cluster ID, error status will apply. - apCommandObj->AddStatusCode(commandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogError(Zcl, "Unknown cluster %" PRIx32, aClusterId); + ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandPath.mClusterId)); + apCommandObj->AddStatusCode(aCommandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::InteractionModel::Id, Protocols::InteractionModel::Status::UnsupportedCluster); break; } + exit: - Compatibility::ResetEmberAfObjects(); aReader.ExitContainer(dataTlvType); + Compatibility::ResetEmberAfObjects(); } -void DispatchSingleClusterResponseCommand(ClusterId aClusterId, CommandId aCommandId, EndpointId aEndPointId, - TLV::TLVReader & aReader, CommandSender * apCommandObj) +void DispatchSingleClusterResponseCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, + CommandSender * apCommandObj) { - ChipLogDetail(Zcl, "Received Cluster Command: Cluster=%" PRIx32 " Command=%" PRIx32 " Endpoint=%" PRIx16, aClusterId, - aCommandId, aEndPointId); - Compatibility::SetupEmberAfObjects(apCommandObj, aClusterId, aCommandId, aEndPointId); - ConcreteCommandPath commandPath(aEndPointId, aClusterId, aCommandId); + ChipLogDetail(Zcl, "Received Cluster Command: Endpoint=%" PRIx16 " Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, + aCommandPath.mEndpointId, ChipLogValueMEI(aCommandPath.mClusterId), ChipLogValueMEI(aCommandPath.mCommandId)); + + Compatibility::SetupEmberAfObjects(apCommandObj, aCommandPath); + TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); - switch (aClusterId) + switch (aCommandPath.mClusterId) { default: - // Unrecognized cluster ID, error status will apply. - apCommandObj->AddStatusCode(commandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aClusterId)); + ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandPath.mClusterId)); + apCommandObj->AddStatusCode(aCommandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::InteractionModel::Id, Protocols::InteractionModel::Status::UnsupportedCluster); break; } + exit: - Compatibility::ResetEmberAfObjects(); aReader.ExitContainer(dataTlvType); + Compatibility::ResetEmberAfObjects(); } } // namespace app diff --git a/zzz_generated/ota-provider-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/ota-provider-app/zap-generated/IMClusterCommandHandler.cpp index 121c1fba19e71e..db872ce489523d 100644 --- a/zzz_generated/ota-provider-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/ota-provider-app/zap-generated/IMClusterCommandHandler.cpp @@ -791,56 +791,57 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } // namespace Clusters -void DispatchSingleClusterCommand(ClusterId aClusterId, CommandId aCommandId, EndpointId aEndPointId, TLV::TLVReader & aReader, - CommandHandler * apCommandObj) +void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, CommandHandler * apCommandObj) { - ChipLogDetail(Zcl, "Received Cluster Command: Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI " Endpoint=%" PRIx16, - ChipLogValueMEI(aClusterId), ChipLogValueMEI(aCommandId), aEndPointId); - Compatibility::SetupEmberAfObjects(apCommandObj, aClusterId, aCommandId, aEndPointId); - ConcreteCommandPath commandPath(aEndPointId, aClusterId, aCommandId); + ChipLogDetail(Zcl, "Received Cluster Command: Endpoint=%" PRIx16 " Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, + aCommandPath.mEndpointId, ChipLogValueMEI(aCommandPath.mClusterId), ChipLogValueMEI(aCommandPath.mCommandId)); + + Compatibility::SetupEmberAfObjects(apCommandObj, aCommandPath); + TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); - switch (aClusterId) + switch (aCommandPath.mClusterId) { case Clusters::OtaSoftwareUpdateProvider::Id: - Clusters::OtaSoftwareUpdateProvider::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::OtaSoftwareUpdateProvider::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::OperationalCredentials::Id: - Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; default: - // Unrecognized cluster ID, error status will apply. - apCommandObj->AddStatusCode(commandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogError(Zcl, "Unknown cluster %" PRIx32, aClusterId); + ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandPath.mClusterId)); + apCommandObj->AddStatusCode(aCommandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::InteractionModel::Id, Protocols::InteractionModel::Status::UnsupportedCluster); break; } + exit: - Compatibility::ResetEmberAfObjects(); aReader.ExitContainer(dataTlvType); + Compatibility::ResetEmberAfObjects(); } -void DispatchSingleClusterResponseCommand(ClusterId aClusterId, CommandId aCommandId, EndpointId aEndPointId, - TLV::TLVReader & aReader, CommandSender * apCommandObj) +void DispatchSingleClusterResponseCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, + CommandSender * apCommandObj) { - ChipLogDetail(Zcl, "Received Cluster Command: Cluster=%" PRIx32 " Command=%" PRIx32 " Endpoint=%" PRIx16, aClusterId, - aCommandId, aEndPointId); - Compatibility::SetupEmberAfObjects(apCommandObj, aClusterId, aCommandId, aEndPointId); - ConcreteCommandPath commandPath(aEndPointId, aClusterId, aCommandId); + ChipLogDetail(Zcl, "Received Cluster Command: Endpoint=%" PRIx16 " Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, + aCommandPath.mEndpointId, ChipLogValueMEI(aCommandPath.mClusterId), ChipLogValueMEI(aCommandPath.mCommandId)); + + Compatibility::SetupEmberAfObjects(apCommandObj, aCommandPath); + TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); - switch (aClusterId) + switch (aCommandPath.mClusterId) { default: - // Unrecognized cluster ID, error status will apply. - apCommandObj->AddStatusCode(commandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aClusterId)); + ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandPath.mClusterId)); + apCommandObj->AddStatusCode(aCommandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::InteractionModel::Id, Protocols::InteractionModel::Status::UnsupportedCluster); break; } + exit: - Compatibility::ResetEmberAfObjects(); aReader.ExitContainer(dataTlvType); + Compatibility::ResetEmberAfObjects(); } } // namespace app diff --git a/zzz_generated/ota-requestor-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/ota-requestor-app/zap-generated/IMClusterCommandHandler.cpp index 880eba3d166504..39617b59de12d4 100644 --- a/zzz_generated/ota-requestor-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/ota-requestor-app/zap-generated/IMClusterCommandHandler.cpp @@ -247,53 +247,54 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa } // namespace Clusters -void DispatchSingleClusterCommand(ClusterId aClusterId, CommandId aCommandId, EndpointId aEndPointId, TLV::TLVReader & aReader, - CommandHandler * apCommandObj) +void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, CommandHandler * apCommandObj) { - ChipLogDetail(Zcl, "Received Cluster Command: Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI " Endpoint=%" PRIx16, - ChipLogValueMEI(aClusterId), ChipLogValueMEI(aCommandId), aEndPointId); - Compatibility::SetupEmberAfObjects(apCommandObj, aClusterId, aCommandId, aEndPointId); - ConcreteCommandPath commandPath(aEndPointId, aClusterId, aCommandId); + ChipLogDetail(Zcl, "Received Cluster Command: Endpoint=%" PRIx16 " Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, + aCommandPath.mEndpointId, ChipLogValueMEI(aCommandPath.mClusterId), ChipLogValueMEI(aCommandPath.mCommandId)); + + Compatibility::SetupEmberAfObjects(apCommandObj, aCommandPath); + TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); - switch (aClusterId) + switch (aCommandPath.mClusterId) { default: - // Unrecognized cluster ID, error status will apply. - apCommandObj->AddStatusCode(commandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogError(Zcl, "Unknown cluster %" PRIx32, aClusterId); + ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandPath.mClusterId)); + apCommandObj->AddStatusCode(aCommandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::InteractionModel::Id, Protocols::InteractionModel::Status::UnsupportedCluster); break; } + exit: - Compatibility::ResetEmberAfObjects(); aReader.ExitContainer(dataTlvType); + Compatibility::ResetEmberAfObjects(); } -void DispatchSingleClusterResponseCommand(ClusterId aClusterId, CommandId aCommandId, EndpointId aEndPointId, - TLV::TLVReader & aReader, CommandSender * apCommandObj) +void DispatchSingleClusterResponseCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, + CommandSender * apCommandObj) { - ChipLogDetail(Zcl, "Received Cluster Command: Cluster=%" PRIx32 " Command=%" PRIx32 " Endpoint=%" PRIx16, aClusterId, - aCommandId, aEndPointId); - Compatibility::SetupEmberAfObjects(apCommandObj, aClusterId, aCommandId, aEndPointId); - ConcreteCommandPath commandPath(aEndPointId, aClusterId, aCommandId); + ChipLogDetail(Zcl, "Received Cluster Command: Endpoint=%" PRIx16 " Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, + aCommandPath.mEndpointId, ChipLogValueMEI(aCommandPath.mClusterId), ChipLogValueMEI(aCommandPath.mCommandId)); + + Compatibility::SetupEmberAfObjects(apCommandObj, aCommandPath); + TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); - switch (aClusterId) + switch (aCommandPath.mClusterId) { case Clusters::OtaSoftwareUpdateProvider::Id: - Clusters::OtaSoftwareUpdateProvider::DispatchClientCommand(apCommandObj, commandPath, aReader); + Clusters::OtaSoftwareUpdateProvider::DispatchClientCommand(apCommandObj, aCommandPath, aReader); break; default: - // Unrecognized cluster ID, error status will apply. - apCommandObj->AddStatusCode(commandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aClusterId)); + ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandPath.mClusterId)); + apCommandObj->AddStatusCode(aCommandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::InteractionModel::Id, Protocols::InteractionModel::Status::UnsupportedCluster); break; } + exit: - Compatibility::ResetEmberAfObjects(); aReader.ExitContainer(dataTlvType); + Compatibility::ResetEmberAfObjects(); } } // namespace app diff --git a/zzz_generated/pump-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/pump-app/zap-generated/IMClusterCommandHandler.cpp index 60c39049b1e1f7..4e9b89742b34cb 100644 --- a/zzz_generated/pump-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/pump-app/zap-generated/IMClusterCommandHandler.cpp @@ -2341,74 +2341,75 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } // namespace Clusters -void DispatchSingleClusterCommand(ClusterId aClusterId, CommandId aCommandId, EndpointId aEndPointId, TLV::TLVReader & aReader, - CommandHandler * apCommandObj) +void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, CommandHandler * apCommandObj) { - ChipLogDetail(Zcl, "Received Cluster Command: Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI " Endpoint=%" PRIx16, - ChipLogValueMEI(aClusterId), ChipLogValueMEI(aCommandId), aEndPointId); - Compatibility::SetupEmberAfObjects(apCommandObj, aClusterId, aCommandId, aEndPointId); - ConcreteCommandPath commandPath(aEndPointId, aClusterId, aCommandId); + ChipLogDetail(Zcl, "Received Cluster Command: Endpoint=%" PRIx16 " Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, + aCommandPath.mEndpointId, ChipLogValueMEI(aCommandPath.mClusterId), ChipLogValueMEI(aCommandPath.mCommandId)); + + Compatibility::SetupEmberAfObjects(apCommandObj, aCommandPath); + TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); - switch (aClusterId) + switch (aCommandPath.mClusterId) { case Clusters::AdministratorCommissioning::Id: - Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::Basic::Id: - Clusters::Basic::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::Basic::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::DiagnosticLogs::Id: - Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::GeneralCommissioning::Id: - Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::LevelControl::Id: - Clusters::LevelControl::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::LevelControl::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::NetworkCommissioning::Id: - Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::OnOff::Id: - Clusters::OnOff::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::OnOff::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::OperationalCredentials::Id: - Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; default: - // Unrecognized cluster ID, error status will apply. - apCommandObj->AddStatusCode(commandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogError(Zcl, "Unknown cluster %" PRIx32, aClusterId); + ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandPath.mClusterId)); + apCommandObj->AddStatusCode(aCommandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::InteractionModel::Id, Protocols::InteractionModel::Status::UnsupportedCluster); break; } + exit: - Compatibility::ResetEmberAfObjects(); aReader.ExitContainer(dataTlvType); + Compatibility::ResetEmberAfObjects(); } -void DispatchSingleClusterResponseCommand(ClusterId aClusterId, CommandId aCommandId, EndpointId aEndPointId, - TLV::TLVReader & aReader, CommandSender * apCommandObj) +void DispatchSingleClusterResponseCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, + CommandSender * apCommandObj) { - ChipLogDetail(Zcl, "Received Cluster Command: Cluster=%" PRIx32 " Command=%" PRIx32 " Endpoint=%" PRIx16, aClusterId, - aCommandId, aEndPointId); - Compatibility::SetupEmberAfObjects(apCommandObj, aClusterId, aCommandId, aEndPointId); - ConcreteCommandPath commandPath(aEndPointId, aClusterId, aCommandId); + ChipLogDetail(Zcl, "Received Cluster Command: Endpoint=%" PRIx16 " Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, + aCommandPath.mEndpointId, ChipLogValueMEI(aCommandPath.mClusterId), ChipLogValueMEI(aCommandPath.mCommandId)); + + Compatibility::SetupEmberAfObjects(apCommandObj, aCommandPath); + TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); - switch (aClusterId) + switch (aCommandPath.mClusterId) { default: - // Unrecognized cluster ID, error status will apply. - apCommandObj->AddStatusCode(commandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aClusterId)); + ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandPath.mClusterId)); + apCommandObj->AddStatusCode(aCommandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::InteractionModel::Id, Protocols::InteractionModel::Status::UnsupportedCluster); break; } + exit: - Compatibility::ResetEmberAfObjects(); aReader.ExitContainer(dataTlvType); + Compatibility::ResetEmberAfObjects(); } } // namespace app diff --git a/zzz_generated/pump-controller-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/pump-controller-app/zap-generated/IMClusterCommandHandler.cpp index d895c4b82d4731..b730298ab4ff01 100644 --- a/zzz_generated/pump-controller-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/pump-controller-app/zap-generated/IMClusterCommandHandler.cpp @@ -1810,68 +1810,69 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } // namespace Clusters -void DispatchSingleClusterCommand(ClusterId aClusterId, CommandId aCommandId, EndpointId aEndPointId, TLV::TLVReader & aReader, - CommandHandler * apCommandObj) +void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, CommandHandler * apCommandObj) { - ChipLogDetail(Zcl, "Received Cluster Command: Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI " Endpoint=%" PRIx16, - ChipLogValueMEI(aClusterId), ChipLogValueMEI(aCommandId), aEndPointId); - Compatibility::SetupEmberAfObjects(apCommandObj, aClusterId, aCommandId, aEndPointId); - ConcreteCommandPath commandPath(aEndPointId, aClusterId, aCommandId); + ChipLogDetail(Zcl, "Received Cluster Command: Endpoint=%" PRIx16 " Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, + aCommandPath.mEndpointId, ChipLogValueMEI(aCommandPath.mClusterId), ChipLogValueMEI(aCommandPath.mCommandId)); + + Compatibility::SetupEmberAfObjects(apCommandObj, aCommandPath); + TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); - switch (aClusterId) + switch (aCommandPath.mClusterId) { case Clusters::AdministratorCommissioning::Id: - Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::Basic::Id: - Clusters::Basic::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::Basic::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::DiagnosticLogs::Id: - Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::GeneralCommissioning::Id: - Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::NetworkCommissioning::Id: - Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::OperationalCredentials::Id: - Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; default: - // Unrecognized cluster ID, error status will apply. - apCommandObj->AddStatusCode(commandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogError(Zcl, "Unknown cluster %" PRIx32, aClusterId); + ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandPath.mClusterId)); + apCommandObj->AddStatusCode(aCommandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::InteractionModel::Id, Protocols::InteractionModel::Status::UnsupportedCluster); break; } + exit: - Compatibility::ResetEmberAfObjects(); aReader.ExitContainer(dataTlvType); + Compatibility::ResetEmberAfObjects(); } -void DispatchSingleClusterResponseCommand(ClusterId aClusterId, CommandId aCommandId, EndpointId aEndPointId, - TLV::TLVReader & aReader, CommandSender * apCommandObj) +void DispatchSingleClusterResponseCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, + CommandSender * apCommandObj) { - ChipLogDetail(Zcl, "Received Cluster Command: Cluster=%" PRIx32 " Command=%" PRIx32 " Endpoint=%" PRIx16, aClusterId, - aCommandId, aEndPointId); - Compatibility::SetupEmberAfObjects(apCommandObj, aClusterId, aCommandId, aEndPointId); - ConcreteCommandPath commandPath(aEndPointId, aClusterId, aCommandId); + ChipLogDetail(Zcl, "Received Cluster Command: Endpoint=%" PRIx16 " Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, + aCommandPath.mEndpointId, ChipLogValueMEI(aCommandPath.mClusterId), ChipLogValueMEI(aCommandPath.mCommandId)); + + Compatibility::SetupEmberAfObjects(apCommandObj, aCommandPath); + TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); - switch (aClusterId) + switch (aCommandPath.mClusterId) { default: - // Unrecognized cluster ID, error status will apply. - apCommandObj->AddStatusCode(commandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aClusterId)); + ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandPath.mClusterId)); + apCommandObj->AddStatusCode(aCommandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::InteractionModel::Id, Protocols::InteractionModel::Status::UnsupportedCluster); break; } + exit: - Compatibility::ResetEmberAfObjects(); aReader.ExitContainer(dataTlvType); + Compatibility::ResetEmberAfObjects(); } } // namespace app diff --git a/zzz_generated/temperature-measurement-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/temperature-measurement-app/zap-generated/IMClusterCommandHandler.cpp index 1729871927189a..c0be9a7cb549ea 100644 --- a/zzz_generated/temperature-measurement-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/temperature-measurement-app/zap-generated/IMClusterCommandHandler.cpp @@ -1665,65 +1665,66 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } // namespace Clusters -void DispatchSingleClusterCommand(ClusterId aClusterId, CommandId aCommandId, EndpointId aEndPointId, TLV::TLVReader & aReader, - CommandHandler * apCommandObj) +void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, CommandHandler * apCommandObj) { - ChipLogDetail(Zcl, "Received Cluster Command: Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI " Endpoint=%" PRIx16, - ChipLogValueMEI(aClusterId), ChipLogValueMEI(aCommandId), aEndPointId); - Compatibility::SetupEmberAfObjects(apCommandObj, aClusterId, aCommandId, aEndPointId); - ConcreteCommandPath commandPath(aEndPointId, aClusterId, aCommandId); + ChipLogDetail(Zcl, "Received Cluster Command: Endpoint=%" PRIx16 " Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, + aCommandPath.mEndpointId, ChipLogValueMEI(aCommandPath.mClusterId), ChipLogValueMEI(aCommandPath.mCommandId)); + + Compatibility::SetupEmberAfObjects(apCommandObj, aCommandPath); + TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); - switch (aClusterId) + switch (aCommandPath.mClusterId) { case Clusters::AdministratorCommissioning::Id: - Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::DiagnosticLogs::Id: - Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::GeneralCommissioning::Id: - Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::NetworkCommissioning::Id: - Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::OperationalCredentials::Id: - Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; default: - // Unrecognized cluster ID, error status will apply. - apCommandObj->AddStatusCode(commandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogError(Zcl, "Unknown cluster %" PRIx32, aClusterId); + ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandPath.mClusterId)); + apCommandObj->AddStatusCode(aCommandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::InteractionModel::Id, Protocols::InteractionModel::Status::UnsupportedCluster); break; } + exit: - Compatibility::ResetEmberAfObjects(); aReader.ExitContainer(dataTlvType); + Compatibility::ResetEmberAfObjects(); } -void DispatchSingleClusterResponseCommand(ClusterId aClusterId, CommandId aCommandId, EndpointId aEndPointId, - TLV::TLVReader & aReader, CommandSender * apCommandObj) +void DispatchSingleClusterResponseCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, + CommandSender * apCommandObj) { - ChipLogDetail(Zcl, "Received Cluster Command: Cluster=%" PRIx32 " Command=%" PRIx32 " Endpoint=%" PRIx16, aClusterId, - aCommandId, aEndPointId); - Compatibility::SetupEmberAfObjects(apCommandObj, aClusterId, aCommandId, aEndPointId); - ConcreteCommandPath commandPath(aEndPointId, aClusterId, aCommandId); + ChipLogDetail(Zcl, "Received Cluster Command: Endpoint=%" PRIx16 " Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, + aCommandPath.mEndpointId, ChipLogValueMEI(aCommandPath.mClusterId), ChipLogValueMEI(aCommandPath.mCommandId)); + + Compatibility::SetupEmberAfObjects(apCommandObj, aCommandPath); + TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); - switch (aClusterId) + switch (aCommandPath.mClusterId) { default: - // Unrecognized cluster ID, error status will apply. - apCommandObj->AddStatusCode(commandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aClusterId)); + ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandPath.mClusterId)); + apCommandObj->AddStatusCode(aCommandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::InteractionModel::Id, Protocols::InteractionModel::Status::UnsupportedCluster); break; } + exit: - Compatibility::ResetEmberAfObjects(); aReader.ExitContainer(dataTlvType); + Compatibility::ResetEmberAfObjects(); } } // namespace app diff --git a/zzz_generated/thermostat/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/thermostat/zap-generated/IMClusterCommandHandler.cpp index 11fd757cf864f6..2fb62bfee550d4 100644 --- a/zzz_generated/thermostat/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/thermostat/zap-generated/IMClusterCommandHandler.cpp @@ -6915,110 +6915,111 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } // namespace Clusters -void DispatchSingleClusterCommand(ClusterId aClusterId, CommandId aCommandId, EndpointId aEndPointId, TLV::TLVReader & aReader, - CommandHandler * apCommandObj) +void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, CommandHandler * apCommandObj) { - ChipLogDetail(Zcl, "Received Cluster Command: Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI " Endpoint=%" PRIx16, - ChipLogValueMEI(aClusterId), ChipLogValueMEI(aCommandId), aEndPointId); - Compatibility::SetupEmberAfObjects(apCommandObj, aClusterId, aCommandId, aEndPointId); - ConcreteCommandPath commandPath(aEndPointId, aClusterId, aCommandId); + ChipLogDetail(Zcl, "Received Cluster Command: Endpoint=%" PRIx16 " Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, + aCommandPath.mEndpointId, ChipLogValueMEI(aCommandPath.mClusterId), ChipLogValueMEI(aCommandPath.mCommandId)); + + Compatibility::SetupEmberAfObjects(apCommandObj, aCommandPath); + TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); - switch (aClusterId) + switch (aCommandPath.mClusterId) { case Clusters::AdministratorCommissioning::Id: - Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::BarrierControl::Id: - Clusters::BarrierControl::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::BarrierControl::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::Basic::Id: - Clusters::Basic::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::Basic::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::Binding::Id: - Clusters::Binding::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::Binding::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::ColorControl::Id: - Clusters::ColorControl::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::ColorControl::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::DiagnosticLogs::Id: - Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::DoorLock::Id: - Clusters::DoorLock::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::DoorLock::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::GeneralCommissioning::Id: - Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::Groups::Id: - Clusters::Groups::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::Groups::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::IasZone::Id: - Clusters::IasZone::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::IasZone::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::Identify::Id: - Clusters::Identify::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::Identify::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::LevelControl::Id: - Clusters::LevelControl::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::LevelControl::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::LowPower::Id: - Clusters::LowPower::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::LowPower::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::NetworkCommissioning::Id: - Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::OtaSoftwareUpdateProvider::Id: - Clusters::OtaSoftwareUpdateProvider::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::OtaSoftwareUpdateProvider::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::OnOff::Id: - Clusters::OnOff::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::OnOff::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::OperationalCredentials::Id: - Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::Scenes::Id: - Clusters::Scenes::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::Scenes::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::TestCluster::Id: - Clusters::TestCluster::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::TestCluster::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::Thermostat::Id: - Clusters::Thermostat::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::Thermostat::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; default: - // Unrecognized cluster ID, error status will apply. - apCommandObj->AddStatusCode(commandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogError(Zcl, "Unknown cluster %" PRIx32, aClusterId); + ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandPath.mClusterId)); + apCommandObj->AddStatusCode(aCommandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::InteractionModel::Id, Protocols::InteractionModel::Status::UnsupportedCluster); break; } + exit: - Compatibility::ResetEmberAfObjects(); aReader.ExitContainer(dataTlvType); + Compatibility::ResetEmberAfObjects(); } -void DispatchSingleClusterResponseCommand(ClusterId aClusterId, CommandId aCommandId, EndpointId aEndPointId, - TLV::TLVReader & aReader, CommandSender * apCommandObj) +void DispatchSingleClusterResponseCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, + CommandSender * apCommandObj) { - ChipLogDetail(Zcl, "Received Cluster Command: Cluster=%" PRIx32 " Command=%" PRIx32 " Endpoint=%" PRIx16, aClusterId, - aCommandId, aEndPointId); - Compatibility::SetupEmberAfObjects(apCommandObj, aClusterId, aCommandId, aEndPointId); - ConcreteCommandPath commandPath(aEndPointId, aClusterId, aCommandId); + ChipLogDetail(Zcl, "Received Cluster Command: Endpoint=%" PRIx16 " Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, + aCommandPath.mEndpointId, ChipLogValueMEI(aCommandPath.mClusterId), ChipLogValueMEI(aCommandPath.mCommandId)); + + Compatibility::SetupEmberAfObjects(apCommandObj, aCommandPath); + TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); - switch (aClusterId) + switch (aCommandPath.mClusterId) { default: - // Unrecognized cluster ID, error status will apply. - apCommandObj->AddStatusCode(commandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aClusterId)); + ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandPath.mClusterId)); + apCommandObj->AddStatusCode(aCommandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::InteractionModel::Id, Protocols::InteractionModel::Status::UnsupportedCluster); break; } + exit: - Compatibility::ResetEmberAfObjects(); aReader.ExitContainer(dataTlvType); + Compatibility::ResetEmberAfObjects(); } } // namespace app diff --git a/zzz_generated/tv-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/tv-app/zap-generated/IMClusterCommandHandler.cpp index f71c7b0cb8afd9..b6a2c5a4f3110d 100644 --- a/zzz_generated/tv-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/tv-app/zap-generated/IMClusterCommandHandler.cpp @@ -5610,122 +5610,123 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } // namespace Clusters -void DispatchSingleClusterCommand(ClusterId aClusterId, CommandId aCommandId, EndpointId aEndPointId, TLV::TLVReader & aReader, - CommandHandler * apCommandObj) +void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, CommandHandler * apCommandObj) { - ChipLogDetail(Zcl, "Received Cluster Command: Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI " Endpoint=%" PRIx16, - ChipLogValueMEI(aClusterId), ChipLogValueMEI(aCommandId), aEndPointId); - Compatibility::SetupEmberAfObjects(apCommandObj, aClusterId, aCommandId, aEndPointId); - ConcreteCommandPath commandPath(aEndPointId, aClusterId, aCommandId); + ChipLogDetail(Zcl, "Received Cluster Command: Endpoint=%" PRIx16 " Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, + aCommandPath.mEndpointId, ChipLogValueMEI(aCommandPath.mClusterId), ChipLogValueMEI(aCommandPath.mCommandId)); + + Compatibility::SetupEmberAfObjects(apCommandObj, aCommandPath); + TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); - switch (aClusterId) + switch (aCommandPath.mClusterId) { case Clusters::AccountLogin::Id: - Clusters::AccountLogin::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::AccountLogin::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::AdministratorCommissioning::Id: - Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::ApplicationBasic::Id: - Clusters::ApplicationBasic::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::ApplicationBasic::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::ApplicationLauncher::Id: - Clusters::ApplicationLauncher::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::ApplicationLauncher::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::AudioOutput::Id: - Clusters::AudioOutput::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::AudioOutput::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::Basic::Id: - Clusters::Basic::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::Basic::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::Binding::Id: - Clusters::Binding::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::Binding::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::ContentLauncher::Id: - Clusters::ContentLauncher::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::ContentLauncher::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::DiagnosticLogs::Id: - Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::GeneralCommissioning::Id: - Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::KeypadInput::Id: - Clusters::KeypadInput::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::KeypadInput::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::LevelControl::Id: - Clusters::LevelControl::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::LevelControl::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::LowPower::Id: - Clusters::LowPower::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::LowPower::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::MediaInput::Id: - Clusters::MediaInput::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::MediaInput::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::MediaPlayback::Id: - Clusters::MediaPlayback::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::MediaPlayback::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::NetworkCommissioning::Id: - Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::OtaSoftwareUpdateProvider::Id: - Clusters::OtaSoftwareUpdateProvider::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::OtaSoftwareUpdateProvider::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::OnOff::Id: - Clusters::OnOff::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::OnOff::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::OperationalCredentials::Id: - Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::TvChannel::Id: - Clusters::TvChannel::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::TvChannel::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::TargetNavigator::Id: - Clusters::TargetNavigator::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::TargetNavigator::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; default: - // Unrecognized cluster ID, error status will apply. - apCommandObj->AddStatusCode(commandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogError(Zcl, "Unknown cluster %" PRIx32, aClusterId); + ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandPath.mClusterId)); + apCommandObj->AddStatusCode(aCommandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::InteractionModel::Id, Protocols::InteractionModel::Status::UnsupportedCluster); break; } + exit: - Compatibility::ResetEmberAfObjects(); aReader.ExitContainer(dataTlvType); + Compatibility::ResetEmberAfObjects(); } -void DispatchSingleClusterResponseCommand(ClusterId aClusterId, CommandId aCommandId, EndpointId aEndPointId, - TLV::TLVReader & aReader, CommandSender * apCommandObj) +void DispatchSingleClusterResponseCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, + CommandSender * apCommandObj) { - ChipLogDetail(Zcl, "Received Cluster Command: Cluster=%" PRIx32 " Command=%" PRIx32 " Endpoint=%" PRIx16, aClusterId, - aCommandId, aEndPointId); - Compatibility::SetupEmberAfObjects(apCommandObj, aClusterId, aCommandId, aEndPointId); - ConcreteCommandPath commandPath(aEndPointId, aClusterId, aCommandId); + ChipLogDetail(Zcl, "Received Cluster Command: Endpoint=%" PRIx16 " Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, + aCommandPath.mEndpointId, ChipLogValueMEI(aCommandPath.mClusterId), ChipLogValueMEI(aCommandPath.mCommandId)); + + Compatibility::SetupEmberAfObjects(apCommandObj, aCommandPath); + TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); - switch (aClusterId) + switch (aCommandPath.mClusterId) { case Clusters::GeneralCommissioning::Id: - Clusters::GeneralCommissioning::DispatchClientCommand(apCommandObj, commandPath, aReader); + Clusters::GeneralCommissioning::DispatchClientCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::NetworkCommissioning::Id: - Clusters::NetworkCommissioning::DispatchClientCommand(apCommandObj, commandPath, aReader); + Clusters::NetworkCommissioning::DispatchClientCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::OperationalCredentials::Id: - Clusters::OperationalCredentials::DispatchClientCommand(apCommandObj, commandPath, aReader); + Clusters::OperationalCredentials::DispatchClientCommand(apCommandObj, aCommandPath, aReader); break; default: - // Unrecognized cluster ID, error status will apply. - apCommandObj->AddStatusCode(commandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aClusterId)); + ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandPath.mClusterId)); + apCommandObj->AddStatusCode(aCommandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::InteractionModel::Id, Protocols::InteractionModel::Status::UnsupportedCluster); break; } + exit: - Compatibility::ResetEmberAfObjects(); aReader.ExitContainer(dataTlvType); + Compatibility::ResetEmberAfObjects(); } } // namespace app diff --git a/zzz_generated/tv-casting-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/tv-casting-app/zap-generated/IMClusterCommandHandler.cpp index 8c3f9f6dc9ae77..9b12f1fba96377 100644 --- a/zzz_generated/tv-casting-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/tv-casting-app/zap-generated/IMClusterCommandHandler.cpp @@ -6616,104 +6616,105 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } // namespace Clusters -void DispatchSingleClusterCommand(ClusterId aClusterId, CommandId aCommandId, EndpointId aEndPointId, TLV::TLVReader & aReader, - CommandHandler * apCommandObj) +void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, CommandHandler * apCommandObj) { - ChipLogDetail(Zcl, "Received Cluster Command: Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI " Endpoint=%" PRIx16, - ChipLogValueMEI(aClusterId), ChipLogValueMEI(aCommandId), aEndPointId); - Compatibility::SetupEmberAfObjects(apCommandObj, aClusterId, aCommandId, aEndPointId); - ConcreteCommandPath commandPath(aEndPointId, aClusterId, aCommandId); + ChipLogDetail(Zcl, "Received Cluster Command: Endpoint=%" PRIx16 " Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, + aCommandPath.mEndpointId, ChipLogValueMEI(aCommandPath.mClusterId), ChipLogValueMEI(aCommandPath.mCommandId)); + + Compatibility::SetupEmberAfObjects(apCommandObj, aCommandPath); + TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); - switch (aClusterId) + switch (aCommandPath.mClusterId) { case Clusters::AdministratorCommissioning::Id: - Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::BarrierControl::Id: - Clusters::BarrierControl::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::BarrierControl::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::Basic::Id: - Clusters::Basic::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::Basic::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::Binding::Id: - Clusters::Binding::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::Binding::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::ColorControl::Id: - Clusters::ColorControl::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::ColorControl::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::DiagnosticLogs::Id: - Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::DoorLock::Id: - Clusters::DoorLock::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::DoorLock::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::GeneralCommissioning::Id: - Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::Groups::Id: - Clusters::Groups::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::Groups::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::IasZone::Id: - Clusters::IasZone::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::IasZone::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::Identify::Id: - Clusters::Identify::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::Identify::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::LevelControl::Id: - Clusters::LevelControl::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::LevelControl::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::NetworkCommissioning::Id: - Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::OtaSoftwareUpdateProvider::Id: - Clusters::OtaSoftwareUpdateProvider::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::OtaSoftwareUpdateProvider::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::OnOff::Id: - Clusters::OnOff::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::OnOff::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::OperationalCredentials::Id: - Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::Scenes::Id: - Clusters::Scenes::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::Scenes::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::TestCluster::Id: - Clusters::TestCluster::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::TestCluster::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; default: - // Unrecognized cluster ID, error status will apply. - apCommandObj->AddStatusCode(commandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogError(Zcl, "Unknown cluster %" PRIx32, aClusterId); + ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandPath.mClusterId)); + apCommandObj->AddStatusCode(aCommandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::InteractionModel::Id, Protocols::InteractionModel::Status::UnsupportedCluster); break; } + exit: - Compatibility::ResetEmberAfObjects(); aReader.ExitContainer(dataTlvType); + Compatibility::ResetEmberAfObjects(); } -void DispatchSingleClusterResponseCommand(ClusterId aClusterId, CommandId aCommandId, EndpointId aEndPointId, - TLV::TLVReader & aReader, CommandSender * apCommandObj) +void DispatchSingleClusterResponseCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, + CommandSender * apCommandObj) { - ChipLogDetail(Zcl, "Received Cluster Command: Cluster=%" PRIx32 " Command=%" PRIx32 " Endpoint=%" PRIx16, aClusterId, - aCommandId, aEndPointId); - Compatibility::SetupEmberAfObjects(apCommandObj, aClusterId, aCommandId, aEndPointId); - ConcreteCommandPath commandPath(aEndPointId, aClusterId, aCommandId); + ChipLogDetail(Zcl, "Received Cluster Command: Endpoint=%" PRIx16 " Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, + aCommandPath.mEndpointId, ChipLogValueMEI(aCommandPath.mClusterId), ChipLogValueMEI(aCommandPath.mCommandId)); + + Compatibility::SetupEmberAfObjects(apCommandObj, aCommandPath); + TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); - switch (aClusterId) + switch (aCommandPath.mClusterId) { default: - // Unrecognized cluster ID, error status will apply. - apCommandObj->AddStatusCode(commandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aClusterId)); + ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandPath.mClusterId)); + apCommandObj->AddStatusCode(aCommandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::InteractionModel::Id, Protocols::InteractionModel::Status::UnsupportedCluster); break; } + exit: - Compatibility::ResetEmberAfObjects(); aReader.ExitContainer(dataTlvType); + Compatibility::ResetEmberAfObjects(); } } // namespace app diff --git a/zzz_generated/window-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/window-app/zap-generated/IMClusterCommandHandler.cpp index 88348b2f3f6ab1..4b111280fae7b3 100644 --- a/zzz_generated/window-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/window-app/zap-generated/IMClusterCommandHandler.cpp @@ -2001,65 +2001,66 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } // namespace Clusters -void DispatchSingleClusterCommand(ClusterId aClusterId, CommandId aCommandId, EndpointId aEndPointId, TLV::TLVReader & aReader, - CommandHandler * apCommandObj) +void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, CommandHandler * apCommandObj) { - ChipLogDetail(Zcl, "Received Cluster Command: Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI " Endpoint=%" PRIx16, - ChipLogValueMEI(aClusterId), ChipLogValueMEI(aCommandId), aEndPointId); - Compatibility::SetupEmberAfObjects(apCommandObj, aClusterId, aCommandId, aEndPointId); - ConcreteCommandPath commandPath(aEndPointId, aClusterId, aCommandId); + ChipLogDetail(Zcl, "Received Cluster Command: Endpoint=%" PRIx16 " Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, + aCommandPath.mEndpointId, ChipLogValueMEI(aCommandPath.mClusterId), ChipLogValueMEI(aCommandPath.mCommandId)); + + Compatibility::SetupEmberAfObjects(apCommandObj, aCommandPath); + TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); - switch (aClusterId) + switch (aCommandPath.mClusterId) { case Clusters::AdministratorCommissioning::Id: - Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::GeneralCommissioning::Id: - Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::NetworkCommissioning::Id: - Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::OperationalCredentials::Id: - Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; case Clusters::WindowCovering::Id: - Clusters::WindowCovering::DispatchServerCommand(apCommandObj, commandPath, aReader); + Clusters::WindowCovering::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; default: - // Unrecognized cluster ID, error status will apply. - apCommandObj->AddStatusCode(commandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogError(Zcl, "Unknown cluster %" PRIx32, aClusterId); + ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandPath.mClusterId)); + apCommandObj->AddStatusCode(aCommandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::InteractionModel::Id, Protocols::InteractionModel::Status::UnsupportedCluster); break; } + exit: - Compatibility::ResetEmberAfObjects(); aReader.ExitContainer(dataTlvType); + Compatibility::ResetEmberAfObjects(); } -void DispatchSingleClusterResponseCommand(ClusterId aClusterId, CommandId aCommandId, EndpointId aEndPointId, - TLV::TLVReader & aReader, CommandSender * apCommandObj) +void DispatchSingleClusterResponseCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, + CommandSender * apCommandObj) { - ChipLogDetail(Zcl, "Received Cluster Command: Cluster=%" PRIx32 " Command=%" PRIx32 " Endpoint=%" PRIx16, aClusterId, - aCommandId, aEndPointId); - Compatibility::SetupEmberAfObjects(apCommandObj, aClusterId, aCommandId, aEndPointId); - ConcreteCommandPath commandPath(aEndPointId, aClusterId, aCommandId); + ChipLogDetail(Zcl, "Received Cluster Command: Endpoint=%" PRIx16 " Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, + aCommandPath.mEndpointId, ChipLogValueMEI(aCommandPath.mClusterId), ChipLogValueMEI(aCommandPath.mCommandId)); + + Compatibility::SetupEmberAfObjects(apCommandObj, aCommandPath); + TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); - switch (aClusterId) + switch (aCommandPath.mClusterId) { default: - // Unrecognized cluster ID, error status will apply. - apCommandObj->AddStatusCode(commandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aClusterId)); + ChipLogError(Zcl, "Unknown cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandPath.mClusterId)); + apCommandObj->AddStatusCode(aCommandPath, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::InteractionModel::Id, Protocols::InteractionModel::Status::UnsupportedCluster); break; } + exit: - Compatibility::ResetEmberAfObjects(); aReader.ExitContainer(dataTlvType); + Compatibility::ResetEmberAfObjects(); } } // namespace app