Skip to content

Commit

Permalink
Use gen/ids into im_cluster_command_handler.cpp (#8069)
Browse files Browse the repository at this point in the history
* Use src/app/common/gen/ids/Clusters.h and src/app/common/gen/ids/Commands.h in src/app/zap-templates/templates/app/im-cluster-command-handler.zapt

* Update generated gen/IMClusterCommandHandler.cpp
  • Loading branch information
vivien-apple authored and pull[bot] committed Aug 6, 2021
1 parent 44052b1 commit 5409590
Show file tree
Hide file tree
Showing 11 changed files with 770 additions and 777 deletions.

Large diffs are not rendered by default.

117 changes: 58 additions & 59 deletions examples/bridge-app/bridge-common/gen/IMClusterCommandHandler.cpp

Large diffs are not rendered by default.

117 changes: 58 additions & 59 deletions examples/lighting-app/lighting-common/gen/IMClusterCommandHandler.cpp

Large diffs are not rendered by default.

93 changes: 46 additions & 47 deletions examples/lock-app/lock-common/gen/IMClusterCommandHandler.cpp

Large diffs are not rendered by default.

123 changes: 61 additions & 62 deletions examples/pump-app/pump-common/gen/IMClusterCommandHandler.cpp

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

216 changes: 108 additions & 108 deletions examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp

Large diffs are not rendered by default.

91 changes: 45 additions & 46 deletions examples/window-app/common/gen/IMClusterCommandHandler.cpp

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#include <cinttypes>

#include "app/common/gen/af-structs.h"
#include "app/common/gen/cluster-id.h"
#include "app/common/gen/command-id.h"
#include "app/common/gen/ids/Clusters.h"
#include "app/common/gen/ids/Commands.h"
#include "callback.h"
#include "app/util/util.h"

Expand Down Expand Up @@ -47,7 +47,7 @@ void Dispatch{{asCamelCased side false}}Command(app::Command * apCommandObj, Com
{{#unless mfgCode}}
{{#if (isStrEqual clusterName parent.name)}}
{{#if (isCommandAvailable parent.side incoming outgoing commandSource name)}}
case ZCL_{{asDelimitedMacro name}}_COMMAND_ID: {
case Clusters::{{asUpperCamelCase parent.name}}::Commands::Ids::{{asUpperCamelCase name}}: {
{{> im_command_handler_cluster_commands}}
break;
}
Expand All @@ -59,12 +59,12 @@ void Dispatch{{asCamelCased side false}}Command(app::Command * apCommandObj, Com
// Unrecognized command ID, error status will apply.
chip::app::CommandPathParams returnStatusParam = { aEndpointId,
0, // GroupId
ZCL_{{asDelimitedMacro define}}_ID,
Clusters::{{asUpperCamelCase name}}::Id,
aCommandId,
(chip::app::CommandPathFlags::kEndpointIdValid) };
apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kNotFound, Protocols::SecureChannel::Id,
Protocols::InteractionModel::ProtocolCode::UnsupportedCommand);
ChipLogError(Zcl, "Unknown command %" PRIx32 " for cluster %" PRIx32, aCommandId, ZCL_{{asDelimitedMacro define}}_ID);
ChipLogError(Zcl, "Unknown command %" PRIx32 " for cluster %" PRIx32, aCommandId, Clusters::{{asUpperCamelCase name}}::Id);
return;
}
}
Expand All @@ -74,7 +74,7 @@ void Dispatch{{asCamelCased side false}}Command(app::Command * apCommandObj, Com
{
chip::app::CommandPathParams returnStatusParam = { aEndpointId,
0, // GroupId
ZCL_{{asDelimitedMacro define}}_ID,
Clusters::{{asUpperCamelCase name}}::Id,
aCommandId,
(chip::app::CommandPathFlags::kEndpointIdValid) };
apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id,
Expand Down Expand Up @@ -102,7 +102,7 @@ void DispatchSingleClusterCommand(chip::ClusterId aClusterId, chip::CommandId aC
{
{{#all_user_clusters}}
{{#if (user_cluster_has_enabled_command name side)}}
case ZCL_{{asDelimitedMacro define}}_ID :
case Clusters::{{asUpperCamelCase name}}::Id:
clusters::{{asCamelCased name false}}::Dispatch{{asCamelCased side false}}Command(apCommandObj, aCommandId, aEndPointId, aReader);
break;
{{/if}}
Expand Down
272 changes: 136 additions & 136 deletions src/controller/data_model/gen/IMClusterCommandHandler.cpp

Large diffs are not rendered by default.

0 comments on commit 5409590

Please sign in to comment.