From 13271783b264c38d75bb1c7da6635a3564b2d2fa Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 4 Oct 2021 22:58:09 -0400 Subject: [PATCH] Update cluster command APIs to make it easier to fix list/struct support in commands (#10168) * Put in place codegen infrastructure for better cluster callback API. Specific changes: 1) Codegen skeleton (empty so far) structs that represent command fields. 2) Modify codegen to pass the command path and the field struct to a command callback and change the order of the endpoint and CommandSender/CommandHandler arguments. 3) Modify codegen implementation of callbacks to have the new signature. ./scripts/tools/zap/generate.py -t src/app/common/templates/templates.json -o zzz_generated/app-common/app-common/zap-generated src/controller/data_model/controller-clusters.zap && ./scripts/tools/zap/generate.py -o zzz_generated/all-clusters-app/zap-generated examples/all-clusters-app/all-clusters-common/all-clusters-app.zap && ./gn_build.sh * Regenerate generated files * Update cluster callback signatures to the new signature. This commit was generated by running: find src/app/clusters examples/tv-app/linux/include/content-launcher examples/window-app/common/src -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef; } s/bool emberAf([a-zA-Z0-9]*)Cluster([a-zA-Z0-9]*)Callback\((?:chip::)?EndpointId (aEndpoint|endpoint|aEndpointId),\s*(?:chip::)?((?:app::)?CommandHandler \*(?: commandObj| command| apCommandObj|))([^)]*)\)/bool emberAf\1Cluster\2Callback(\4, const app::ConcreteCommandPath & commandPath, EndpointId \3\5, Commands::\2::DecodableType & commandData)/g;' and then restyling the modified files. * Manual changes to make clusters compile. Mostly: * Include headers needed for ConcreteCommandPath and the command field structs. * Make sure the namespaces are done right (add using declarations or namespace prefixes as needed). * Resolve some name ambiguities due to name collisions between cluster-objects.h and af-structs.h. We need to find a better solution for this. --- .../ContentLauncherManager.cpp | 13 +- .../window-app/common/src/ZclCallbacks.cpp | 6 +- src/app/ConcreteCommandPath.h | 41 + .../account-login-server.cpp | 13 +- .../administrator-commissioning-server.cpp | 22 +- .../application-basic-server.cpp | 9 +- .../application-launcher-server.cpp | 25 +- .../audio-output-server.cpp | 12 +- .../barrier-control-server.cpp | 43 +- src/app/clusters/bindings/bindings.cpp | 13 +- .../color-control-server.cpp | 303 +- .../diagnostic-logs-server.cpp | 10 +- .../door-lock-server-logging.cpp | 7 +- .../door-lock-server-schedule.cpp | 60 +- .../door-lock-server-user.cpp | 51 +- .../ethernet_network_diagnostics_server.cpp | 7 +- .../general-commissioning-server.cpp | 22 +- .../clusters/groups-server/groups-server.cpp | 29 +- .../ias-zone-server/ias-zone-server.cpp | 8 +- .../identify-server/identify-server.cpp | 15 +- .../keypad-input-server.cpp | 6 +- .../clusters/level-control/level-control.cpp | 42 +- .../low-power-server/low-power-server.cpp | 6 +- .../media-input-server/media-input-server.cpp | 17 +- .../media-playback-server.cpp | 44 +- .../network-commissioning-ember.cpp | 60 +- .../clusters/on-off-server/on-off-server.cpp | 12 +- .../operational-credentials-server.cpp | 65 +- .../clusters/ota-provider/ota-provider.cpp | 27 +- src/app/clusters/scenes/scenes.cpp | 35 +- .../software_diagnostics_server.cpp | 7 +- .../target-navigator-server.cpp | 9 +- .../test-cluster-server.cpp | 17 +- .../thermostat-server/thermostat-server.cpp | 29 +- .../thread_network_diagnostics_server.cpp | 7 +- .../tv-channel-server/tv-channel-server.cpp | 21 +- .../wifi_network_diagnostics_server.cpp | 9 +- .../window-covering-server.cpp | 34 +- .../im_command_handler_cluster_commands.zapt | 10 +- .../zap-templates/templates/app/callback.zapt | 10 +- .../templates/app/cluster-objects.zapt | 14 + .../app/im-cluster-command-handler.zapt | 29 +- .../zap-generated/IMClusterCommandHandler.cpp | 825 ++- .../app-common/zap-generated/callback.h | 1185 ++-- .../zap-generated/cluster-objects.h | 4980 ++++++++++++++--- .../zap-generated/IMClusterCommandHandler.cpp | 268 +- .../zap-generated/IMClusterCommandHandler.cpp | 438 +- .../zap-generated/IMClusterCommandHandler.cpp | 455 +- .../zap-generated/IMClusterCommandHandler.cpp | 217 +- .../zap-generated/IMClusterCommandHandler.cpp | 89 +- .../zap-generated/IMClusterCommandHandler.cpp | 36 +- .../zap-generated/IMClusterCommandHandler.cpp | 269 +- .../zap-generated/IMClusterCommandHandler.cpp | 202 +- .../zap-generated/IMClusterCommandHandler.cpp | 188 +- .../zap-generated/IMClusterCommandHandler.cpp | 732 ++- .../zap-generated/IMClusterCommandHandler.cpp | 672 ++- .../zap-generated/IMClusterCommandHandler.cpp | 686 ++- .../zap-generated/IMClusterCommandHandler.cpp | 220 +- 58 files changed, 9072 insertions(+), 3609 deletions(-) create mode 100644 src/app/ConcreteCommandPath.h diff --git a/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.cpp b/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.cpp index bf48a63915005b..676b4bae4cacf5 100644 --- a/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.cpp +++ b/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.cpp @@ -21,10 +21,12 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -103,8 +105,9 @@ static void sendResponse(const char * responseName, ContentLaunchResponse launch } } -bool emberAfContentLauncherClusterLaunchContentCallback(chip::EndpointId endpoint, chip::app::CommandHandler * command, - bool autoplay, unsigned char * data) +bool emberAfContentLauncherClusterLaunchContentCallback( + chip::app::CommandHandler * command, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + bool autoplay, unsigned char * data, chip::app::Clusters::ContentLauncher::Commands::LaunchContent::DecodableType & commandData) { string dataString(reinterpret_cast(data)); @@ -114,8 +117,10 @@ bool emberAfContentLauncherClusterLaunchContentCallback(chip::EndpointId endpoin return true; } -bool emberAfContentLauncherClusterLaunchURLCallback(chip::EndpointId endpoint, chip::app::CommandHandler * command, - unsigned char * contentUrl, unsigned char * displayString) +bool emberAfContentLauncherClusterLaunchURLCallback( + chip::app::CommandHandler * command, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + unsigned char * contentUrl, unsigned char * displayString, + chip::app::Clusters::ContentLauncher::Commands::LaunchURL::DecodableType & commandData) { string contentUrlString(reinterpret_cast(contentUrl)); string displayStringString(reinterpret_cast(displayString)); diff --git a/examples/window-app/common/src/ZclCallbacks.cpp b/examples/window-app/common/src/ZclCallbacks.cpp index 4b965ef5639c02..f5578d59bc37a9 100644 --- a/examples/window-app/common/src/ZclCallbacks.cpp +++ b/examples/window-app/common/src/ZclCallbacks.cpp @@ -25,7 +25,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -94,7 +96,9 @@ void emberAfPostAttributeChangeCallback(chip::EndpointId endpoint, chip::Cluster /** * @brief Cluster StopMotion Command callback (from client) */ -bool emberAfWindowCoveringClusterStopMotionCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj) +bool emberAfWindowCoveringClusterStopMotionCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + Commands::StopMotion::DecodableType & commandData) { ChipLogProgress(Zcl, "StopMotion command received"); WindowApp::Instance().PostEvent(WindowApp::Event(WindowApp::EventId::StopMotion, endpoint)); diff --git a/src/app/ConcreteCommandPath.h b/src/app/ConcreteCommandPath.h new file mode 100644 index 00000000000000..e811fa75d325fe --- /dev/null +++ b/src/app/ConcreteCommandPath.h @@ -0,0 +1,41 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +namespace chip { +namespace app { + +/** + * A representation of a concrete invoke path. + */ +struct ConcreteCommandPath +{ + ConcreteCommandPath(EndpointId aEndpointId, ClusterId aClusterId, CommandId aCommandId) : + mEndpointId(aEndpointId), mClusterId(aClusterId), mCommandId(aCommandId) + {} + + const EndpointId mEndpointId = 0; + const ClusterId mClusterId = 0; + const CommandId mCommandId = 0; +}; +} // namespace app +} // namespace chip diff --git a/src/app/clusters/account-login-server/account-login-server.cpp b/src/app/clusters/account-login-server/account-login-server.cpp index a7b422dcc7e82e..0a4efad968e603 100644 --- a/src/app/clusters/account-login-server/account-login-server.cpp +++ b/src/app/clusters/account-login-server/account-login-server.cpp @@ -22,12 +22,15 @@ ******************************************************************************/ #include +#include #include #include +#include #include #include using namespace chip; +using namespace chip::app::Clusters::AccountLogin; bool accountLoginClusterIsUserLoggedIn(std::string requestTempAccountIdentifier, std::string requestSetupPin); std::string accountLoginClusterGetSetupPin(std::string requestTempAccountIdentifier, EndpointId endpoint); @@ -49,8 +52,9 @@ void sendResponse(app::CommandHandler * command, const char * responseSetupPin) } } -bool emberAfAccountLoginClusterGetSetupPINCallback(EndpointId endpoint, app::CommandHandler * command, - uint8_t * tempAccountIdentifier) +bool emberAfAccountLoginClusterGetSetupPINCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint8_t * tempAccountIdentifier, + Commands::GetSetupPIN::DecodableType & commandData) { // TODO: char is not null terminated, verify this code once #7963 gets merged. std::string tempAccountIdentifierString(reinterpret_cast(tempAccountIdentifier)); @@ -59,8 +63,9 @@ bool emberAfAccountLoginClusterGetSetupPINCallback(EndpointId endpoint, app::Com return true; } -bool emberAfAccountLoginClusterLoginCallback(EndpointId endpoint, app::CommandHandler * command, uint8_t * tempAccountIdentifier, - uint8_t * tempSetupPin) +bool emberAfAccountLoginClusterLoginCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint8_t * tempAccountIdentifier, uint8_t * tempSetupPin, + Commands::Login::DecodableType & commandData) { // TODO: char is not null terminated, verify this code once #7963 gets merged. std::string tempAccountIdentifierString(reinterpret_cast(tempAccountIdentifier)); diff --git a/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp b/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp index 0cea2193498336..5c63bcc78401c3 100644 --- a/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp +++ b/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp @@ -20,7 +20,9 @@ * @brief Implementation for the Administrator Commissioning Cluster ***************************************************************************/ +#include #include +#include #include #include #include @@ -28,14 +30,15 @@ #include using namespace chip; +using namespace chip::app::Clusters::AdministratorCommissioning; // Specifications section 5.4.2.3. Announcement Duration constexpr uint32_t kMaxCommissionioningTimeoutSeconds = 15 * 60; -bool emberAfAdministratorCommissioningClusterOpenCommissioningWindowCallback(EndpointId endpoint, app::CommandHandler * commandObj, - uint16_t commissioningTimeout, ByteSpan pakeVerifier, - uint16_t discriminator, uint32_t iterations, - ByteSpan salt, uint16_t passcodeID) +bool emberAfAdministratorCommissioningClusterOpenCommissioningWindowCallback( + app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + uint16_t commissioningTimeout, ByteSpan pakeVerifier, uint16_t discriminator, uint32_t iterations, ByteSpan salt, + uint16_t passcodeID, Commands::OpenCommissioningWindow::DecodableType & commandData) { EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; PASEVerifier verifier; @@ -70,9 +73,9 @@ bool emberAfAdministratorCommissioningClusterOpenCommissioningWindowCallback(End return true; } -bool emberAfAdministratorCommissioningClusterOpenBasicCommissioningWindowCallback(EndpointId endpoint, - app::CommandHandler * commandObj, - uint16_t commissioningTimeout) +bool emberAfAdministratorCommissioningClusterOpenBasicCommissioningWindowCallback( + app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + uint16_t commissioningTimeout, Commands::OpenBasicCommissioningWindow::DecodableType & commandData) { EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; ChipLogProgress(Zcl, "Received command to open basic commissioning window"); @@ -93,7 +96,10 @@ bool emberAfAdministratorCommissioningClusterOpenBasicCommissioningWindowCallbac return true; } -bool emberAfAdministratorCommissioningClusterRevokeCommissioningCallback(EndpointId endpoint, app::CommandHandler * commandObj) +bool emberAfAdministratorCommissioningClusterRevokeCommissioningCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, + Commands::RevokeCommissioning::DecodableType & commandData) { ChipLogProgress(Zcl, "Received command to close commissioning window"); Server::GetInstance().GetCommissioningWindowManager().CloseCommissioningWindow(); diff --git a/src/app/clusters/application-basic-server/application-basic-server.cpp b/src/app/clusters/application-basic-server/application-basic-server.cpp index c8eaaf8c976edd..9ddb015f757586 100644 --- a/src/app/clusters/application-basic-server/application-basic-server.cpp +++ b/src/app/clusters/application-basic-server/application-basic-server.cpp @@ -22,17 +22,22 @@ ******************************************************************************* ******************************************************************************/ +#include #include #include +#include #include #include using namespace chip; +using namespace chip::app::Clusters::ApplicationBasic; bool applicationBasicClusterChangeApplicationStatus(EmberAfApplicationBasicStatus status, EndpointId endpoint); -bool emberAfApplicationBasicClusterChangeStatusCallback(EndpointId endpoint, app::CommandHandler * commandObj, - uint8_t newApplicationStatus) +bool emberAfApplicationBasicClusterChangeStatusCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + uint8_t newApplicationStatus, + Commands::ChangeStatus::DecodableType & commandData) { bool success = applicationBasicClusterChangeApplicationStatus(static_cast(newApplicationStatus), emberAfCurrentEndpoint()); diff --git a/src/app/clusters/application-launcher-server/application-launcher-server.cpp b/src/app/clusters/application-launcher-server/application-launcher-server.cpp index 414c47f52eaedc..a9cd0ed157a1f6 100644 --- a/src/app/clusters/application-launcher-server/application-launcher-server.cpp +++ b/src/app/clusters/application-launcher-server/application-launcher-server.cpp @@ -24,17 +24,22 @@ #include #include +#include #include #include #include +#include #include #include using namespace chip; +using namespace chip::app::Clusters::ApplicationLauncher; -ApplicationLauncherResponse applicationLauncherClusterLaunchApp(ApplicationLauncherApp application, std::string data); +ApplicationLauncherResponse applicationLauncherClusterLaunchApp(::ApplicationLauncherApp application, std::string data); -bool emberAfApplicationLauncherClusterLaunchAppCallback(EndpointId endpoint, app::CommandHandler * commandObj, uint8_t *, uint8_t *) +bool emberAfApplicationLauncherClusterLaunchAppCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + uint8_t *, uint8_t *, Commands::LaunchApp::DecodableType & commandData) { EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; emberAfSendImmediateDefaultResponse(status); @@ -59,18 +64,20 @@ void sendResponse(app::CommandHandler * command, ApplicationLauncherResponse res } } -ApplicationLauncherApp getApplicationFromCommand(uint16_t catalogVendorId, uint8_t * applicationId) +::ApplicationLauncherApp getApplicationFromCommand(uint16_t catalogVendorId, uint8_t * applicationId) { - ApplicationLauncherApp application = {}; - application.applicationId = applicationId; - application.catalogVendorId = catalogVendorId; + ::ApplicationLauncherApp application = {}; + application.applicationId = applicationId; + application.catalogVendorId = catalogVendorId; return application; } -bool emberAfApplicationLauncherClusterLaunchAppCallback(EndpointId endpoint, app::CommandHandler * command, uint8_t * requestData, - uint16_t requestApplicationCatalogVendorId, uint8_t * requestApplicationId) +bool emberAfApplicationLauncherClusterLaunchAppCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint8_t * requestData, + uint16_t requestApplicationCatalogVendorId, uint8_t * requestApplicationId, + Commands::LaunchApp::DecodableType & commandData) { - ApplicationLauncherApp application = getApplicationFromCommand(requestApplicationCatalogVendorId, requestApplicationId); + ::ApplicationLauncherApp application = getApplicationFromCommand(requestApplicationCatalogVendorId, requestApplicationId); // TODO: Char is not null terminated, verify this code once #7963 gets merged. std::string reqestDataString(reinterpret_cast(requestData)); ApplicationLauncherResponse response = applicationLauncherClusterLaunchApp(application, reqestDataString); diff --git a/src/app/clusters/audio-output-server/audio-output-server.cpp b/src/app/clusters/audio-output-server/audio-output-server.cpp index 72a20a119d1232..6286a0c80f6bb1 100644 --- a/src/app/clusters/audio-output-server/audio-output-server.cpp +++ b/src/app/clusters/audio-output-server/audio-output-server.cpp @@ -22,16 +22,20 @@ ******************************************************************************* ******************************************************************************/ +#include #include +#include #include using namespace chip; +using namespace chip::app::Clusters::AudioOutput; bool audioOutputClusterSelectOutput(uint8_t index); bool audioOutputClusterRenameOutput(uint8_t index, uint8_t * name); -bool emberAfAudioOutputClusterRenameOutputCallback(EndpointId endpoint, app::CommandHandler * command, uint8_t index, - uint8_t * name) +bool emberAfAudioOutputClusterRenameOutputCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint8_t index, uint8_t * name, + Commands::RenameOutput::DecodableType & commandData) { bool success = audioOutputClusterRenameOutput(index, name); EmberAfStatus status = success ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; @@ -39,7 +43,9 @@ bool emberAfAudioOutputClusterRenameOutputCallback(EndpointId endpoint, app::Com return true; } -bool emberAfAudioOutputClusterSelectOutputCallback(EndpointId endpoint, app::CommandHandler * command, uint8_t index) +bool emberAfAudioOutputClusterSelectOutputCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint8_t index, + Commands::SelectOutput::DecodableType & commandData) { bool success = audioOutputClusterSelectOutput(index); EmberAfStatus status = success ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; diff --git a/src/app/clusters/barrier-control-server/barrier-control-server.cpp b/src/app/clusters/barrier-control-server/barrier-control-server.cpp index 12b668d3bebd9a..1aac71ed8dd2e8 100644 --- a/src/app/clusters/barrier-control-server/barrier-control-server.cpp +++ b/src/app/clusters/barrier-control-server/barrier-control-server.cpp @@ -41,8 +41,10 @@ #include "barrier-control-server.h" #include #include +#include #include #include +#include #include #include @@ -52,6 +54,7 @@ using namespace chip; using namespace chip::app::Clusters; +using namespace chip::app::Clusters::BarrierControl; typedef struct { @@ -85,21 +88,21 @@ void emberAfPluginBarrierControlServerInitCallback(void) {} uint8_t emAfPluginBarrierControlServerGetBarrierPosition(EndpointId endpoint) { uint8_t position; - EmberAfStatus status = BarrierControl::Attributes::BarrierPosition::Get(endpoint, &position); + EmberAfStatus status = Attributes::BarrierPosition::Get(endpoint, &position); assert(status == EMBER_ZCL_STATUS_SUCCESS); return position; } void emAfPluginBarrierControlServerSetBarrierPosition(EndpointId endpoint, uint8_t position) { - EmberAfStatus status = BarrierControl::Attributes::BarrierPosition::Set(endpoint, position); + EmberAfStatus status = Attributes::BarrierPosition::Set(endpoint, position); assert(status == EMBER_ZCL_STATUS_SUCCESS); } bool emAfPluginBarrierControlServerIsPartialBarrierSupported(EndpointId endpoint) { uint8_t bitmap; - EmberAfStatus status = BarrierControl::Attributes::BarrierCapabilities::Get(endpoint, &bitmap); + EmberAfStatus status = Attributes::BarrierCapabilities::Get(endpoint, &bitmap); assert(status == EMBER_ZCL_STATUS_SUCCESS); return READBITS(bitmap, EMBER_AF_BARRIER_CONTROL_CAPABILITIES_PARTIAL_BARRIER); } @@ -111,13 +114,13 @@ static uint16_t getOpenOrClosePeriod(EndpointId endpoint, bool open) #if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_OPEN_PERIOD_ATTRIBUTE) if (open) { - status = BarrierControl::Attributes::BarrierOpenPeriod::Get(endpoint, &period); + status = Attributes::BarrierOpenPeriod::Get(endpoint, &period); } #endif #if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_CLOSE_PERIOD_ATTRIBUTE) if (!open) { - status = BarrierControl::Attributes::BarrierClosePeriod::Get(endpoint, &period); + status = Attributes::BarrierClosePeriod::Get(endpoint, &period); } #endif assert(status == EMBER_ZCL_STATUS_SUCCESS); @@ -126,14 +129,14 @@ static uint16_t getOpenOrClosePeriod(EndpointId endpoint, bool open) static void setMovingState(EndpointId endpoint, uint8_t newState) { - EmberAfStatus status = BarrierControl::Attributes::BarrierMovingState::Set(endpoint, newState); + EmberAfStatus status = Attributes::BarrierMovingState::Set(endpoint, newState); assert(status == EMBER_ZCL_STATUS_SUCCESS); } uint16_t emAfPluginBarrierControlServerGetSafetyStatus(EndpointId endpoint) { uint16_t safetyStatus; - EmberAfStatus status = BarrierControl::Attributes::BarrierSafetyStatus::Get(endpoint, &safetyStatus); + EmberAfStatus status = Attributes::BarrierSafetyStatus::Get(endpoint, &safetyStatus); assert(status == EMBER_ZCL_STATUS_SUCCESS); return safetyStatus; } @@ -152,25 +155,25 @@ void emAfPluginBarrierControlServerIncrementEvents(EndpointId endpoint, bool ope #if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_OPEN_EVENTS_ATTRIBUTE) if (open && !command) { - status = BarrierControl::Attributes::BarrierOpenEvents::Get(endpoint, &events); + status = Attributes::BarrierOpenEvents::Get(endpoint, &events); } #endif #if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_CLOSE_EVENTS_ATTRIBUTE) if (!open && !command) { - status = BarrierControl::Attributes::BarrierCloseEvents::Get(endpoint, &events); + status = Attributes::BarrierCloseEvents::Get(endpoint, &events); } #endif #if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_COMMAND_OPEN_EVENTS_ATTRIBUTE) if (open && command) { - status = BarrierControl::Attributes::BarrierCommandOpenEvents::Get(endpoint, &events); + status = Attributes::BarrierCommandOpenEvents::Get(endpoint, &events); } #endif #if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_COMMAND_CLOSE_EVENTS_ATTRIBUTE) if (!open && command) { - status = BarrierControl::Attributes::BarrierCommandCloseEvents::Get(endpoint, &events); + status = Attributes::BarrierCommandCloseEvents::Get(endpoint, &events); } #endif assert(status == EMBER_ZCL_STATUS_SUCCESS); @@ -187,25 +190,25 @@ void emAfPluginBarrierControlServerIncrementEvents(EndpointId endpoint, bool ope #if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_OPEN_EVENTS_ATTRIBUTE) if (open && !command) { - status = BarrierControl::Attributes::BarrierOpenEvents::Set(endpoint, events); + status = Attributes::BarrierOpenEvents::Set(endpoint, events); } #endif #if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_CLOSE_EVENTS_ATTRIBUTE) if (!open && !command) { - status = BarrierControl::Attributes::BarrierCloseEvents::Set(endpoint, events); + status = Attributes::BarrierCloseEvents::Set(endpoint, events); } #endif #if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_COMMAND_OPEN_EVENTS_ATTRIBUTE) if (open && command) { - status = BarrierControl::Attributes::BarrierCommandOpenEvents::Set(endpoint, events); + status = Attributes::BarrierCommandOpenEvents::Set(endpoint, events); } #endif #if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_COMMAND_CLOSE_EVENTS_ATTRIBUTE) if (!open && command) { - status = BarrierControl::Attributes::BarrierCommandCloseEvents::Set(endpoint, events); + status = Attributes::BarrierCommandCloseEvents::Set(endpoint, events); } #endif assert(status == EMBER_ZCL_STATUS_SUCCESS); @@ -296,8 +299,10 @@ static void sendDefaultResponse(EmberAfStatus status) } } -bool emberAfBarrierControlClusterBarrierControlGoToPercentCallback(EndpointId aEndpoint, app::CommandHandler * commandObj, - uint8_t percentOpen) +bool emberAfBarrierControlClusterBarrierControlGoToPercentCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, + EndpointId aEndpoint, uint8_t percentOpen, + Commands::BarrierControlGoToPercent::DecodableType & commandData) { EndpointId endpoint = emberAfCurrentCommand()->apsFrame->destinationEndpoint; EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; @@ -339,7 +344,9 @@ bool emberAfBarrierControlClusterBarrierControlGoToPercentCallback(EndpointId aE return true; } -bool emberAfBarrierControlClusterBarrierControlStopCallback(EndpointId aEndpoint, app::CommandHandler * commandObj) +bool emberAfBarrierControlClusterBarrierControlStopCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId aEndpoint, + Commands::BarrierControlStop::DecodableType & commandData) { EndpointId endpoint = emberAfCurrentCommand()->apsFrame->destinationEndpoint; emberAfDeactivateServerTick(endpoint, BarrierControl::Id); diff --git a/src/app/clusters/bindings/bindings.cpp b/src/app/clusters/bindings/bindings.cpp index c3d93776b99132..6686f0b80d5cd4 100644 --- a/src/app/clusters/bindings/bindings.cpp +++ b/src/app/clusters/bindings/bindings.cpp @@ -22,11 +22,14 @@ #include +#include #include +#include #include #include using namespace chip; +using namespace chip::app::Clusters::Binding; EmberStatus prepareBinding(EmberBindingTableEntry & binding, NodeId nodeId, GroupId groupId, EndpointId endpointId, ClusterId clusterId) @@ -88,8 +91,9 @@ EmberStatus getUnusedBindingIndex(uint8_t * bindingIndex) return EMBER_NOT_FOUND; } -bool emberAfBindingClusterBindCallback(EndpointId endpoint, app::CommandHandler * commandObj, NodeId nodeId, GroupId groupId, - EndpointId endpointId, ClusterId clusterId) +bool emberAfBindingClusterBindCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, NodeId nodeId, GroupId groupId, EndpointId endpointId, + ClusterId clusterId, Commands::Bind::DecodableType & commandData) { ChipLogDetail(Zcl, "RX: BindCallback"); @@ -118,8 +122,9 @@ bool emberAfBindingClusterBindCallback(EndpointId endpoint, app::CommandHandler return true; } -bool emberAfBindingClusterUnbindCallback(EndpointId endpoint, app::CommandHandler * commandObj, NodeId nodeId, GroupId groupId, - EndpointId endpointId, ClusterId clusterId) +bool emberAfBindingClusterUnbindCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, NodeId nodeId, GroupId groupId, EndpointId endpointId, + ClusterId clusterId, Commands::Unbind::DecodableType & commandData) { ChipLogDetail(Zcl, "RX: UnbindCallback"); diff --git a/src/app/clusters/color-control-server/color-control-server.cpp b/src/app/clusters/color-control-server/color-control-server.cpp index b0c74ecf562806..d828aab5a22579 100644 --- a/src/app/clusters/color-control-server/color-control-server.cpp +++ b/src/app/clusters/color-control-server/color-control-server.cpp @@ -41,12 +41,15 @@ #include #include #include +#include #include +#include #include #include using namespace chip; -using namespace app::Clusters; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::ColorControl; /********************************************************** * Attributes Definition @@ -97,7 +100,7 @@ bool ColorControlServer::shouldExecuteIfOff(EndpointId endpoint, uint8_t optionM } uint8_t options = 0x00; - ColorControl::Attributes::ColorControlOptions::Get(endpoint, &options); + Attributes::ColorControlOptions::Get(endpoint, &options); bool on = true; OnOff::Attributes::OnOff::Get(endpoint, &on); @@ -156,7 +159,7 @@ bool ColorControlServer::shouldExecuteIfOff(EndpointId endpoint, uint8_t optionM void ColorControlServer::handleModeSwitch(EndpointId endpoint, uint8_t newColorMode) { uint8_t oldColorMode = 0; - ColorControl::Attributes::ColorMode::Get(endpoint, &oldColorMode); + Attributes::ColorMode::Get(endpoint, &oldColorMode); uint8_t colorModeTransition; @@ -166,8 +169,8 @@ void ColorControlServer::handleModeSwitch(EndpointId endpoint, uint8_t newColorM } else { - ColorControl::Attributes::EnhancedColorMode::Set(endpoint, newColorMode); - ColorControl::Attributes::ColorMode::Set(endpoint, newColorMode); + Attributes::EnhancedColorMode::Set(endpoint, newColorMode); + Attributes::ColorMode::Set(endpoint, newColorMode); } colorModeTransition = static_cast((newColorMode << 4) + oldColorMode); @@ -303,7 +306,7 @@ bool ColorControlServer::computeNewColor16uValue(ColorControlServer::Color16uTra (p->stepsRemaining)--; - ColorControl::Attributes::RemainingTime::Set(p->endpoint, p->stepsRemaining); + Attributes::RemainingTime::Set(p->endpoint, p->stepsRemaining); // handle sign if (p->finalValue == p->currentValue) @@ -379,7 +382,7 @@ ColorControlServer::Color16uTransitionState * ColorControlServer::getSaturationT uint8_t ColorControlServer::getSaturation(EndpointId endpoint) { uint8_t saturation = 0; - ColorControl::Attributes::CurrentSaturation::Get(endpoint, &saturation); + Attributes::CurrentSaturation::Get(endpoint, &saturation); return saturation; } @@ -504,26 +507,26 @@ void ColorControlServer::startColorLoop(EndpointId endpoint, uint8_t startFromSt Color16uTransitionState * colorSaturationTransitionState = getSaturationTransitionState(endpoint); uint8_t direction = 0; - ColorControl::Attributes::ColorLoopDirection::Get(endpoint, &direction); + Attributes::ColorLoopDirection::Get(endpoint, &direction); uint16_t time = 0x0019; - ColorControl::Attributes::ColorLoopTime::Get(endpoint, &time); + Attributes::ColorLoopTime::Get(endpoint, &time); uint16_t currentHue = 0; - ColorControl::Attributes::EnhancedCurrentHue::Get(endpoint, ¤tHue); + Attributes::EnhancedCurrentHue::Get(endpoint, ¤tHue); u_int16_t startHue = 0x2300; if (startFromStartHue) { - ColorControl::Attributes::ColorLoopStartEnhancedHue::Get(endpoint, &startHue); + Attributes::ColorLoopStartEnhancedHue::Get(endpoint, &startHue); } else { startHue = currentHue; } - ColorControl::Attributes::ColorLoopStoredEnhancedHue::Set(endpoint, currentHue); - ColorControl::Attributes::ColorLoopActive::Set(endpoint, true); + Attributes::ColorLoopStoredEnhancedHue::Set(endpoint, currentHue); + Attributes::ColorLoopActive::Set(endpoint, true); initHueSat(endpoint, colorHueTransitionState, colorSaturationTransitionState); @@ -548,7 +551,7 @@ void ColorControlServer::startColorLoop(EndpointId endpoint, uint8_t startFromSt colorHueTransitionState->stepsTotal = static_cast(time * TRANSITION_TIME_1S); colorHueTransitionState->endpoint = endpoint; - ColorControl::Attributes::RemainingTime::Set(endpoint, MAX_INT16U_VALUE); + Attributes::RemainingTime::Set(endpoint, MAX_INT16U_VALUE); emberEventControlSetDelayMS(configureHSVEventControl(endpoint), UPDATE_TIME_MS); } @@ -564,10 +567,10 @@ void ColorControlServer::initHueSat(EndpointId endpoint, ColorControlServer::Col ColorControlServer::Color16uTransitionState * colorSatTransitionState) { colorHueTransitionState->stepsRemaining = 0; - ColorControl::Attributes::CurrentHue::Get(endpoint, &(colorHueTransitionState->currentHue)); + Attributes::CurrentHue::Get(endpoint, &(colorHueTransitionState->currentHue)); colorHueTransitionState->endpoint = endpoint; - ColorControl::Attributes::EnhancedCurrentHue::Get(endpoint, &(colorHueTransitionState->currentEnhancedHue)); + Attributes::EnhancedCurrentHue::Get(endpoint, &(colorHueTransitionState->currentEnhancedHue)); colorHueTransitionState->isEnhancedHue = false; colorSatTransitionState->stepsRemaining = 0; @@ -597,7 +600,7 @@ bool ColorControlServer::computeNewHueValue(ColorControlServer::ColorHueTransiti if (p->repeat == false) { - ColorControl::Attributes::RemainingTime::Set(p->endpoint, p->stepsRemaining); + Attributes::RemainingTime::Set(p->endpoint, p->stepsRemaining); } // are we going up or down? @@ -649,7 +652,7 @@ bool ColorControlServer::computeNewHueValue(ColorControlServer::ColorHueTransiti { // Check if we are in a color loop. If not, we are in a moveHue uint8_t isColorLoop = 0; - ColorControl::Attributes::ColorLoopActive::Get(p->endpoint, &isColorLoop); + Attributes::ColorLoopActive::Get(p->endpoint, &isColorLoop); if (isColorLoop) { @@ -766,13 +769,13 @@ bool ColorControlServer::moveHueCommand(uint8_t moveMode, uint16_t rate, uint8_t colorHueTransitionState->isEnhancedHue = isEnhanced; if (isEnhanced) { - ColorControl::Attributes::EnhancedCurrentHue::Get(endpoint, ¤tEnhancedHue); + Attributes::EnhancedCurrentHue::Get(endpoint, ¤tEnhancedHue); colorHueTransitionState->initialEnhancedHue = currentEnhancedHue; colorHueTransitionState->currentEnhancedHue = currentEnhancedHue; } else { - ColorControl::Attributes::CurrentHue::Get(endpoint, ¤tHue); + Attributes::CurrentHue::Get(endpoint, ¤tHue); colorHueTransitionState->initialHue = currentHue; colorHueTransitionState->currentHue = currentHue; } @@ -814,7 +817,7 @@ bool ColorControlServer::moveHueCommand(uint8_t moveMode, uint16_t rate, uint8_t colorHueTransitionState->repeat = true; // hue movement can last forever. Indicate this with a remaining time of maxint - ColorControl::Attributes::RemainingTime::Set(endpoint, MAX_INT16U_VALUE); + Attributes::RemainingTime::Set(endpoint, MAX_INT16U_VALUE); colorSaturationTransitionState->stepsRemaining = 0; // kick off the state machine: @@ -853,12 +856,12 @@ bool ColorControlServer::moveToHueCommand(uint16_t hue, uint8_t hueMoveMode, uin uint16_t currentHue = 0; if (isEnhanced) { - ColorControl::Attributes::EnhancedCurrentHue::Get(endpoint, ¤tHue); + Attributes::EnhancedCurrentHue::Get(endpoint, ¤tHue); } else { uint8_t current8bitHue = 0; - ColorControl::Attributes::CurrentHue::Get(endpoint, ¤t8bitHue); + Attributes::CurrentHue::Get(endpoint, ¤t8bitHue); currentHue = static_cast(current8bitHue); } @@ -928,15 +931,15 @@ bool ColorControlServer::moveToHueCommand(uint16_t hue, uint8_t hueMoveMode, uin if (isEnhanced) { - ColorControl::Attributes::EnhancedCurrentHue::Get(endpoint, &(colorHueTransitionState->initialEnhancedHue)); - ColorControl::Attributes::EnhancedCurrentHue::Get(endpoint, &(colorHueTransitionState->currentEnhancedHue)); + Attributes::EnhancedCurrentHue::Get(endpoint, &(colorHueTransitionState->initialEnhancedHue)); + Attributes::EnhancedCurrentHue::Get(endpoint, &(colorHueTransitionState->currentEnhancedHue)); colorHueTransitionState->finalEnhancedHue = hue; } else { - ColorControl::Attributes::CurrentHue::Get(endpoint, &(colorHueTransitionState->initialHue)); - ColorControl::Attributes::CurrentHue::Get(endpoint, &(colorHueTransitionState->currentHue)); + Attributes::CurrentHue::Get(endpoint, &(colorHueTransitionState->initialHue)); + Attributes::CurrentHue::Get(endpoint, &(colorHueTransitionState->currentHue)); colorHueTransitionState->finalHue = static_cast(hue); } @@ -948,7 +951,7 @@ bool ColorControlServer::moveToHueCommand(uint16_t hue, uint8_t hueMoveMode, uin colorHueTransitionState->repeat = false; colorSaturationTransitionState->stepsRemaining = 0; - ColorControl::Attributes::RemainingTime::Set(endpoint, transitionTime); + Attributes::RemainingTime::Set(endpoint, transitionTime); // kick off the state machine: emberEventControlSetDelayMS(configureHSVEventControl(endpoint), UPDATE_TIME_MS); @@ -980,12 +983,12 @@ bool ColorControlServer::moveToHueAndSaturationCommand(uint16_t hue, uint8_t sat uint16_t currentHue = 0; if (isEnhanced) { - ColorControl::Attributes::EnhancedCurrentHue::Get(endpoint, ¤tHue); + Attributes::EnhancedCurrentHue::Get(endpoint, ¤tHue); } else { uint8_t current8bitHue = 0; - ColorControl::Attributes::CurrentHue::Get(endpoint, ¤t8bitHue); + Attributes::CurrentHue::Get(endpoint, ¤t8bitHue); currentHue = static_cast(current8bitHue); } @@ -1060,7 +1063,7 @@ bool ColorControlServer::moveToHueAndSaturationCommand(uint16_t hue, uint8_t sat colorSaturationTransitionState->lowLimit = MIN_SATURATION_VALUE; colorSaturationTransitionState->highLimit = MAX_SATURATION_VALUE; - ColorControl::Attributes::RemainingTime::Set(endpoint, transitionTime); + Attributes::RemainingTime::Set(endpoint, transitionTime); // kick off the state machine: emberEventControlSetDelayMS(configureHSVEventControl(endpoint), UPDATE_TIME_MS); @@ -1118,7 +1121,7 @@ bool ColorControlServer::stepHueCommand(uint8_t stepMode, uint16_t stepSize, uin if (isEnhanced) { - ColorControl::Attributes::EnhancedCurrentHue::Get(endpoint, &(colorHueTransitionState->currentEnhancedHue)); + Attributes::EnhancedCurrentHue::Get(endpoint, &(colorHueTransitionState->currentEnhancedHue)); colorHueTransitionState->initialEnhancedHue = colorHueTransitionState->currentEnhancedHue; if (stepMode == MOVE_MODE_UP) @@ -1134,7 +1137,7 @@ bool ColorControlServer::stepHueCommand(uint8_t stepMode, uint16_t stepSize, uin } else { - ColorControl::Attributes::CurrentHue::Get(endpoint, &(colorHueTransitionState->currentHue)); + Attributes::CurrentHue::Get(endpoint, &(colorHueTransitionState->currentHue)); colorHueTransitionState->initialHue = colorHueTransitionState->currentHue; if (stepMode == MOVE_MODE_UP) @@ -1155,7 +1158,7 @@ bool ColorControlServer::stepHueCommand(uint8_t stepMode, uint16_t stepSize, uin colorHueTransitionState->repeat = false; colorSaturationTransitionState->stepsRemaining = 0; - ColorControl::Attributes::RemainingTime::Set(endpoint, transitionTime); + Attributes::RemainingTime::Set(endpoint, transitionTime); // kick off the state machine: emberEventControlSetDelayMS(configureHSVEventControl(endpoint), UPDATE_TIME_MS); @@ -1214,7 +1217,7 @@ bool ColorControlServer::moveSaturationCommand(uint8_t moveMode, uint8_t rate, u colorSaturationTransitionState->lowLimit = MIN_SATURATION_VALUE; colorSaturationTransitionState->highLimit = MAX_SATURATION_VALUE; - ColorControl::Attributes::RemainingTime::Set(endpoint, transitionTime); + Attributes::RemainingTime::Set(endpoint, transitionTime); // kick off the state machine: emberEventControlSetDelayMS(configureHSVEventControl(endpoint), UPDATE_TIME_MS); @@ -1279,7 +1282,7 @@ bool ColorControlServer::moveToSaturationCommand(uint8_t saturation, uint16_t tr colorSaturationTransitionState->lowLimit = MIN_SATURATION_VALUE; colorSaturationTransitionState->highLimit = MAX_SATURATION_VALUE; - ColorControl::Attributes::RemainingTime::Set(endpoint, transitionTime); + Attributes::RemainingTime::Set(endpoint, transitionTime); // kick off the state machine: emberEventControlSetDelayMS(configureHSVEventControl(endpoint), UPDATE_TIME_MS); @@ -1342,7 +1345,7 @@ bool ColorControlServer::stepSaturationCommand(uint8_t stepMode, uint8_t stepSiz colorSaturationTransitionState->lowLimit = MIN_SATURATION_VALUE; colorSaturationTransitionState->highLimit = MAX_SATURATION_VALUE; - ColorControl::Attributes::RemainingTime::Set(endpoint, transitionTime); + Attributes::RemainingTime::Set(endpoint, transitionTime); // kick off the state machine: emberEventControlSetDelayMS(configureHSVEventControl(endpoint), UPDATE_TIME_MS); @@ -1364,14 +1367,14 @@ bool ColorControlServer::colorLoopCommand(uint8_t updateFlags, uint8_t action, u } uint8_t isColorLoopActive = 0; - ColorControl::Attributes::ColorLoopActive::Get(endpoint, &isColorLoopActive); + Attributes::ColorLoopActive::Get(endpoint, &isColorLoopActive); uint8_t deactiveColorLoop = (updateFlags & EMBER_AF_COLOR_LOOP_UPDATE_FLAGS_UPDATE_ACTION) && (action == EMBER_ZCL_COLOR_LOOP_ACTION_DEACTIVATE); if (updateFlags & EMBER_AF_COLOR_LOOP_UPDATE_FLAGS_UPDATE_DIRECTION) { - ColorControl::Attributes::ColorLoopDirection::Set(endpoint, direction); + Attributes::ColorLoopDirection::Set(endpoint, direction); // Checks if color loop is active and stays active if (isColorLoopActive && !deactiveColorLoop) @@ -1393,7 +1396,7 @@ bool ColorControlServer::colorLoopCommand(uint8_t updateFlags, uint8_t action, u if (updateFlags & EMBER_AF_COLOR_LOOP_UPDATE_FLAGS_UPDATE_TIME) { - ColorControl::Attributes::ColorLoopTime::Set(endpoint, time); + Attributes::ColorLoopTime::Set(endpoint, time); // Checks if color loop is active and stays active if (isColorLoopActive && !deactiveColorLoop) @@ -1415,7 +1418,7 @@ bool ColorControlServer::colorLoopCommand(uint8_t updateFlags, uint8_t action, u if (updateFlags & EMBER_AF_COLOR_LOOP_UPDATE_FLAGS_UPDATE_START_HUE) { - ColorControl::Attributes::ColorLoopStartEnhancedHue::Set(endpoint, startHue); + Attributes::ColorLoopStartEnhancedHue::Set(endpoint, startHue); } if (updateFlags & EMBER_AF_COLOR_LOOP_UPDATE_FLAGS_UPDATE_ACTION) @@ -1426,11 +1429,11 @@ bool ColorControlServer::colorLoopCommand(uint8_t updateFlags, uint8_t action, u { stopAllColorTransitions(endpoint); - ColorControl::Attributes::ColorLoopActive::Set(endpoint, false); + Attributes::ColorLoopActive::Set(endpoint, false); uint16_t storedEnhancedHue = 0; - ColorControl::Attributes::ColorLoopStoredEnhancedHue::Get(endpoint, &storedEnhancedHue); - ColorControl::Attributes::EnhancedCurrentHue::Set(endpoint, storedEnhancedHue); + Attributes::ColorLoopStoredEnhancedHue::Get(endpoint, &storedEnhancedHue); + Attributes::EnhancedCurrentHue::Set(endpoint, storedEnhancedHue); } else { @@ -1482,16 +1485,16 @@ void ColorControlServer::updateHueSatCommand(EndpointId endpoint) if (colorHueTransitionState->isEnhancedHue) { - ColorControl::Attributes::EnhancedCurrentHue::Set(endpoint, colorHueTransitionState->currentEnhancedHue); - ColorControl::Attributes::CurrentHue::Set(endpoint, static_cast(colorHueTransitionState->currentEnhancedHue >> 8)); + Attributes::EnhancedCurrentHue::Set(endpoint, colorHueTransitionState->currentEnhancedHue); + Attributes::CurrentHue::Set(endpoint, static_cast(colorHueTransitionState->currentEnhancedHue >> 8)); } else { - ColorControl::Attributes::CurrentHue::Set(colorHueTransitionState->endpoint, colorHueTransitionState->currentHue); + Attributes::CurrentHue::Set(colorHueTransitionState->endpoint, colorHueTransitionState->currentHue); } - ColorControl::Attributes::CurrentSaturation::Set(colorSaturationTransitionState->endpoint, - (uint8_t) colorSaturationTransitionState->currentValue); + Attributes::CurrentSaturation::Set(colorSaturationTransitionState->endpoint, + (uint8_t) colorSaturationTransitionState->currentValue); if (colorHueTransitionState->isEnhancedHue) { emberAfColorControlClusterPrintln("Enhanced Hue %d Saturation %d endpoint %d", colorHueTransitionState->currentEnhancedHue, @@ -1596,8 +1599,8 @@ bool ColorControlServer::moveToColorCommand(uint16_t colorX, uint16_t colorY, ui handleModeSwitch(endpoint, COLOR_MODE_CIE_XY); // now, kick off the state machine. - ColorControl::Attributes::CurrentX::Get(endpoint, &(colorXTransitionState->initialValue)); - ColorControl::Attributes::CurrentX::Get(endpoint, &(colorXTransitionState->currentValue)); + Attributes::CurrentX::Get(endpoint, &(colorXTransitionState->initialValue)); + Attributes::CurrentX::Get(endpoint, &(colorXTransitionState->currentValue)); colorXTransitionState->finalValue = colorX; colorXTransitionState->stepsRemaining = transitionTime; colorXTransitionState->stepsTotal = transitionTime; @@ -1605,8 +1608,8 @@ bool ColorControlServer::moveToColorCommand(uint16_t colorX, uint16_t colorY, ui colorXTransitionState->lowLimit = MIN_CIE_XY_VALUE; colorXTransitionState->highLimit = MAX_CIE_XY_VALUE; - ColorControl::Attributes::CurrentY::Get(endpoint, &(colorYTransitionState->initialValue)); - ColorControl::Attributes::CurrentY::Get(endpoint, &(colorYTransitionState->currentValue)); + Attributes::CurrentY::Get(endpoint, &(colorYTransitionState->initialValue)); + Attributes::CurrentY::Get(endpoint, &(colorYTransitionState->currentValue)); colorYTransitionState->finalValue = colorY; colorYTransitionState->stepsRemaining = transitionTime; colorYTransitionState->stepsTotal = transitionTime; @@ -1614,7 +1617,7 @@ bool ColorControlServer::moveToColorCommand(uint16_t colorX, uint16_t colorY, ui colorYTransitionState->lowLimit = MIN_CIE_XY_VALUE; colorYTransitionState->highLimit = MAX_CIE_XY_VALUE; - ColorControl::Attributes::RemainingTime::Set(endpoint, transitionTime); + Attributes::RemainingTime::Set(endpoint, transitionTime); // kick off the state machine: emberEventControlSetDelayMS(configureXYEventControl(endpoint), UPDATE_TIME_MS); @@ -1651,7 +1654,7 @@ bool ColorControlServer::moveColorCommand(int16_t rateX, int16_t rateY, uint8_t handleModeSwitch(endpoint, COLOR_MODE_CIE_XY); // now, kick off the state machine. - ColorControl::Attributes::CurrentX::Get(endpoint, &(colorXTransitionState->initialValue)); + Attributes::CurrentX::Get(endpoint, &(colorXTransitionState->initialValue)); colorXTransitionState->currentValue = colorXTransitionState->initialValue; if (rateX > 0) { @@ -1670,7 +1673,7 @@ bool ColorControlServer::moveColorCommand(int16_t rateX, int16_t rateY, uint8_t colorXTransitionState->lowLimit = MIN_CIE_XY_VALUE; colorXTransitionState->highLimit = MAX_CIE_XY_VALUE; - ColorControl::Attributes::CurrentY::Get(endpoint, &(colorYTransitionState->initialValue)); + Attributes::CurrentY::Get(endpoint, &(colorYTransitionState->initialValue)); colorYTransitionState->currentValue = colorYTransitionState->initialValue; if (rateY > 0) { @@ -1691,11 +1694,11 @@ bool ColorControlServer::moveColorCommand(int16_t rateX, int16_t rateY, uint8_t if (transitionTimeX < transitionTimeY) { - ColorControl::Attributes::RemainingTime::Set(endpoint, transitionTimeX); + Attributes::RemainingTime::Set(endpoint, transitionTimeX); } else { - ColorControl::Attributes::RemainingTime::Set(endpoint, transitionTimeY); + Attributes::RemainingTime::Set(endpoint, transitionTimeY); } // kick off the state machine: @@ -1719,10 +1722,10 @@ bool ColorControlServer::stepColorCommand(int16_t stepX, int16_t stepY, uint16_t } uint16_t currentColorX = 0; - ColorControl::Attributes::CurrentX::Get(endpoint, ¤tColorX); + Attributes::CurrentX::Get(endpoint, ¤tColorX); uint16_t currentColorY = 0; - ColorControl::Attributes::CurrentY::Get(endpoint, ¤tColorY); + Attributes::CurrentY::Get(endpoint, ¤tColorY); uint16_t colorX = findNewColorValueFromStep(currentColorX, stepX); uint16_t colorY = findNewColorValueFromStep(currentColorY, stepY); @@ -1757,7 +1760,7 @@ bool ColorControlServer::stepColorCommand(int16_t stepX, int16_t stepY, uint16_t colorYTransitionState->lowLimit = MIN_CIE_XY_VALUE; colorYTransitionState->highLimit = MAX_CIE_XY_VALUE; - ColorControl::Attributes::RemainingTime::Set(endpoint, transitionTime); + Attributes::RemainingTime::Set(endpoint, transitionTime); // kick off the state machine: emberEventControlSetDelayMS(configureXYEventControl(endpoint), UPDATE_TIME_MS); @@ -1792,8 +1795,8 @@ void ColorControlServer::updateXYCommand(EndpointId endpoint) } // update the attributes - ColorControl::Attributes::CurrentX::Set(endpoint, colorXTransitionState->currentValue); - ColorControl::Attributes::CurrentY::Set(endpoint, colorYTransitionState->currentValue); + Attributes::CurrentX::Set(endpoint, colorXTransitionState->currentValue); + Attributes::CurrentY::Set(endpoint, colorYTransitionState->currentValue); emberAfColorControlClusterPrintln("Color X %d Color Y %d", colorXTransitionState->currentValue, colorYTransitionState->currentValue); @@ -1829,10 +1832,10 @@ void ColorControlServer::moveToColorTemp(EndpointId aEndpoint, uint16_t colorTem Color16uTransitionState * colorTempTransitionState = getTempTransitionState(endpoint); uint16_t temperatureMin = MIN_TEMPERATURE_VALUE; - ColorControl::Attributes::ColorTempPhysicalMin::Get(endpoint, &temperatureMin); + Attributes::ColorTempPhysicalMin::Get(endpoint, &temperatureMin); uint16_t temperatureMax = MAX_TEMPERATURE_VALUE; - ColorControl::Attributes::ColorTempPhysicalMax::Get(endpoint, &temperatureMax); + Attributes::ColorTempPhysicalMax::Get(endpoint, &temperatureMax); if (transitionTime == 0) { @@ -1856,8 +1859,8 @@ void ColorControlServer::moveToColorTemp(EndpointId aEndpoint, uint16_t colorTem } // now, kick off the state machine. - ColorControl::Attributes::ColorTemperature::Get(endpoint, &(colorTempTransitionState->initialValue)); - ColorControl::Attributes::ColorTemperature::Get(endpoint, &(colorTempTransitionState->currentValue)); + Attributes::ColorTemperature::Get(endpoint, &(colorTempTransitionState->initialValue)); + Attributes::ColorTemperature::Get(endpoint, &(colorTempTransitionState->currentValue)); colorTempTransitionState->finalValue = colorTemperature; colorTempTransitionState->stepsRemaining = transitionTime; @@ -1881,12 +1884,12 @@ uint16_t ColorControlServer::getTemperatureCoupleToLevelMin(EndpointId endpoint) uint16_t colorTemperatureCoupleToLevelMin; EmberAfStatus status; - status = ColorControl::Attributes::CoupleColorTempToLevelMinMireds::Get(endpoint, &colorTemperatureCoupleToLevelMin); + status = Attributes::CoupleColorTempToLevelMinMireds::Get(endpoint, &colorTemperatureCoupleToLevelMin); if (status != EMBER_ZCL_STATUS_SUCCESS) { // Not less than the physical min. - ColorControl::Attributes::ColorTempPhysicalMin::Get(endpoint, &colorTemperatureCoupleToLevelMin); + Attributes::ColorTempPhysicalMin::Get(endpoint, &colorTemperatureCoupleToLevelMin); } return colorTemperatureCoupleToLevelMin; @@ -1921,20 +1924,20 @@ void ColorControlServer::startUpColorTempCommand(EndpointId endpoint) // Initialize startUpColorTempMireds to "maintain previous value" value 0xFFFF uint16_t startUpColorTemp = 0xFFFF; - EmberAfStatus status = ColorControl::Attributes::StartUpColorTemperatureMireds::Get(endpoint, &startUpColorTemp); + EmberAfStatus status = Attributes::StartUpColorTemperatureMireds::Get(endpoint, &startUpColorTemp); if (status == EMBER_ZCL_STATUS_SUCCESS) { uint16_t updatedColorTemp = MAX_TEMPERATURE_VALUE; - status = ColorControl::Attributes::ColorTemperature::Get(endpoint, &updatedColorTemp); + status = Attributes::ColorTemperature::Get(endpoint, &updatedColorTemp); if (status == EMBER_ZCL_STATUS_SUCCESS) { uint16_t tempPhysicalMin = MIN_TEMPERATURE_VALUE; - ColorControl::Attributes::ColorTempPhysicalMin::Get(endpoint, &tempPhysicalMin); + Attributes::ColorTempPhysicalMin::Get(endpoint, &tempPhysicalMin); uint16_t tempPhysicalMax = MAX_TEMPERATURE_VALUE; - ColorControl::Attributes::ColorTempPhysicalMax::Get(endpoint, &tempPhysicalMax); + Attributes::ColorTempPhysicalMax::Get(endpoint, &tempPhysicalMax); if (tempPhysicalMin <= startUpColorTemp && startUpColorTemp <= tempPhysicalMax) { @@ -1943,16 +1946,16 @@ void ColorControlServer::startUpColorTempCommand(EndpointId endpoint) // existing setting of ColorTemp attribute will be left unchanged (i.e., treated as // if startup color temp was set to 0xFFFF). updatedColorTemp = startUpColorTemp; - status = ColorControl::Attributes::ColorTemperature::Set(endpoint, updatedColorTemp); + status = Attributes::ColorTemperature::Set(endpoint, updatedColorTemp); if (status == EMBER_ZCL_STATUS_SUCCESS) { // Set ColorMode attributes to reflect ColorTemperature. uint8_t updateColorMode = EMBER_ZCL_COLOR_MODE_COLOR_TEMPERATURE; - ColorControl::Attributes::ColorMode::Set(endpoint, updateColorMode); + Attributes::ColorMode::Set(endpoint, updateColorMode); updateColorMode = EMBER_ZCL_ENHANCED_COLOR_MODE_COLOR_TEMPERATURE; - ColorControl::Attributes::EnhancedColorMode::Set(endpoint, updateColorMode); + Attributes::EnhancedColorMode::Set(endpoint, updateColorMode); } } } @@ -1980,7 +1983,7 @@ void ColorControlServer::updateTempCommand(EndpointId endpoint) emberEventControlSetDelayMS(configureTempEventControl(endpoint), UPDATE_TIME_MS); } - ColorControl::Attributes::ColorTemperature::Set(endpoint, colorTempTransitionState->currentValue); + Attributes::ColorTemperature::Set(endpoint, colorTempTransitionState->currentValue); emberAfColorControlClusterPrintln("Color Temperature %d", colorTempTransitionState->currentValue); @@ -2012,10 +2015,10 @@ bool ColorControlServer::moveColorTempCommand(uint8_t moveMode, uint16_t rate, u } uint16_t tempPhysicalMin = MIN_TEMPERATURE_VALUE; - ColorControl::Attributes::ColorTempPhysicalMin::Get(endpoint, &tempPhysicalMin); + Attributes::ColorTempPhysicalMin::Get(endpoint, &tempPhysicalMin); uint16_t tempPhysicalMax = MAX_TEMPERATURE_VALUE; - ColorControl::Attributes::ColorTempPhysicalMax::Get(endpoint, &tempPhysicalMax); + Attributes::ColorTempPhysicalMax::Get(endpoint, &tempPhysicalMax); uint16_t transitionTime; @@ -2048,7 +2051,7 @@ bool ColorControlServer::moveColorTempCommand(uint8_t moveMode, uint16_t rate, u // now, kick off the state machine. colorTempTransitionState->initialValue = 0; - ColorControl::Attributes::ColorTemperature::Get(endpoint, &colorTempTransitionState->initialValue); + Attributes::ColorTemperature::Get(endpoint, &colorTempTransitionState->initialValue); colorTempTransitionState->currentValue = colorTempTransitionState->initialValue; if (moveMode == MOVE_MODE_UP) @@ -2080,7 +2083,7 @@ bool ColorControlServer::moveColorTempCommand(uint8_t moveMode, uint16_t rate, u colorTempTransitionState->lowLimit = colorTemperatureMinimum; colorTempTransitionState->highLimit = colorTemperatureMaximum; - ColorControl::Attributes::RemainingTime::Set(endpoint, transitionTime); + Attributes::RemainingTime::Set(endpoint, transitionTime); // kick off the state machine: emberEventControlSetDelayMS(configureTempEventControl(endpoint), UPDATE_TIME_MS); @@ -2120,10 +2123,10 @@ bool ColorControlServer::stepColorTempCommand(uint8_t stepMode, uint16_t stepSiz } uint16_t tempPhysicalMin = MIN_TEMPERATURE_VALUE; - ColorControl::Attributes::ColorTempPhysicalMin::Get(endpoint, &tempPhysicalMin); + Attributes::ColorTempPhysicalMin::Get(endpoint, &tempPhysicalMin); uint16_t tempPhysicalMax = MAX_TEMPERATURE_VALUE; - ColorControl::Attributes::ColorTempPhysicalMax::Get(endpoint, &tempPhysicalMax); + Attributes::ColorTempPhysicalMax::Get(endpoint, &tempPhysicalMax); if (transitionTime == 0) { @@ -2153,7 +2156,7 @@ bool ColorControlServer::stepColorTempCommand(uint8_t stepMode, uint16_t stepSiz // now, kick off the state machine. colorTempTransitionState->initialValue = 0; - ColorControl::Attributes::ColorTemperature::Get(endpoint, &colorTempTransitionState->initialValue); + Attributes::ColorTemperature::Get(endpoint, &colorTempTransitionState->initialValue); colorTempTransitionState->currentValue = colorTempTransitionState->initialValue; if (stepMode == MOVE_MODE_UP) @@ -2186,7 +2189,7 @@ bool ColorControlServer::stepColorTempCommand(uint8_t stepMode, uint16_t stepSiz colorTempTransitionState->lowLimit = colorTemperatureMinimum; colorTempTransitionState->highLimit = colorTemperatureMaximum; - ColorControl::Attributes::RemainingTime::Set(endpoint, transitionTime); + Attributes::RemainingTime::Set(endpoint, transitionTime); // kick off the state machine: emberEventControlSetDelayMS(configureTempEventControl(endpoint), UPDATE_TIME_MS); @@ -2234,7 +2237,7 @@ void ColorControlServer::levelControlColorTempChangeCommand(EndpointId endpoint) } uint8_t colorMode = 0; - ColorControl::Attributes::ColorMode::Get(endpoint, &colorMode); + Attributes::ColorMode::Get(endpoint, &colorMode); if (colorMode == COLOR_MODE_TEMPERATURE) { @@ -2244,7 +2247,7 @@ void ColorControlServer::levelControlColorTempChangeCommand(EndpointId endpoint) LevelControl::Attributes::CurrentLevel::Get(endpoint, ¤tLevel); uint16_t tempPhysMax = MAX_TEMPERATURE_VALUE; - ColorControl::Attributes::ColorTempPhysicalMax::Get(endpoint, &tempPhysMax); + Attributes::ColorTempPhysicalMax::Get(endpoint, &tempPhysMax); // Scale color temp setting between the coupling min and the physical max. // Note that mireds varies inversely with level: low level -> high mireds. @@ -2284,89 +2287,109 @@ void emberAfPluginColorControlServerStopTransition(void) #ifdef EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_HSV -bool emberAfColorControlClusterMoveHueCallback(EndpointId endpoint, app::CommandHandler * commandObj, uint8_t moveMode, - uint8_t rate, uint8_t optionsMask, uint8_t optionsOverride) +bool emberAfColorControlClusterMoveHueCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint8_t moveMode, uint8_t rate, uint8_t optionsMask, + uint8_t optionsOverride, Commands::MoveHue::DecodableType & commandData) { return ColorControlServer::Instance().moveHueCommand(moveMode, static_cast(rate), optionsMask, optionsOverride, false); } -bool emberAfColorControlClusterMoveSaturationCallback(EndpointId aEndpoint, app::CommandHandler * commandObj, uint8_t moveMode, - uint8_t rate, uint8_t optionsMask, uint8_t optionsOverride) +bool emberAfColorControlClusterMoveSaturationCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId aEndpoint, + uint8_t moveMode, uint8_t rate, uint8_t optionsMask, uint8_t optionsOverride, + Commands::MoveSaturation::DecodableType & commandData) { return ColorControlServer::Instance().moveSaturationCommand(moveMode, rate, optionsMask, optionsOverride); } -bool emberAfColorControlClusterMoveToHueCallback(EndpointId endpoint, app::CommandHandler * commandObj, uint8_t hue, - uint8_t hueMoveMode, uint16_t transitionTime, uint8_t optionsMask, - uint8_t optionsOverride) +bool emberAfColorControlClusterMoveToHueCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint8_t hue, uint8_t hueMoveMode, uint16_t transitionTime, + uint8_t optionsMask, uint8_t optionsOverride, + Commands::MoveToHue::DecodableType & commandData) { return ColorControlServer::Instance().moveToHueCommand(static_cast(hue), hueMoveMode, transitionTime, optionsMask, optionsOverride, false); } -bool emberAfColorControlClusterMoveToSaturationCallback(EndpointId aEndpoint, app::CommandHandler * commandObj, uint8_t saturation, - uint16_t transitionTime, uint8_t optionsMask, uint8_t optionsOverride) +bool emberAfColorControlClusterMoveToSaturationCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId aEndpoint, + uint8_t saturation, uint16_t transitionTime, uint8_t optionsMask, + uint8_t optionsOverride, + Commands::MoveToSaturation::DecodableType & commandData) { return ColorControlServer::Instance().moveToSaturationCommand(saturation, transitionTime, optionsMask, optionsOverride); } -bool emberAfColorControlClusterMoveToHueAndSaturationCallback(EndpointId endpoint, app::CommandHandler * commandObj, uint8_t hue, - uint8_t saturation, uint16_t transitionTime, uint8_t optionsMask, - uint8_t optionsOverride) +bool emberAfColorControlClusterMoveToHueAndSaturationCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + uint8_t hue, uint8_t saturation, uint16_t transitionTime, + uint8_t optionsMask, uint8_t optionsOverride, + Commands::MoveToHueAndSaturation::DecodableType & commandData) { return ColorControlServer::Instance().moveToHueAndSaturationCommand(static_cast(hue), saturation, transitionTime, optionsMask, optionsOverride, false); } -bool emberAfColorControlClusterStepHueCallback(EndpointId endpoint, app::CommandHandler * commandObj, uint8_t stepMode, - uint8_t stepSize, uint8_t transitionTime, uint8_t optionsMask, - uint8_t optionsOverride) +bool emberAfColorControlClusterStepHueCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint8_t stepMode, uint8_t stepSize, uint8_t transitionTime, + uint8_t optionsMask, uint8_t optionsOverride, + Commands::StepHue::DecodableType & commandData) { return ColorControlServer::Instance().stepHueCommand( stepMode, static_cast(stepSize), static_cast(transitionTime), optionsMask, optionsOverride, false); } -bool emberAfColorControlClusterStepSaturationCallback(EndpointId aEndpoint, app::CommandHandler * commandObj, uint8_t stepMode, - uint8_t stepSize, uint8_t transitionTime, uint8_t optionsMask, - uint8_t optionsOverride) +bool emberAfColorControlClusterStepSaturationCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId aEndpoint, + uint8_t stepMode, uint8_t stepSize, uint8_t transitionTime, + uint8_t optionsMask, uint8_t optionsOverride, + Commands::StepSaturation::DecodableType & commandData) { return ColorControlServer::Instance().stepSaturationCommand(stepMode, stepSize, transitionTime, optionsMask, optionsOverride); } -bool emberAfColorControlClusterEnhancedMoveHueCallback(EndpointId endpoint, app::CommandHandler * commandObj, uint8_t moveMode, - uint16_t rate, uint8_t optionsMask, uint8_t optionsOverride) +bool emberAfColorControlClusterEnhancedMoveHueCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + uint8_t moveMode, uint16_t rate, uint8_t optionsMask, + uint8_t optionsOverride, + Commands::EnhancedMoveHue::DecodableType & commandData) { return ColorControlServer::Instance().moveHueCommand(moveMode, rate, optionsMask, optionsOverride, true); } -bool emberAfColorControlClusterEnhancedMoveToHueCallback(EndpointId endpoint, app::CommandHandler * commandObj, +bool emberAfColorControlClusterEnhancedMoveToHueCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, uint16_t enhancedHue, uint8_t direction, uint16_t transitionTime, - uint8_t optionsMask, uint8_t optionsOverride) + uint8_t optionsMask, uint8_t optionsOverride, + Commands::EnhancedMoveToHue::DecodableType & commandData) { return ColorControlServer::Instance().moveToHueCommand(enhancedHue, direction, transitionTime, optionsMask, optionsOverride, true); } -bool emberAfColorControlClusterEnhancedMoveToHueAndSaturationCallback(EndpointId endpoint, app::CommandHandler * commandObj, - uint16_t enhancedHue, uint8_t saturation, - uint16_t transitionTime, uint8_t optionsMask, - uint8_t optionsOverride) +bool emberAfColorControlClusterEnhancedMoveToHueAndSaturationCallback( + app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, EndpointId endpoint, uint16_t enhancedHue, + uint8_t saturation, uint16_t transitionTime, uint8_t optionsMask, uint8_t optionsOverride, + Commands::EnhancedMoveToHueAndSaturation::DecodableType & commandData) { return ColorControlServer::Instance().moveToHueAndSaturationCommand(enhancedHue, saturation, transitionTime, optionsMask, optionsOverride, true); } -bool emberAfColorControlClusterEnhancedStepHueCallback(EndpointId endpoint, app::CommandHandler * commandObj, uint8_t stepMode, - uint16_t stepSize, uint16_t transitionTime, uint8_t optionsMask, - uint8_t optionsOverride) +bool emberAfColorControlClusterEnhancedStepHueCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + uint8_t stepMode, uint16_t stepSize, uint16_t transitionTime, + uint8_t optionsMask, uint8_t optionsOverride, + Commands::EnhancedStepHue::DecodableType & commandData) { return ColorControlServer::Instance().stepHueCommand(stepMode, stepSize, transitionTime, optionsMask, optionsOverride, true); } -bool emberAfColorControlClusterColorLoopSetCallback(EndpointId aEndpoint, app::CommandHandler * commandObj, uint8_t updateFlags, - uint8_t action, uint8_t direction, uint16_t time, uint16_t startHue, - uint8_t optionsMask, uint8_t optionsOverride) +bool emberAfColorControlClusterColorLoopSetCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId aEndpoint, uint8_t updateFlags, uint8_t action, uint8_t direction, + uint16_t time, uint16_t startHue, uint8_t optionsMask, uint8_t optionsOverride, + Commands::ColorLoopSet::DecodableType & commandData) { return ColorControlServer::Instance().colorLoopCommand(updateFlags, action, direction, time, startHue, optionsMask, optionsOverride); @@ -2376,22 +2399,25 @@ bool emberAfColorControlClusterColorLoopSetCallback(EndpointId aEndpoint, app::C #ifdef EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_XY -bool emberAfColorControlClusterMoveToColorCallback(EndpointId aEndpoint, app::CommandHandler * commandObj, uint16_t colorX, - uint16_t colorY, uint16_t transitionTime, uint8_t optionsMask, - uint8_t optionsOverride) +bool emberAfColorControlClusterMoveToColorCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId aEndpoint, uint16_t colorX, uint16_t colorY, uint16_t transitionTime, + uint8_t optionsMask, uint8_t optionsOverride, + Commands::MoveToColor::DecodableType & commandData) { return ColorControlServer::Instance().moveToColorCommand(colorX, colorY, transitionTime, optionsMask, optionsOverride); } -bool emberAfColorControlClusterMoveColorCallback(EndpointId aEndpoint, app::CommandHandler * commandObj, int16_t rateX, - int16_t rateY, uint8_t optionsMask, uint8_t optionsOverride) +bool emberAfColorControlClusterMoveColorCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId aEndpoint, int16_t rateX, int16_t rateY, uint8_t optionsMask, + uint8_t optionsOverride, Commands::MoveColor::DecodableType & commandData) { return ColorControlServer::Instance().moveColorCommand(rateX, rateY, optionsMask, optionsOverride); } -bool emberAfColorControlClusterStepColorCallback(EndpointId aEndpoint, app::CommandHandler * commandObj, int16_t stepX, - int16_t stepY, uint16_t transitionTime, uint8_t optionsMask, - uint8_t optionsOverride) +bool emberAfColorControlClusterStepColorCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId aEndpoint, int16_t stepX, int16_t stepY, uint16_t transitionTime, + uint8_t optionsMask, uint8_t optionsOverride, + Commands::StepColor::DecodableType & commandData) { return ColorControlServer::Instance().stepColorCommand(stepX, stepY, transitionTime, optionsMask, optionsOverride); } @@ -2400,26 +2426,32 @@ bool emberAfColorControlClusterStepColorCallback(EndpointId aEndpoint, app::Comm #ifdef EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_TEMP -bool emberAfColorControlClusterMoveToColorTemperatureCallback(EndpointId aEndpoint, app::CommandHandler * commandObj, +bool emberAfColorControlClusterMoveToColorTemperatureCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId aEndpoint, uint16_t colorTemperature, uint16_t transitionTime, - uint8_t optionsMask, uint8_t optionsOverride) + uint8_t optionsMask, uint8_t optionsOverride, + Commands::MoveToColorTemperature::DecodableType & commandData) { return ColorControlServer::Instance().moveToColorTempCommand(colorTemperature, transitionTime, optionsMask, optionsOverride); } -bool emberAfColorControlClusterMoveColorTemperatureCallback(EndpointId aEndpoint, app::CommandHandler * commandObj, +bool emberAfColorControlClusterMoveColorTemperatureCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId aEndpoint, uint8_t moveMode, uint16_t rate, uint16_t colorTemperatureMinimum, uint16_t colorTemperatureMaximum, uint8_t optionsMask, - uint8_t optionsOverride) + uint8_t optionsOverride, + Commands::MoveColorTemperature::DecodableType & commandData) { return ColorControlServer::Instance().moveColorTempCommand(moveMode, rate, colorTemperatureMinimum, colorTemperatureMaximum, optionsMask, optionsOverride); } -bool emberAfColorControlClusterStepColorTemperatureCallback(EndpointId aEndpoint, app::CommandHandler * commandObj, +bool emberAfColorControlClusterStepColorTemperatureCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId aEndpoint, uint8_t stepMode, uint16_t stepSize, uint16_t transitionTime, uint16_t colorTemperatureMinimum, uint16_t colorTemperatureMaximum, - uint8_t optionsMask, uint8_t optionsOverride) + uint8_t optionsMask, uint8_t optionsOverride, + Commands::StepColorTemperature::DecodableType & commandData) { return ColorControlServer::Instance().stepColorTempCommand(stepMode, stepSize, transitionTime, colorTemperatureMinimum, colorTemperatureMaximum, optionsMask, optionsOverride); @@ -2432,8 +2464,9 @@ void emberAfPluginLevelControlCoupledColorTempChangeCallback(EndpointId endpoint #endif // EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_TEMP -bool emberAfColorControlClusterStopMoveStepCallback(EndpointId aEndpoint, app::CommandHandler * commandObj, uint8_t optionsMask, - uint8_t optionsOverride) +bool emberAfColorControlClusterStopMoveStepCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId aEndpoint, uint8_t optionsMask, uint8_t optionsOverride, + Commands::StopMoveStep::DecodableType & commandData) { return ColorControlServer::Instance().stopMoveStepCommand(optionsMask, optionsOverride); } diff --git a/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.cpp b/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.cpp index 5a4ff7ad2383af..c7c33b7954313f 100644 --- a/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.cpp +++ b/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.cpp @@ -15,13 +15,19 @@ * limitations under the License. */ +#include #include +#include #include using namespace chip; +using namespace chip::app::Clusters::DiagnosticLogs; -bool emberAfDiagnosticLogsClusterRetrieveLogsRequestCallback(EndpointId endpoint, app::CommandHandler * commandObj, uint8_t intent, - uint8_t requestedProtocol, ByteSpan transferFileDesignator) +bool emberAfDiagnosticLogsClusterRetrieveLogsRequestCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + uint8_t intent, uint8_t requestedProtocol, + ByteSpan transferFileDesignator, + Commands::RetrieveLogsRequest::DecodableType & commandData) { EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; emberAfSendImmediateDefaultResponse(status); diff --git a/src/app/clusters/door-lock-server/door-lock-server-logging.cpp b/src/app/clusters/door-lock-server/door-lock-server-logging.cpp index 0c9e1fe5de06da..c428655f14265c 100644 --- a/src/app/clusters/door-lock-server/door-lock-server-logging.cpp +++ b/src/app/clusters/door-lock-server/door-lock-server-logging.cpp @@ -42,14 +42,17 @@ #include #include #include +#include #include #include #include #include +#include #include using namespace chip; +using namespace chip::app::Clusters::DoorLock; static EmberAfPluginDoorLockServerLogEntry entries[EMBER_AF_PLUGIN_DOOR_LOCK_SERVER_MAX_LOG_ENTRIES]; static uint8_t nextEntryId = 1; @@ -117,7 +120,9 @@ bool emberAfPluginDoorLockServerGetLogEntry(uint16_t * entryId, EmberAfPluginDoo return true; } -bool emberAfDoorLockClusterGetLogRecordCallback(EndpointId endpoint, app::CommandHandler * commandObj, uint16_t entryId) +bool emberAfDoorLockClusterGetLogRecordCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint16_t entryId, + Commands::GetLogRecord::DecodableType & commandData) { EmberStatus status; EmberAfPluginDoorLockServerLogEntry entry; diff --git a/src/app/clusters/door-lock-server/door-lock-server-schedule.cpp b/src/app/clusters/door-lock-server/door-lock-server-schedule.cpp index a1839748b8a41e..172b3651f95a1e 100644 --- a/src/app/clusters/door-lock-server/door-lock-server-schedule.cpp +++ b/src/app/clusters/door-lock-server/door-lock-server-schedule.cpp @@ -40,13 +40,16 @@ #include "door-lock-server.h" #include #include +#include #include #include #include +#include #include using namespace chip; +using namespace chip::app::Clusters::DoorLock; static EmberAfPluginDoorLockServerWeekdayScheduleEntry weekdayScheduleTable[EMBER_AF_PLUGIN_DOOR_LOCK_SERVER_WEEKDAY_SCHEDULE_TABLE_SIZE]; @@ -120,9 +123,11 @@ void emAfPluginDoorLockServerInitSchedule(void) #endif } -bool emberAfDoorLockClusterSetWeekdayScheduleCallback(EndpointId endpoint, app::CommandHandler * commandObj, uint8_t scheduleId, - uint16_t userId, uint8_t daysMask, uint8_t startHour, uint8_t startMinute, - uint8_t stopHour, uint8_t stopMinute) +bool emberAfDoorLockClusterSetWeekdayScheduleCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + uint8_t scheduleId, uint16_t userId, uint8_t daysMask, uint8_t startHour, + uint8_t startMinute, uint8_t stopHour, uint8_t stopMinute, + Commands::SetWeekdaySchedule::DecodableType & commandData) { uint8_t status = 0x00; uint8_t userPin = 0x00; @@ -178,8 +183,10 @@ bool emberAfDoorLockClusterSetWeekdayScheduleCallback(EndpointId endpoint, app:: return true; } -bool emberAfDoorLockClusterGetWeekdayScheduleCallback(EndpointId endpoint, app::CommandHandler * commandObj, uint8_t scheduleId, - uint16_t userId) +bool emberAfDoorLockClusterGetWeekdayScheduleCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + uint8_t scheduleId, uint16_t userId, + Commands::GetWeekdaySchedule::DecodableType & commandData) { EmberAfStatus zclStatus = ((scheduleId > EMBER_AF_PLUGIN_DOOR_LOCK_SERVER_WEEKDAY_SCHEDULE_TABLE_SIZE) ? EMBER_ZCL_STATUS_INVALID_FIELD @@ -218,8 +225,10 @@ bool emberAfDoorLockClusterGetWeekdayScheduleCallback(EndpointId endpoint, app:: return true; } -bool emberAfDoorLockClusterClearWeekdayScheduleCallback(EndpointId endpoint, app::CommandHandler * commandObj, uint8_t scheduleId, - uint16_t userId) +bool emberAfDoorLockClusterClearWeekdayScheduleCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + uint8_t scheduleId, uint16_t userId, + Commands::ClearWeekdaySchedule::DecodableType & commandData) { EmberAfStatus zclStatus = ((scheduleId > EMBER_AF_PLUGIN_DOOR_LOCK_SERVER_WEEKDAY_SCHEDULE_TABLE_SIZE) ? EMBER_ZCL_STATUS_INVALID_FIELD @@ -249,8 +258,11 @@ bool emberAfDoorLockClusterClearWeekdayScheduleCallback(EndpointId endpoint, app return true; } -bool emberAfDoorLockClusterSetYeardayScheduleCallback(EndpointId endpoint, app::CommandHandler * commandObj, uint8_t scheduleId, - uint16_t userId, uint32_t localStartTime, uint32_t localEndTime) +bool emberAfDoorLockClusterSetYeardayScheduleCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + uint8_t scheduleId, uint16_t userId, uint32_t localStartTime, + uint32_t localEndTime, + Commands::SetYeardaySchedule::DecodableType & commandData) { uint8_t status; CHIP_ERROR err = CHIP_NO_ERROR; @@ -285,8 +297,10 @@ bool emberAfDoorLockClusterSetYeardayScheduleCallback(EndpointId endpoint, app:: return true; } -bool emberAfDoorLockClusterGetYeardayScheduleCallback(EndpointId endpoint, app::CommandHandler * commandObj, uint8_t scheduleId, - uint16_t userId) +bool emberAfDoorLockClusterGetYeardayScheduleCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + uint8_t scheduleId, uint16_t userId, + Commands::GetYeardaySchedule::DecodableType & commandData) { EmberAfPluginDoorLockServerYeardayScheduleEntry * entry = &yeardayScheduleTable[0]; EmberAfStatus zclStatus; @@ -331,8 +345,10 @@ bool emberAfDoorLockClusterGetYeardayScheduleCallback(EndpointId endpoint, app:: return true; } -bool emberAfDoorLockClusterClearYeardayScheduleCallback(EndpointId endpoint, app::CommandHandler * commandObj, uint8_t scheduleId, - uint16_t userId) +bool emberAfDoorLockClusterClearYeardayScheduleCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + uint8_t scheduleId, uint16_t userId, + Commands::ClearYeardaySchedule::DecodableType & commandData) { uint8_t status; CHIP_ERROR err = CHIP_NO_ERROR; @@ -365,9 +381,11 @@ bool emberAfDoorLockClusterClearYeardayScheduleCallback(EndpointId endpoint, app return true; } -bool emberAfDoorLockClusterSetHolidayScheduleCallback(EndpointId endpoint, app::CommandHandler * commandObj, +bool emberAfDoorLockClusterSetHolidayScheduleCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, uint8_t holidayScheduleId, uint32_t localStartTime, uint32_t localEndTime, - uint8_t operatingModeDuringHoliday) + uint8_t operatingModeDuringHoliday, + Commands::SetHolidaySchedule::DecodableType & commandData) { uint8_t status; CHIP_ERROR err = CHIP_NO_ERROR; @@ -404,8 +422,10 @@ bool emberAfDoorLockClusterSetHolidayScheduleCallback(EndpointId endpoint, app:: return true; } -bool emberAfDoorLockClusterGetHolidayScheduleCallback(EndpointId endpoint, app::CommandHandler * commandObj, - uint8_t holidayScheduleId) +bool emberAfDoorLockClusterGetHolidayScheduleCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + uint8_t holidayScheduleId, + Commands::GetHolidaySchedule::DecodableType & commandData) { EmberAfPluginDoorLockServerHolidayScheduleEntry * entry = &holidayScheduleTable[0]; EmberAfStatus zclStatus; @@ -449,8 +469,10 @@ bool emberAfDoorLockClusterGetHolidayScheduleCallback(EndpointId endpoint, app:: return true; } -bool emberAfDoorLockClusterClearHolidayScheduleCallback(EndpointId endpoint, app::CommandHandler * commandObj, - uint8_t holidayScheduleId) +bool emberAfDoorLockClusterClearHolidayScheduleCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + uint8_t holidayScheduleId, + Commands::ClearHolidaySchedule::DecodableType & commandData) { uint8_t status; CHIP_ERROR err = CHIP_NO_ERROR; diff --git a/src/app/clusters/door-lock-server/door-lock-server-user.cpp b/src/app/clusters/door-lock-server/door-lock-server-user.cpp index 8a1e5c41424973..efd13a60124cdc 100644 --- a/src/app/clusters/door-lock-server/door-lock-server-user.cpp +++ b/src/app/clusters/door-lock-server/door-lock-server-user.cpp @@ -42,15 +42,18 @@ #include #include #include +#include #include #include #include #include #include +#include #include using namespace chip; +using namespace chip::app::Clusters::DoorLock; EmberEventControl emberAfPluginDoorLockServerLockoutEventControl; EmberEventControl emberAfPluginDoorLockServerRelockEventControl; @@ -220,7 +223,9 @@ static uint8_t clearUserPinOrRfid(uint16_t userId, EmberAfPluginDoorLockServerUs return (success ? 0x00 : 0x01); // See 7.3.2.17.8 and 7.3.2.17.25). } -bool emberAfDoorLockClusterGetUserTypeCallback(EndpointId endpoint, app::CommandHandler * commandObj, uint16_t userId) +bool emberAfDoorLockClusterGetUserTypeCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint16_t userId, + Commands::GetUserType::DecodableType & commandData) { CHIP_ERROR err = CHIP_NO_ERROR; if (emAfPluginDoorLockServerCheckForSufficientSpace(userId, EMBER_AF_PLUGIN_DOOR_LOCK_SERVER_PIN_USER_TABLE_SIZE)) @@ -246,8 +251,9 @@ bool emberAfDoorLockClusterGetUserTypeCallback(EndpointId endpoint, app::Command return true; } -bool emberAfDoorLockClusterSetUserTypeCallback(EndpointId endpoint, app::CommandHandler * commandObj, uint16_t userId, - uint8_t userType) +bool emberAfDoorLockClusterSetUserTypeCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint16_t userId, uint8_t userType, + Commands::SetUserType::DecodableType & commandData) { CHIP_ERROR err = CHIP_NO_ERROR; // TODO: Need to validate userType. https://github.com/project-chip/connectedhomeip/issues/3580 @@ -288,8 +294,9 @@ bool emAfPluginDoorLockServerSetPinUserType(uint16_t userId, EmberAfDoorLockUser // ------------------------------------------------------------------------------ // PIN handling -bool emberAfDoorLockClusterSetPinCallback(EndpointId endpoint, app::CommandHandler * commandObj, uint16_t userId, - uint8_t userStatus, uint8_t userType, uint8_t * pin) +bool emberAfDoorLockClusterSetPinCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint16_t userId, uint8_t userStatus, uint8_t userType, uint8_t * pin, + Commands::SetPin::DecodableType & commandData) { CHIP_ERROR err = CHIP_NO_ERROR; // send response @@ -340,7 +347,8 @@ static bool getSendPinOverTheAir(void) return sendPinOverTheAir; } -bool emberAfDoorLockClusterGetPinCallback(EndpointId endpoint, app::CommandHandler * commandObj, uint16_t userId) +bool emberAfDoorLockClusterGetPinCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint16_t userId, Commands::GetPin::DecodableType & commandData) { EmberAfPluginDoorLockServerUser user; EmberStatus status = EMBER_SUCCESS; @@ -384,7 +392,8 @@ bool emberAfDoorLockClusterGetPinCallback(EndpointId endpoint, app::CommandHandl return true; } -bool emberAfDoorLockClusterClearPinCallback(EndpointId endpoint, app::CommandHandler * commandObj, uint16_t userId) +bool emberAfDoorLockClusterClearPinCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint16_t userId, Commands::ClearPin::DecodableType & commandData) { CHIP_ERROR err = CHIP_NO_ERROR; uint8_t status = clearUserPinOrRfid(userId, pinUserTable, EMBER_AF_PLUGIN_DOOR_LOCK_SERVER_PIN_USER_TABLE_SIZE); @@ -426,7 +435,8 @@ bool emberAfDoorLockClusterClearPinCallback(EndpointId endpoint, app::CommandHan return true; } -bool emberAfDoorLockClusterClearAllPinsCallback(EndpointId endpoint, app::CommandHandler * commandObj) +bool emberAfDoorLockClusterClearAllPinsCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, Commands::ClearAllPins::DecodableType & commandData) { uint8_t i; CHIP_ERROR err = CHIP_NO_ERROR; @@ -456,8 +466,9 @@ bool emberAfDoorLockClusterClearAllPinsCallback(EndpointId endpoint, app::Comman // ------------------------------------------------------------------------------ // RFID handling -bool emberAfDoorLockClusterSetRfidCallback(EndpointId endpoint, app::CommandHandler * commandObj, uint16_t userId, - uint8_t userStatus, uint8_t userType, uint8_t * rfid) +bool emberAfDoorLockClusterSetRfidCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint16_t userId, uint8_t userStatus, uint8_t userType, + uint8_t * rfid, Commands::SetRfid::DecodableType & commandData) { CHIP_ERROR err = CHIP_NO_ERROR; uint8_t status = @@ -480,7 +491,8 @@ bool emberAfDoorLockClusterSetRfidCallback(EndpointId endpoint, app::CommandHand return true; } -bool emberAfDoorLockClusterGetRfidCallback(EndpointId endpoint, app::CommandHandler * commandObj, uint16_t userId) +bool emberAfDoorLockClusterGetRfidCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint16_t userId, Commands::GetRfid::DecodableType & commandData) { EmberAfPluginDoorLockServerUser user; EmberStatus status = EMBER_SUCCESS; @@ -517,7 +529,8 @@ bool emberAfDoorLockClusterGetRfidCallback(EndpointId endpoint, app::CommandHand return true; } -bool emberAfDoorLockClusterClearRfidCallback(EndpointId endpoint, app::CommandHandler * commandObj, uint16_t userId) +bool emberAfDoorLockClusterClearRfidCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint16_t userId, Commands::ClearRfid::DecodableType & commandData) { CHIP_ERROR err = CHIP_NO_ERROR; uint8_t status = clearUserPinOrRfid(userId, rfidUserTable, EMBER_AF_PLUGIN_DOOR_LOCK_SERVER_RFID_USER_TABLE_SIZE); @@ -539,7 +552,8 @@ bool emberAfDoorLockClusterClearRfidCallback(EndpointId endpoint, app::CommandHa return true; } -bool emberAfDoorLockClusterClearAllRfidsCallback(EndpointId endpoint, app::CommandHandler * commandObj) +bool emberAfDoorLockClusterClearAllRfidsCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, Commands::ClearAllRfids::DecodableType & commandData) { CHIP_ERROR err = CHIP_NO_ERROR; for (uint8_t i = 0; i < EMBER_AF_PLUGIN_DOOR_LOCK_SERVER_RFID_USER_TABLE_SIZE; i++) @@ -620,7 +634,8 @@ static bool verifyPin(uint8_t * pin, uint8_t * userId) return false; } -bool emberAfDoorLockClusterLockDoorCallback(EndpointId endpoint, app::CommandHandler * commandObj, uint8_t * PIN) +bool emberAfDoorLockClusterLockDoorCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint8_t * PIN, Commands::LockDoor::DecodableType & commandData) { uint8_t userId = 0; bool pinVerified = verifyPin(PIN, &userId); @@ -684,7 +699,8 @@ bool emberAfDoorLockClusterLockDoorCallback(EndpointId endpoint, app::CommandHan return true; } -bool emberAfDoorLockClusterUnlockDoorCallback(EndpointId endpoint, app::CommandHandler * commandObj, uint8_t * pin) +bool emberAfDoorLockClusterUnlockDoorCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint8_t * pin, Commands::UnlockDoor::DecodableType & commandData) { uint8_t userId = 0; bool pinVerified = verifyPin(pin, &userId); @@ -873,8 +889,9 @@ void emberAfDoorLockClusterServerAttributeChangedCallback(EndpointId endpoint, A } } -bool emberAfDoorLockClusterUnlockWithTimeoutCallback(EndpointId endpoint, app::CommandHandler * commandObj, uint16_t timeoutS, - uint8_t * pin) +bool emberAfDoorLockClusterUnlockWithTimeoutCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint16_t timeoutS, uint8_t * pin, + Commands::UnlockWithTimeout::DecodableType & commandData) { uint8_t userId; uint8_t status; diff --git a/src/app/clusters/ethernet_network_diagnostics_server/ethernet_network_diagnostics_server.cpp b/src/app/clusters/ethernet_network_diagnostics_server/ethernet_network_diagnostics_server.cpp index 8b943526779bdc..4df066bf92b7f0 100644 --- a/src/app/clusters/ethernet_network_diagnostics_server/ethernet_network_diagnostics_server.cpp +++ b/src/app/clusters/ethernet_network_diagnostics_server/ethernet_network_diagnostics_server.cpp @@ -16,10 +16,12 @@ */ #include +#include #include #include #include #include +#include #include #include #include @@ -29,6 +31,7 @@ using namespace chip; using namespace chip::app; using namespace chip::app::Clusters; +using namespace chip::app::Clusters::EthernetNetworkDiagnostics; using namespace chip::app::Clusters::EthernetNetworkDiagnostics::Attributes; using chip::DeviceLayer::ConnectivityManager; @@ -100,7 +103,9 @@ CHIP_ERROR EthernetDiagosticsAttrAccess::ReadIfSupported(CHIP_ERROR (Connectivit } } // anonymous namespace -bool emberAfEthernetNetworkDiagnosticsClusterResetCountsCallback(EndpointId endpoint, app::CommandHandler * commandObj) +bool emberAfEthernetNetworkDiagnosticsClusterResetCountsCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + Commands::ResetCounts::DecodableType & commandData) { EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; diff --git a/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp b/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp index c4d7ce5511f3f6..5d2cfeeebc766b 100644 --- a/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp +++ b/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp @@ -21,16 +21,21 @@ ******************************************************************************* ******************************************************************************/ +#include #include +#include #include #include #include #include using namespace chip; +using namespace chip::app::Clusters::GeneralCommissioning; -bool emberAfGeneralCommissioningClusterArmFailSafeCallback(EndpointId endpoint, app::CommandHandler * commandObj, - uint16_t expiryLengthSeconds, uint64_t breadcrumb, uint32_t timeoutMs) +bool emberAfGeneralCommissioningClusterArmFailSafeCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + uint16_t expiryLengthSeconds, uint64_t breadcrumb, uint32_t timeoutMs, + Commands::ArmFailSafe::DecodableType & commandData) { CHIP_ERROR err = DeviceLayer::Internal::DeviceControlServer::DeviceControlSvr().ArmFailSafe(expiryLengthSeconds); emberAfSendImmediateDefaultResponse(err == CHIP_NO_ERROR ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE); @@ -38,7 +43,10 @@ bool emberAfGeneralCommissioningClusterArmFailSafeCallback(EndpointId endpoint, return true; } -bool emberAfGeneralCommissioningClusterCommissioningCompleteCallback(EndpointId endpoint, app::CommandHandler * commandObj) +bool emberAfGeneralCommissioningClusterCommissioningCompleteCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, + Commands::CommissioningComplete::DecodableType & commandData) { CHIP_ERROR err = DeviceLayer::Internal::DeviceControlServer::DeviceControlSvr().CommissioningComplete(); emberAfSendImmediateDefaultResponse(err == CHIP_NO_ERROR ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE); @@ -46,9 +54,11 @@ bool emberAfGeneralCommissioningClusterCommissioningCompleteCallback(EndpointId return true; } -bool emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback(EndpointId endpoint, app::CommandHandler * commandObj, - uint8_t location, uint8_t * countryCode, uint64_t breadcrumb, - uint32_t timeoutMs) +bool emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint8_t location, uint8_t * countryCode, + uint64_t breadcrumb, uint32_t timeoutMs, + Commands::SetRegulatoryConfig::DecodableType & commandData) { CHIP_ERROR err = DeviceLayer::Internal::DeviceControlServer::DeviceControlSvr().SetRegulatoryConfig( location, reinterpret_cast(countryCode), breadcrumb); diff --git a/src/app/clusters/groups-server/groups-server.cpp b/src/app/clusters/groups-server/groups-server.cpp index 76079666f52def..c7c0e592f884d4 100644 --- a/src/app/clusters/groups-server/groups-server.cpp +++ b/src/app/clusters/groups-server/groups-server.cpp @@ -50,8 +50,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -60,6 +62,7 @@ #endif // EMBER_AF_PLUGIN_SCENES using namespace chip; +using namespace chip::app::Clusters::Groups; static bool isGroupPresent(EndpointId endpoint, GroupId groupId); @@ -151,8 +154,9 @@ static EmberAfStatus removeEntryFromGroupTable(EndpointId endpoint, GroupId grou return EMBER_ZCL_STATUS_NOT_FOUND; } -bool emberAfGroupsClusterAddGroupCallback(EndpointId endpoint, app::CommandHandler * commandObj, GroupId groupId, - uint8_t * groupName) +bool emberAfGroupsClusterAddGroupCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, GroupId groupId, uint8_t * groupName, + Commands::AddGroup::DecodableType & commandData) { EmberAfStatus status; CHIP_ERROR err = CHIP_NO_ERROR; @@ -188,7 +192,8 @@ bool emberAfGroupsClusterAddGroupCallback(EndpointId endpoint, app::CommandHandl return true; } -bool emberAfGroupsClusterViewGroupCallback(EndpointId endpoint, app::CommandHandler * commandObj, GroupId groupId) +bool emberAfGroupsClusterViewGroupCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, GroupId groupId, Commands::ViewGroup::DecodableType & commandData) { EmberAfStatus status = EMBER_ZCL_STATUS_NOT_FOUND; CHIP_ERROR err = CHIP_NO_ERROR; @@ -230,8 +235,9 @@ bool emberAfGroupsClusterViewGroupCallback(EndpointId endpoint, app::CommandHand return true; } -bool emberAfGroupsClusterGetGroupMembershipCallback(EndpointId endpoint, app::CommandHandler * commandObj, uint8_t groupCount, - uint8_t * groupList) +bool emberAfGroupsClusterGetGroupMembershipCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint8_t groupCount, uint8_t * groupList, + Commands::GetGroupMembership::DecodableType & commandData) { EmberStatus status = EMBER_ZCL_STATUS_FAILURE; uint8_t i, j; @@ -328,7 +334,9 @@ bool emberAfGroupsClusterGetGroupMembershipCallback(EndpointId endpoint, app::Co return true; } -bool emberAfGroupsClusterRemoveGroupCallback(EndpointId endpoint, app::CommandHandler * commandObj, GroupId groupId) +bool emberAfGroupsClusterRemoveGroupCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, GroupId groupId, + Commands::RemoveGroup::DecodableType & commandData) { EmberAfStatus status; CHIP_ERROR err = CHIP_NO_ERROR; @@ -366,7 +374,8 @@ bool emberAfGroupsClusterRemoveGroupCallback(EndpointId endpoint, app::CommandHa return true; } -bool emberAfGroupsClusterRemoveAllGroupsCallback(EndpointId aEndpoint, app::CommandHandler * commandObj) +bool emberAfGroupsClusterRemoveAllGroupsCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId aEndpoint, Commands::RemoveAllGroups::DecodableType & commandData) { EmberStatus sendStatus = EMBER_SUCCESS; uint8_t i; @@ -414,8 +423,10 @@ bool emberAfGroupsClusterRemoveAllGroupsCallback(EndpointId aEndpoint, app::Comm return true; } -bool emberAfGroupsClusterAddGroupIfIdentifyingCallback(EndpointId endpoint, app::CommandHandler * commandObj, GroupId groupId, - uint8_t * groupName) +bool emberAfGroupsClusterAddGroupIfIdentifyingCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + GroupId groupId, uint8_t * groupName, + Commands::AddGroupIfIdentifying::DecodableType & commandData) { EmberAfStatus status; EmberStatus sendStatus = EMBER_SUCCESS; diff --git a/src/app/clusters/ias-zone-server/ias-zone-server.cpp b/src/app/clusters/ias-zone-server/ias-zone-server.cpp index 2a50e1584aad4a..1e2411b36adc95 100644 --- a/src/app/clusters/ias-zone-server/ias-zone-server.cpp +++ b/src/app/clusters/ias-zone-server/ias-zone-server.cpp @@ -56,14 +56,17 @@ #include #include #include +#include #include #include +#include #include #include #include #include using namespace chip; +using namespace chip::app::Clusters::IasZone; #define UNDEFINED_ZONE_ID 0xFF #define DELAY_TIMER_MS (1 * MILLISECOND_TICKS_PER_SECOND) @@ -348,8 +351,9 @@ static void updateEnrollState(EndpointId endpoint, bool enrolled) emberAfIasZoneClusterPrintln("IAS Zone Server State: %pEnrolled", (enrolled ? "" : "NOT ")); } -bool emberAfIasZoneClusterZoneEnrollResponseCallback(EndpointId aEndpoint, app::CommandHandler * commandObj, - uint8_t enrollResponseCode, uint8_t zoneId) +bool emberAfIasZoneClusterZoneEnrollResponseCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId aEndpoint, uint8_t enrollResponseCode, uint8_t zoneId, + Commands::ZoneEnrollResponse::DecodableType & commandData) { EndpointId endpoint; uint8_t epZoneId; diff --git a/src/app/clusters/identify-server/identify-server.cpp b/src/app/clusters/identify-server/identify-server.cpp index 8e80c687947716..a812d458a0676f 100644 --- a/src/app/clusters/identify-server/identify-server.cpp +++ b/src/app/clusters/identify-server/identify-server.cpp @@ -38,11 +38,13 @@ #include #include #include +#include #include #include #include #include #include +#include #include #include @@ -60,6 +62,7 @@ using namespace chip; using namespace chip::app; +using namespace chip::app::Clusters::Identify; static std::array instances = { 0 }; @@ -205,14 +208,17 @@ void emberAfIdentifyClusterServerAttributeChangedCallback(EndpointId endpoint, A } } -bool emberAfIdentifyClusterIdentifyCallback(EndpointId endpoint, CommandHandler * commandObj, uint16_t identifyTime) +bool emberAfIdentifyClusterIdentifyCallback(CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint16_t identifyTime, + Commands::Identify::DecodableType & commandData) { // cmd Identify return EMBER_SUCCESS == emberAfSendImmediateDefaultResponse(Clusters::Identify::Attributes::IdentifyTime::Set(endpoint, identifyTime)); } -bool emberAfIdentifyClusterIdentifyQueryCallback(EndpointId endpoint, CommandHandler * commandObj) +bool emberAfIdentifyClusterIdentifyQueryCallback(CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, Commands::IdentifyQuery::DecodableType & commandData) { // cmd IdentifyQuery uint16_t identifyTime = 0; @@ -265,8 +271,9 @@ bool emberAfIdentifyClusterIdentifyQueryCallback(EndpointId endpoint, CommandHan return true; } -bool emberAfIdentifyClusterTriggerEffectCallback(EndpointId endpoint, CommandHandler * commandObj, uint8_t effectIdentifier, - uint8_t effectVariant) +bool emberAfIdentifyClusterTriggerEffectCallback(CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint8_t effectIdentifier, uint8_t effectVariant, + Commands::TriggerEffect::DecodableType & commandData) { // cmd TriggerEffect Identify * identify = inst(endpoint); diff --git a/src/app/clusters/keypad-input-server/keypad-input-server.cpp b/src/app/clusters/keypad-input-server/keypad-input-server.cpp index ad6ea596bdc109..f02e5d93c8ef2e 100644 --- a/src/app/clusters/keypad-input-server/keypad-input-server.cpp +++ b/src/app/clusters/keypad-input-server/keypad-input-server.cpp @@ -22,12 +22,15 @@ ******************************************************************************/ #include +#include #include #include #include +#include #include using namespace chip; +using namespace chip::app::Clusters::KeypadInput; EmberAfKeypadInputStatus keypadInputClusterSendKey(EmberAfKeypadInputCecKeyCode keyCode); @@ -51,7 +54,8 @@ static void sendResponse(app::CommandHandler * command, EmberAfKeypadInputStatus } } -bool emberAfKeypadInputClusterSendKeyCallback(EndpointId endpoint, app::CommandHandler * command, uint8_t keyCode) +bool emberAfKeypadInputClusterSendKeyCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint8_t keyCode, Commands::SendKey::DecodableType & commandData) { EmberAfKeypadInputStatus status = keypadInputClusterSendKey(static_cast(keyCode)); sendResponse(command, status); diff --git a/src/app/clusters/level-control/level-control.cpp b/src/app/clusters/level-control/level-control.cpp index c0863174c8bcdf..9574366c0d82f3 100644 --- a/src/app/clusters/level-control/level-control.cpp +++ b/src/app/clusters/level-control/level-control.cpp @@ -46,8 +46,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -67,6 +69,7 @@ #include using namespace chip; +using namespace chip::app::Clusters::LevelControl; #ifdef ZCL_USING_LEVEL_CONTROL_CLUSTER_START_UP_CURRENT_LEVEL_ATTRIBUTE static bool areStartUpLevelControlServerAttributesTokenized(EndpointId endpoint); @@ -406,8 +409,9 @@ static bool shouldExecuteIfOff(EndpointId endpoint, CommandId commandId, uint8_t #endif } -bool emberAfLevelControlClusterMoveToLevelCallback(EndpointId endpoint, app::CommandHandler * commandObj, uint8_t level, - uint16_t transitionTime, uint8_t optionMask, uint8_t optionOverride) +bool emberAfLevelControlClusterMoveToLevelCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint8_t level, uint16_t transitionTime, uint8_t optionMask, + uint8_t optionOverride, Commands::MoveToLevel::DecodableType & commandData) { emberAfLevelControlClusterPrintln("%pMOVE_TO_LEVEL %x %2x %x %x", "RX level-control:", level, transitionTime, optionMask, optionOverride); @@ -416,8 +420,10 @@ bool emberAfLevelControlClusterMoveToLevelCallback(EndpointId endpoint, app::Com return true; } -bool emberAfLevelControlClusterMoveToLevelWithOnOffCallback(EndpointId endpoint, app::CommandHandler * commandObj, uint8_t level, - uint16_t transitionTime) +bool emberAfLevelControlClusterMoveToLevelWithOnOffCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + uint8_t level, uint16_t transitionTime, + Commands::MoveToLevelWithOnOff::DecodableType & commandData) { emberAfLevelControlClusterPrintln("%pMOVE_TO_LEVEL_WITH_ON_OFF %x %2x", "RX level-control:", level, transitionTime); moveToLevelHandler(ZCL_MOVE_TO_LEVEL_WITH_ON_OFF_COMMAND_ID, level, transitionTime, 0xFF, 0xFF, @@ -425,47 +431,53 @@ bool emberAfLevelControlClusterMoveToLevelWithOnOffCallback(EndpointId endpoint, return true; } -bool emberAfLevelControlClusterMoveCallback(EndpointId endpoint, app::CommandHandler * commandObj, uint8_t moveMode, uint8_t rate, - uint8_t optionMask, uint8_t optionOverride) +bool emberAfLevelControlClusterMoveCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint8_t moveMode, uint8_t rate, uint8_t optionMask, + uint8_t optionOverride, Commands::Move::DecodableType & commandData) { emberAfLevelControlClusterPrintln("%pMOVE %x %x", "RX level-control:", moveMode, rate); moveHandler(ZCL_MOVE_COMMAND_ID, moveMode, rate, optionMask, optionOverride); return true; } -bool emberAfLevelControlClusterMoveWithOnOffCallback(EndpointId endpoint, app::CommandHandler * commandObj, uint8_t moveMode, - uint8_t rate) +bool emberAfLevelControlClusterMoveWithOnOffCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint8_t moveMode, uint8_t rate, + Commands::MoveWithOnOff::DecodableType & commandData) { emberAfLevelControlClusterPrintln("%pMOVE_WITH_ON_OFF %x %x", "RX level-control:", moveMode, rate); moveHandler(ZCL_MOVE_WITH_ON_OFF_COMMAND_ID, moveMode, rate, 0xFF, 0xFF); return true; } -bool emberAfLevelControlClusterStepCallback(EndpointId endpoint, app::CommandHandler * commandObj, uint8_t stepMode, - uint8_t stepSize, uint16_t transitionTime, uint8_t optionMask, uint8_t optionOverride) +bool emberAfLevelControlClusterStepCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint8_t stepMode, uint8_t stepSize, uint16_t transitionTime, + uint8_t optionMask, uint8_t optionOverride, Commands::Step::DecodableType & commandData) { emberAfLevelControlClusterPrintln("%pSTEP %x %x %2x", "RX level-control:", stepMode, stepSize, transitionTime); stepHandler(ZCL_STEP_COMMAND_ID, stepMode, stepSize, transitionTime, optionMask, optionOverride); return true; } -bool emberAfLevelControlClusterStepWithOnOffCallback(EndpointId endpoint, app::CommandHandler * commandObj, uint8_t stepMode, - uint8_t stepSize, uint16_t transitionTime) +bool emberAfLevelControlClusterStepWithOnOffCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint8_t stepMode, uint8_t stepSize, + uint16_t transitionTime, Commands::StepWithOnOff::DecodableType & commandData) { emberAfLevelControlClusterPrintln("%pSTEP_WITH_ON_OFF %x %x %2x", "RX level-control:", stepMode, stepSize, transitionTime); stepHandler(ZCL_STEP_WITH_ON_OFF_COMMAND_ID, stepMode, stepSize, transitionTime, 0xFF, 0xFF); return true; } -bool emberAfLevelControlClusterStopCallback(EndpointId endpoint, app::CommandHandler * commandObj, uint8_t optionMask, - uint8_t optionOverride) +bool emberAfLevelControlClusterStopCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint8_t optionMask, uint8_t optionOverride, + Commands::Stop::DecodableType & commandData) { emberAfLevelControlClusterPrintln("%pSTOP", "RX level-control:"); stopHandler(ZCL_STOP_COMMAND_ID, optionMask, optionOverride); return true; } -bool emberAfLevelControlClusterStopWithOnOffCallback(EndpointId endpoint, app::CommandHandler * commandObj) +bool emberAfLevelControlClusterStopWithOnOffCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, Commands::StopWithOnOff::DecodableType & commandData) { emberAfLevelControlClusterPrintln("%pSTOP_WITH_ON_OFF", "RX level-control:"); stopHandler(ZCL_STOP_WITH_ON_OFF_COMMAND_ID, 0xFF, 0xFF); diff --git a/src/app/clusters/low-power-server/low-power-server.cpp b/src/app/clusters/low-power-server/low-power-server.cpp index d95632107dd3c9..405eaefaef0974 100644 --- a/src/app/clusters/low-power-server/low-power-server.cpp +++ b/src/app/clusters/low-power-server/low-power-server.cpp @@ -22,14 +22,18 @@ ******************************************************************************* ******************************************************************************/ +#include #include +#include #include using namespace chip; +using namespace chip::app::Clusters::LowPower; bool lowPowerClusterSleep(); -bool emberAfLowPowerClusterSleepCallback(EndpointId endpoint, app::CommandHandler * command) +bool emberAfLowPowerClusterSleepCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, Commands::Sleep::DecodableType & commandData) { bool success = lowPowerClusterSleep(); EmberAfStatus status = success ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; diff --git a/src/app/clusters/media-input-server/media-input-server.cpp b/src/app/clusters/media-input-server/media-input-server.cpp index c111bf23749867..f9850b573add00 100644 --- a/src/app/clusters/media-input-server/media-input-server.cpp +++ b/src/app/clusters/media-input-server/media-input-server.cpp @@ -24,12 +24,15 @@ #include #include #include +#include #include #include +#include #include #include using namespace chip; +using namespace chip::app::Clusters::MediaInput; bool mediaInputClusterSelectInput(uint8_t input); bool mediaInputClusterShowInputStatus(); @@ -46,7 +49,9 @@ static void storeCurrentInput(EndpointId endpoint, uint8_t currentInput) } } -bool emberAfMediaInputClusterSelectInputCallback(EndpointId endpoint, app::CommandHandler * command, uint8_t input) +bool emberAfMediaInputClusterSelectInputCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint8_t input, + Commands::SelectInput::DecodableType & commandData) { bool success = mediaInputClusterSelectInput(input); EmberAfStatus status = success ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; @@ -58,7 +63,8 @@ bool emberAfMediaInputClusterSelectInputCallback(EndpointId endpoint, app::Comma return true; } -bool emberAfMediaInputClusterShowInputStatusCallback(EndpointId endpoint, app::CommandHandler * command) +bool emberAfMediaInputClusterShowInputStatusCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, Commands::ShowInputStatus::DecodableType & commandData) { bool success = mediaInputClusterShowInputStatus(); EmberAfStatus status = success ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; @@ -66,7 +72,8 @@ bool emberAfMediaInputClusterShowInputStatusCallback(EndpointId endpoint, app::C return true; } -bool emberAfMediaInputClusterHideInputStatusCallback(EndpointId endpoint, app::CommandHandler * command) +bool emberAfMediaInputClusterHideInputStatusCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, Commands::HideInputStatus::DecodableType & commandData) { bool success = mediaInputClusterHideInputStatus(); EmberAfStatus status = success ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; @@ -74,7 +81,9 @@ bool emberAfMediaInputClusterHideInputStatusCallback(EndpointId endpoint, app::C return true; } -bool emberAfMediaInputClusterRenameInputCallback(EndpointId endpoint, app::CommandHandler * command, uint8_t input, uint8_t * name) +bool emberAfMediaInputClusterRenameInputCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint8_t input, uint8_t * name, + Commands::RenameInput::DecodableType & commandData) { // TODO: char is not null terminated, verify this code once #7963 gets merged. std::string nameString(reinterpret_cast(name)); diff --git a/src/app/clusters/media-playback-server/media-playback-server.cpp b/src/app/clusters/media-playback-server/media-playback-server.cpp index 30eb359544f7d0..3a87bd948c7cc7 100644 --- a/src/app/clusters/media-playback-server/media-playback-server.cpp +++ b/src/app/clusters/media-playback-server/media-playback-server.cpp @@ -25,13 +25,16 @@ #include #include #include +#include #include #include #include +#include #include #include using namespace chip; +using namespace chip::app::Clusters::MediaPlayback; EmberAfMediaPlaybackStatus mediaPlaybackClusterSendMediaPlaybackRequest(MediaPlaybackRequest mediaPlaybackRequest, uint64_t deltaPositionMilliseconds); @@ -94,7 +97,8 @@ static void sendResponse(app::CommandHandler * command, const char * responseNam } } -bool emberAfMediaPlaybackClusterMediaPlayCallback(EndpointId endpoint, app::CommandHandler * command) +bool emberAfMediaPlaybackClusterMediaPlayCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, Commands::MediaPlay::DecodableType & commandData) { EmberAfMediaPlaybackStatus status = mediaPlaybackClusterSendMediaPlaybackRequest(MEDIA_PLAYBACK_REQUEST_PLAY, 0); storeNewPlaybackState(emberAfCurrentEndpoint(), EMBER_ZCL_MEDIA_PLAYBACK_STATE_PLAYING); @@ -102,7 +106,8 @@ bool emberAfMediaPlaybackClusterMediaPlayCallback(EndpointId endpoint, app::Comm return true; } -bool emberAfMediaPlaybackClusterMediaPauseCallback(EndpointId endpoint, app::CommandHandler * command) +bool emberAfMediaPlaybackClusterMediaPauseCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, Commands::MediaPause::DecodableType & commandData) { EmberAfMediaPlaybackStatus status = mediaPlaybackClusterSendMediaPlaybackRequest(MEDIA_PLAYBACK_REQUEST_PAUSE, 0); storeNewPlaybackState(emberAfCurrentEndpoint(), EMBER_ZCL_MEDIA_PLAYBACK_STATE_PAUSED); @@ -110,7 +115,8 @@ bool emberAfMediaPlaybackClusterMediaPauseCallback(EndpointId endpoint, app::Com return true; } -bool emberAfMediaPlaybackClusterMediaStopCallback(EndpointId endpoint, app::CommandHandler * command) +bool emberAfMediaPlaybackClusterMediaStopCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, Commands::MediaStop::DecodableType & commandData) { EmberAfMediaPlaybackStatus status = mediaPlaybackClusterSendMediaPlaybackRequest(MEDIA_PLAYBACK_REQUEST_STOP, 0); storeNewPlaybackState(emberAfCurrentEndpoint(), EMBER_ZCL_MEDIA_PLAYBACK_STATE_NOT_PLAYING); @@ -118,29 +124,35 @@ bool emberAfMediaPlaybackClusterMediaStopCallback(EndpointId endpoint, app::Comm return true; } -bool emberAfMediaPlaybackClusterMediaFastForwardCallback(EndpointId endpoint, app::CommandHandler * command) +bool emberAfMediaPlaybackClusterMediaFastForwardCallback(app::CommandHandler * command, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + Commands::MediaFastForward::DecodableType & commandData) { EmberAfMediaPlaybackStatus status = mediaPlaybackClusterSendMediaPlaybackRequest(MEDIA_PLAYBACK_REQUEST_FAST_FORWARD, 0); sendResponse(command, "MediaFastForward", ZCL_MEDIA_FAST_FORWARD_RESPONSE_COMMAND_ID, status); return true; } -bool emberAfMediaPlaybackClusterMediaPreviousCallback(EndpointId endpoint, app::CommandHandler * command) +bool emberAfMediaPlaybackClusterMediaPreviousCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, Commands::MediaPrevious::DecodableType & commandData) { EmberAfMediaPlaybackStatus status = mediaPlaybackClusterSendMediaPlaybackRequest(MEDIA_PLAYBACK_REQUEST_PREVIOUS, 0); sendResponse(command, "MediaPrevious", ZCL_MEDIA_PREVIOUS_RESPONSE_COMMAND_ID, status); return true; } -bool emberAfMediaPlaybackClusterMediaRewindCallback(EndpointId endpoint, app::CommandHandler * command) +bool emberAfMediaPlaybackClusterMediaRewindCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, Commands::MediaRewind::DecodableType & commandData) { EmberAfMediaPlaybackStatus status = mediaPlaybackClusterSendMediaPlaybackRequest(MEDIA_PLAYBACK_REQUEST_REWIND, 0); sendResponse(command, "MediaRewind", ZCL_MEDIA_REWIND_RESPONSE_COMMAND_ID, status); return true; } -bool emberAfMediaPlaybackClusterMediaSkipBackwardCallback(EndpointId endpoint, app::CommandHandler * command, - uint64_t deltaPositionMilliseconds) +bool emberAfMediaPlaybackClusterMediaSkipBackwardCallback(app::CommandHandler * command, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + uint64_t deltaPositionMilliseconds, + Commands::MediaSkipBackward::DecodableType & commandData) { EmberAfMediaPlaybackStatus status = mediaPlaybackClusterSendMediaPlaybackRequest(MEDIA_PLAYBACK_REQUEST_SKIP_BACKWARD, deltaPositionMilliseconds); @@ -148,8 +160,10 @@ bool emberAfMediaPlaybackClusterMediaSkipBackwardCallback(EndpointId endpoint, a return true; } -bool emberAfMediaPlaybackClusterMediaSkipForwardCallback(EndpointId endpoint, app::CommandHandler * command, - uint64_t deltaPositionMilliseconds) +bool emberAfMediaPlaybackClusterMediaSkipForwardCallback(app::CommandHandler * command, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + uint64_t deltaPositionMilliseconds, + Commands::MediaSkipForward::DecodableType & commandData) { EmberAfMediaPlaybackStatus status = mediaPlaybackClusterSendMediaPlaybackRequest(MEDIA_PLAYBACK_REQUEST_SKIP_FORWARD, deltaPositionMilliseconds); @@ -157,7 +171,9 @@ bool emberAfMediaPlaybackClusterMediaSkipForwardCallback(EndpointId endpoint, ap return true; } -bool emberAfMediaPlaybackClusterMediaSeekCallback(EndpointId endpoint, app::CommandHandler * command, uint64_t positionMilliseconds) +bool emberAfMediaPlaybackClusterMediaSeekCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint64_t positionMilliseconds, + Commands::MediaSeek::DecodableType & commandData) { EmberAfMediaPlaybackStatus status = mediaPlaybackClusterSendMediaPlaybackRequest(MEDIA_PLAYBACK_REQUEST_SEEK, positionMilliseconds); @@ -165,13 +181,15 @@ bool emberAfMediaPlaybackClusterMediaSeekCallback(EndpointId endpoint, app::Comm return true; } -bool emberAfMediaPlaybackClusterMediaNextCallback(EndpointId endpoint, app::CommandHandler * command) +bool emberAfMediaPlaybackClusterMediaNextCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, Commands::MediaNext::DecodableType & commandData) { EmberAfMediaPlaybackStatus status = mediaPlaybackClusterSendMediaPlaybackRequest(MEDIA_PLAYBACK_REQUEST_NEXT, 0); sendResponse(command, "MediaNext", ZCL_MEDIA_NEXT_RESPONSE_COMMAND_ID, status); return true; } -bool emberAfMediaPlaybackClusterMediaStartOverCallback(EndpointId endpoint, app::CommandHandler * command) +bool emberAfMediaPlaybackClusterMediaStartOverCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, Commands::MediaStartOver::DecodableType & commandData) { EmberAfMediaPlaybackStatus status = mediaPlaybackClusterSendMediaPlaybackRequest(MEDIA_PLAYBACK_REQUEST_START_OVER, 0); sendResponse(command, "MediaStartOver", ZCL_MEDIA_START_OVER_RESPONSE_COMMAND_ID, status); diff --git a/src/app/clusters/network-commissioning/network-commissioning-ember.cpp b/src/app/clusters/network-commissioning/network-commissioning-ember.cpp index 70ad28ca0edf02..8141672447050d 100644 --- a/src/app/clusters/network-commissioning/network-commissioning-ember.cpp +++ b/src/app/clusters/network-commissioning/network-commissioning-ember.cpp @@ -25,16 +25,21 @@ #include #include #include +#include #include #include #include +#include #include using namespace chip; +using namespace chip::app::Clusters::NetworkCommissioning; -bool emberAfNetworkCommissioningClusterAddThreadNetworkCallback(EndpointId endpoint, app::CommandHandler * commandObj, +bool emberAfNetworkCommissioningClusterAddThreadNetworkCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, ByteSpan operationalDataset, uint64_t breadcrumb, - uint32_t timeoutMs) + uint32_t timeoutMs, + Commands::AddThreadNetwork::DecodableType & commandData) { EmberAfNetworkCommissioningError err = app::Clusters::NetworkCommissioning::OnAddThreadNetworkCommandCallbackInternal( nullptr, emberAfCurrentEndpoint(), operationalDataset, breadcrumb, timeoutMs); @@ -43,8 +48,11 @@ bool emberAfNetworkCommissioningClusterAddThreadNetworkCallback(EndpointId endpo return true; } -bool emberAfNetworkCommissioningClusterAddWiFiNetworkCallback(EndpointId endpoint, app::CommandHandler * commandObj, ByteSpan ssid, - ByteSpan credentials, uint64_t breadcrumb, uint32_t timeoutMs) +bool emberAfNetworkCommissioningClusterAddWiFiNetworkCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + ByteSpan ssid, ByteSpan credentials, uint64_t breadcrumb, + uint32_t timeoutMs, + Commands::AddWiFiNetwork::DecodableType & commandData) { EmberAfNetworkCommissioningError err = app::Clusters::NetworkCommissioning::OnAddWiFiNetworkCommandCallbackInternal( nullptr, emberAfCurrentEndpoint(), ssid, credentials, breadcrumb, timeoutMs); @@ -53,8 +61,10 @@ bool emberAfNetworkCommissioningClusterAddWiFiNetworkCallback(EndpointId endpoin return true; } -bool emberAfNetworkCommissioningClusterEnableNetworkCallback(EndpointId endpoint, app::CommandHandler * commandObj, - ByteSpan networkID, uint64_t breadcrumb, uint32_t timeoutMs) +bool emberAfNetworkCommissioningClusterEnableNetworkCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + ByteSpan networkID, uint64_t breadcrumb, uint32_t timeoutMs, + Commands::EnableNetwork::DecodableType & commandData) { EmberAfNetworkCommissioningError err = app::Clusters::NetworkCommissioning::OnEnableNetworkCommandCallbackInternal( nullptr, emberAfCurrentEndpoint(), networkID, breadcrumb, timeoutMs); @@ -66,40 +76,50 @@ bool emberAfNetworkCommissioningClusterEnableNetworkCallback(EndpointId endpoint // TODO: The following commands needed to be implemented. // These commands are not implemented thus not handled yet, return false so ember will return a error. -bool emberAfNetworkCommissioningClusterDisableNetworkCallback(EndpointId endpoint, app::CommandHandler * commandObj, - ByteSpan networkID, uint64_t breadcrumb, uint32_t timeoutMs) +bool emberAfNetworkCommissioningClusterDisableNetworkCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + ByteSpan networkID, uint64_t breadcrumb, uint32_t timeoutMs, + Commands::DisableNetwork::DecodableType & commandData) { return false; } -bool emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback(EndpointId endpoint, - app::CommandHandler * commandObj, - uint32_t timeoutMs) +bool emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback( + app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, EndpointId endpoint, uint32_t timeoutMs, + Commands::GetLastNetworkCommissioningResult::DecodableType & commandData) { return false; } -bool emberAfNetworkCommissioningClusterRemoveNetworkCallback(EndpointId endpoint, app::CommandHandler * commandObj, - ByteSpan NetworkID, uint64_t Breadcrumb, uint32_t TimeoutMs) +bool emberAfNetworkCommissioningClusterRemoveNetworkCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + ByteSpan NetworkID, uint64_t Breadcrumb, uint32_t TimeoutMs, + Commands::RemoveNetwork::DecodableType & commandData) { return false; } -bool emberAfNetworkCommissioningClusterScanNetworksCallback(EndpointId endpoint, app::CommandHandler * commandObj, ByteSpan ssid, - uint64_t breadcrumb, uint32_t timeoutMs) +bool emberAfNetworkCommissioningClusterScanNetworksCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + ByteSpan ssid, uint64_t breadcrumb, uint32_t timeoutMs, + Commands::ScanNetworks::DecodableType & commandData) { return false; } -bool emberAfNetworkCommissioningClusterUpdateThreadNetworkCallback(EndpointId endpoint, app::CommandHandler * commandObj, - ByteSpan operationalDataset, uint64_t breadcrumb, - uint32_t timeoutMs) +bool emberAfNetworkCommissioningClusterUpdateThreadNetworkCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, ByteSpan operationalDataset, + uint64_t breadcrumb, uint32_t timeoutMs, + Commands::UpdateThreadNetwork::DecodableType & commandData) { return false; } -bool emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback(EndpointId endpoint, app::CommandHandler * commandObj, +bool emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, ByteSpan ssid, ByteSpan credentials, uint64_t breadcrumb, - uint32_t timeoutMs) + uint32_t timeoutMs, + Commands::UpdateWiFiNetwork::DecodableType & commandData) { return false; } diff --git a/src/app/clusters/on-off-server/on-off-server.cpp b/src/app/clusters/on-off-server/on-off-server.cpp index 6bb6b9138a4cdc..6d56d1f310d0f0 100644 --- a/src/app/clusters/on-off-server/on-off-server.cpp +++ b/src/app/clusters/on-off-server/on-off-server.cpp @@ -44,10 +44,12 @@ #include #include #include +#include #include #include #include +#include #include #ifdef EMBER_AF_PLUGIN_SCENES @@ -63,6 +65,7 @@ #endif using namespace chip; +using namespace chip::app::Clusters::OnOff; #ifdef ZCL_USING_ON_OFF_CLUSTER_START_UP_ON_OFF_ATTRIBUTE static bool areStartUpOnOffServerAttributesTokenized(EndpointId endpoint); @@ -165,7 +168,8 @@ EmberAfStatus emberAfOnOffClusterSetValueCallback(EndpointId endpoint, uint8_t c return EMBER_ZCL_STATUS_SUCCESS; } -bool emberAfOnOffClusterOffCallback(EndpointId endpoint, app::CommandHandler * commandObj) +bool emberAfOnOffClusterOffCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, Commands::Off::DecodableType & commandData) { EmberAfStatus status = emberAfOnOffClusterSetValueCallback(emberAfCurrentEndpoint(), ZCL_OFF_COMMAND_ID, false); #ifdef EMBER_AF_PLUGIN_ZLL_ON_OFF_SERVER @@ -178,7 +182,8 @@ bool emberAfOnOffClusterOffCallback(EndpointId endpoint, app::CommandHandler * c return true; } -bool emberAfOnOffClusterOnCallback(EndpointId endpoint, app::CommandHandler * commandObj) +bool emberAfOnOffClusterOnCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, Commands::On::DecodableType & commandData) { EmberAfStatus status = emberAfOnOffClusterSetValueCallback(emberAfCurrentEndpoint(), ZCL_ON_COMMAND_ID, false); #ifdef EMBER_AF_PLUGIN_ZLL_ON_OFF_SERVER @@ -191,7 +196,8 @@ bool emberAfOnOffClusterOnCallback(EndpointId endpoint, app::CommandHandler * co return true; } -bool emberAfOnOffClusterToggleCallback(EndpointId endpoint, app::CommandHandler * commandObj) +bool emberAfOnOffClusterToggleCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, Commands::Toggle::DecodableType & commandData) { EmberAfStatus status = emberAfOnOffClusterSetValueCallback(emberAfCurrentEndpoint(), ZCL_TOGGLE_COMMAND_ID, false); #ifdef EMBER_AF_PLUGIN_ZLL_ON_OFF_SERVER diff --git a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp index 55f57145697b20..8071567952d28d 100644 --- a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp +++ b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp @@ -25,9 +25,11 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -48,6 +50,7 @@ using namespace chip; using namespace ::chip::DeviceLayer; using namespace ::chip::Transport; +using namespace chip::app::Clusters::OperationalCredentials; namespace { @@ -101,7 +104,7 @@ EmberAfStatus writeFabric(FabricIndex fabricIndex, FabricId fabricId, NodeId nod { EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; - FabricDescriptor * fabricDescriptor = chip::Platform::New(); + auto * fabricDescriptor = chip::Platform::New<::FabricDescriptor>(); VerifyOrReturnError(fabricDescriptor != nullptr, EMBER_ZCL_STATUS_FAILURE); fabricDescriptor->FabricIndex = fabricIndex; @@ -169,17 +172,14 @@ CHIP_ERROR writeFabricsIntoFabricsListAttribute() err = CHIP_ERROR_PERSISTED_STORAGE_FAILED; } - if (err == CHIP_NO_ERROR && - app::Clusters::OperationalCredentials::Attributes::CommissionedFabrics::Set(0, fabricIndex) != EMBER_ZCL_STATUS_SUCCESS) + if (err == CHIP_NO_ERROR && Attributes::CommissionedFabrics::Set(0, fabricIndex) != EMBER_ZCL_STATUS_SUCCESS) { emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: Failed to write fabrics count %" PRIu8 " in commissioned fabrics", fabricIndex); err = CHIP_ERROR_PERSISTED_STORAGE_FAILED; } - if (err == CHIP_NO_ERROR && - app::Clusters::OperationalCredentials::Attributes::SupportedFabrics::Set(0, CHIP_CONFIG_MAX_DEVICE_ADMINS) != - EMBER_ZCL_STATUS_SUCCESS) + if (err == CHIP_NO_ERROR && Attributes::SupportedFabrics::Set(0, CHIP_CONFIG_MAX_DEVICE_ADMINS) != EMBER_ZCL_STATUS_SUCCESS) { emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: Failed to write %" PRIu8 " in supported fabrics count attribute", CHIP_CONFIG_MAX_DEVICE_ADMINS); @@ -270,8 +270,10 @@ FabricCleanupExchangeDelegate gFabricCleanupExchangeDelegate; } // namespace -bool emberAfOperationalCredentialsClusterRemoveFabricCallback(EndpointId endpoint, app::CommandHandler * commandObj, - FabricIndex fabricBeingRemoved) +bool emberAfOperationalCredentialsClusterRemoveFabricCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + FabricIndex fabricBeingRemoved, + Commands::RemoveFabric::DecodableType & commandData) { emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: RemoveFabric"); // TODO: Generate emberAfFabricClusterPrintln @@ -304,8 +306,10 @@ bool emberAfOperationalCredentialsClusterRemoveFabricCallback(EndpointId endpoin return true; } -bool emberAfOperationalCredentialsClusterUpdateFabricLabelCallback(EndpointId endpoint, app::CommandHandler * commandObj, - uint8_t * Label) +bool emberAfOperationalCredentialsClusterUpdateFabricLabelCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint8_t * Label, + Commands::UpdateFabricLabel::DecodableType & commandData) { emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: UpdateFabricLabel"); @@ -386,9 +390,11 @@ EmberAfNodeOperationalCertStatus ConvertToNOCResponseStatus(CHIP_ERROR err) } // namespace -bool emberAfOperationalCredentialsClusterAddNOCCallback(EndpointId endpoint, app::CommandHandler * commandObj, ByteSpan NOCValue, - ByteSpan ICACValue, ByteSpan IPKValue, NodeId adminNodeId, - uint16_t adminVendorId) +bool emberAfOperationalCredentialsClusterAddNOCCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + ByteSpan NOCValue, ByteSpan ICACValue, ByteSpan IPKValue, + NodeId adminNodeId, uint16_t adminVendorId, + Commands::AddNOC::DecodableType & commandData) { EmberAfNodeOperationalCertStatus nocResponse = EMBER_ZCL_NODE_OPERATIONAL_CERT_STATUS_SUCCESS; @@ -427,8 +433,10 @@ bool emberAfOperationalCredentialsClusterAddNOCCallback(EndpointId endpoint, app return true; } -bool emberAfOperationalCredentialsClusterUpdateNOCCallback(EndpointId endpoint, app::CommandHandler * commandObj, ByteSpan NOCValue, - ByteSpan ICACValue) +bool emberAfOperationalCredentialsClusterUpdateNOCCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + ByteSpan NOCValue, ByteSpan ICACValue, + Commands::UpdateNOC::DecodableType & commandData) { EmberAfNodeOperationalCertStatus nocResponse = EMBER_ZCL_NODE_OPERATIONAL_CERT_STATUS_SUCCESS; @@ -467,8 +475,9 @@ bool emberAfOperationalCredentialsClusterUpdateNOCCallback(EndpointId endpoint, return true; } -bool emberAfOperationalCredentialsClusterCertificateChainRequestCallback(EndpointId endpoint, app::CommandHandler * commandObj, - uint8_t certificateType) +bool emberAfOperationalCredentialsClusterCertificateChainRequestCallback( + app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, EndpointId endpoint, uint8_t certificateType, + Commands::CertificateChainRequest::DecodableType & commandData) { CHIP_ERROR err = CHIP_NO_ERROR; @@ -523,8 +532,10 @@ bool emberAfOperationalCredentialsClusterCertificateChainRequestCallback(Endpoin return true; } -bool emberAfOperationalCredentialsClusterAttestationRequestCallback(EndpointId endpoint, app::CommandHandler * commandObj, - ByteSpan attestationNonce) +bool emberAfOperationalCredentialsClusterAttestationRequestCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, ByteSpan attestationNonce, + Commands::AttestationRequest::DecodableType & commandData) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -607,8 +618,10 @@ bool emberAfOperationalCredentialsClusterAttestationRequestCallback(EndpointId e return true; } -bool emberAfOperationalCredentialsClusterOpCSRRequestCallback(EndpointId endpoint, app::CommandHandler * commandObj, - ByteSpan CSRNonce) +bool emberAfOperationalCredentialsClusterOpCSRRequestCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + ByteSpan CSRNonce, + Commands::OpCSRRequest::DecodableType & commandData) { CHIP_ERROR err = CHIP_NO_ERROR; @@ -675,8 +688,9 @@ bool emberAfOperationalCredentialsClusterOpCSRRequestCallback(EndpointId endpoin return true; } -bool emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback(EndpointId endpoint, app::CommandHandler * commandObj, - ByteSpan RootCertificate) +bool emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback( + app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, EndpointId endpoint, ByteSpan RootCertificate, + Commands::AddTrustedRootCertificate::DecodableType & commandData) { EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; @@ -695,8 +709,9 @@ bool emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback(Endpo return true; } -bool emberAfOperationalCredentialsClusterRemoveTrustedRootCertificateCallback(EndpointId endpoint, app::CommandHandler * commandObj, - ByteSpan TrustedRootIdentifier) +bool emberAfOperationalCredentialsClusterRemoveTrustedRootCertificateCallback( + app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + ByteSpan TrustedRootIdentifier, Commands::RemoveTrustedRootCertificate::DecodableType & commandData) { EmberAfStatus status = EMBER_ZCL_STATUS_FAILURE; emberAfSendImmediateDefaultResponse(status); diff --git a/src/app/clusters/ota-provider/ota-provider.cpp b/src/app/clusters/ota-provider/ota-provider.cpp index 5e7142d5373170..fc7087722db5fa 100644 --- a/src/app/clusters/ota-provider/ota-provider.cpp +++ b/src/app/clusters/ota-provider/ota-provider.cpp @@ -21,9 +21,11 @@ #include #include #include +#include #include #include #include +#include #include #include @@ -32,6 +34,7 @@ #include "ota-provider.h" using namespace chip; +using namespace chip::app::Clusters::OtaSoftwareUpdateProvider; using chip::app::Clusters::OTAProviderDelegate; namespace { @@ -68,8 +71,11 @@ bool SendStatusIfDelegateNull(EndpointId endpoint) * @param newVersion The SoftwareVersion value of the new Software Image that the client is ready to apply. */ -bool emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestCallback(EndpointId endpoint, app::CommandHandler * commandObj, - ByteSpan updateToken, uint32_t newVersion) +bool emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, ByteSpan updateToken, + uint32_t newVersion, + Commands::ApplyUpdateRequest::DecodableType & commandData) { EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; OTAProviderDelegate * delegate = GetDelegate(endpoint); @@ -105,9 +111,11 @@ bool emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestCallback(EndpointI * OTA Requestor's Basic Information Cluster. */ -bool emberAfOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedCallback(chip::EndpointId endpoint, - chip::app::CommandHandler * commandObj, - chip::ByteSpan updateToken, uint32_t softwareVersion) +bool emberAfOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, chip::ByteSpan updateToken, + uint32_t softwareVersion, + Commands::NotifyUpdateApplied::DecodableType & commandData) { EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; OTAProviderDelegate * delegate = GetDelegate(endpoint); @@ -151,11 +159,10 @@ bool emberAfOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedCallback(chip::En * @param metadataForProvider Optional, max 512 octets. A TLV-encoded Vendor-specific payload. */ -bool emberAfOtaSoftwareUpdateProviderClusterQueryImageCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint16_t vendorId, uint16_t productId, uint16_t hardwareVersion, - uint32_t softwareVersion, uint8_t protocolsSupported, - uint8_t * location, bool requestorCanConsent, - chip::ByteSpan metadataForProvider) +bool emberAfOtaSoftwareUpdateProviderClusterQueryImageCallback( + app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, EndpointId endpoint, uint16_t vendorId, + uint16_t productId, uint16_t hardwareVersion, uint32_t softwareVersion, uint8_t protocolsSupported, uint8_t * location, + bool requestorCanConsent, chip::ByteSpan metadataForProvider, Commands::QueryImage::DecodableType & commandData) { EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; OTAProviderDelegate * delegate = GetDelegate(endpoint); diff --git a/src/app/clusters/scenes/scenes.cpp b/src/app/clusters/scenes/scenes.cpp index f399238ddb8b69..a098de84aebf42 100644 --- a/src/app/clusters/scenes/scenes.cpp +++ b/src/app/clusters/scenes/scenes.cpp @@ -43,8 +43,10 @@ #include #include #include +#include #include #include +#include #include #ifdef EMBER_AF_PLUGIN_GROUPS_SERVER @@ -56,6 +58,7 @@ #endif using namespace chip; +using namespace chip::app::Clusters::Scenes; uint8_t emberAfPluginScenesServerEntriesInUse = 0; #if !defined(EMBER_AF_PLUGIN_SCENES_USE_TOKENS) || defined(EZSP_HOST) @@ -216,20 +219,25 @@ void emAfPluginScenesServerPrintInfo(void) } } -bool emberAfScenesClusterAddSceneCallback(EndpointId endpoint, app::CommandHandler * commandObj, GroupId groupId, uint8_t sceneId, - uint16_t transitionTime, uint8_t * sceneName, uint8_t * extensionFieldSets) +bool emberAfScenesClusterAddSceneCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, GroupId groupId, uint8_t sceneId, uint16_t transitionTime, + uint8_t * sceneName, uint8_t * extensionFieldSets, + Commands::AddScene::DecodableType & commandData) { return emberAfPluginScenesServerParseAddScene(commandObj, emberAfCurrentCommand(), groupId, sceneId, transitionTime, sceneName, extensionFieldSets); } -bool emberAfScenesClusterViewSceneCallback(EndpointId endpoint, app::CommandHandler * commandObj, GroupId groupId, uint8_t sceneId) +bool emberAfScenesClusterViewSceneCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, GroupId groupId, uint8_t sceneId, + Commands::ViewScene::DecodableType & commandData) { return emberAfPluginScenesServerParseViewScene(commandObj, emberAfCurrentCommand(), groupId, sceneId); } -bool emberAfScenesClusterRemoveSceneCallback(EndpointId endpoint, app::CommandHandler * commandObj, GroupId groupId, - uint8_t sceneId) +bool emberAfScenesClusterRemoveSceneCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, GroupId groupId, uint8_t sceneId, + Commands::RemoveScene::DecodableType & commandData) { EmberAfStatus status = EMBER_ZCL_STATUS_NOT_FOUND; CHIP_ERROR err = CHIP_NO_ERROR; @@ -283,7 +291,9 @@ bool emberAfScenesClusterRemoveSceneCallback(EndpointId endpoint, app::CommandHa return true; } -bool emberAfScenesClusterRemoveAllScenesCallback(EndpointId endpoint, app::CommandHandler * commandObj, GroupId groupId) +bool emberAfScenesClusterRemoveAllScenesCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, GroupId groupId, + Commands::RemoveAllScenes::DecodableType & commandData) { EmberAfStatus status = EMBER_ZCL_STATUS_INVALID_FIELD; CHIP_ERROR err = CHIP_NO_ERROR; @@ -332,7 +342,9 @@ bool emberAfScenesClusterRemoveAllScenesCallback(EndpointId endpoint, app::Comma return true; } -bool emberAfScenesClusterStoreSceneCallback(EndpointId endpoint, app::CommandHandler * commandObj, GroupId groupId, uint8_t sceneId) +bool emberAfScenesClusterStoreSceneCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, GroupId groupId, uint8_t sceneId, + Commands::StoreScene::DecodableType & commandData) { EmberAfStatus status; CHIP_ERROR err = CHIP_NO_ERROR; @@ -363,8 +375,9 @@ bool emberAfScenesClusterStoreSceneCallback(EndpointId endpoint, app::CommandHan return true; } -bool emberAfScenesClusterRecallSceneCallback(EndpointId endpoint, app::CommandHandler * commandObj, GroupId groupId, - uint8_t sceneId, uint16_t transitionTime) +bool emberAfScenesClusterRecallSceneCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, GroupId groupId, uint8_t sceneId, uint16_t transitionTime, + Commands::RecallScene::DecodableType & commandData) { // NOTE: TransitionTime field in the RecallScene command is currently // ignored. Per Zigbee Alliance ZCL 7 (07-5123-07): @@ -397,7 +410,9 @@ bool emberAfScenesClusterRecallSceneCallback(EndpointId endpoint, app::CommandHa return true; } -bool emberAfScenesClusterGetSceneMembershipCallback(EndpointId endpoint, app::CommandHandler * commandObj, GroupId groupId) +bool emberAfScenesClusterGetSceneMembershipCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, GroupId groupId, + Commands::GetSceneMembership::DecodableType & commandData) { CHIP_ERROR err = CHIP_NO_ERROR; EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; diff --git a/src/app/clusters/software_diagnostics_server/software_diagnostics_server.cpp b/src/app/clusters/software_diagnostics_server/software_diagnostics_server.cpp index 83022ec828c36a..3e520df4718e84 100644 --- a/src/app/clusters/software_diagnostics_server/software_diagnostics_server.cpp +++ b/src/app/clusters/software_diagnostics_server/software_diagnostics_server.cpp @@ -16,10 +16,12 @@ */ #include +#include #include #include #include #include +#include #include #include #include @@ -29,6 +31,7 @@ using namespace chip; using namespace chip::app; using namespace chip::app::Clusters; +using namespace chip::app::Clusters::SoftwareDiagnostics; using namespace chip::app::Clusters::SoftwareDiagnostics::Attributes; using chip::DeviceLayer::PlatformManager; @@ -94,7 +97,9 @@ CHIP_ERROR SoftwareDiagosticsAttrAccess::ReadIfSupported(CHIP_ERROR (PlatformMan } } // anonymous namespace -bool emberAfSoftwareDiagnosticsClusterResetWatermarksCallback(EndpointId endpoint, app::CommandHandler * commandObj) +bool emberAfSoftwareDiagnosticsClusterResetWatermarksCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + Commands::ResetWatermarks::DecodableType & commandData) { uint64_t currentHeapUsed; diff --git a/src/app/clusters/target-navigator-server/target-navigator-server.cpp b/src/app/clusters/target-navigator-server/target-navigator-server.cpp index 66d8213fa50561..b0dc1883a5ec8e 100644 --- a/src/app/clusters/target-navigator-server/target-navigator-server.cpp +++ b/src/app/clusters/target-navigator-server/target-navigator-server.cpp @@ -24,13 +24,16 @@ #include #include +#include #include #include #include +#include #include #include using namespace chip; +using namespace chip::app::Clusters::TargetNavigator; TargetNavigatorResponse targetNavigatorClusterNavigateTarget(uint8_t target, std::string data); @@ -52,8 +55,10 @@ void sendResponse(app::CommandHandler * command, TargetNavigatorResponse respons } } -bool emberAfTargetNavigatorClusterNavigateTargetCallback(EndpointId endpoint, app::CommandHandler * command, uint8_t target, - uint8_t * data) +bool emberAfTargetNavigatorClusterNavigateTargetCallback(app::CommandHandler * command, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + uint8_t target, uint8_t * data, + Commands::NavigateTarget::DecodableType & commandData) { // TODO: char is not null terminated, verify this code once #7963 gets merged. std::string dataString(reinterpret_cast(data)); diff --git a/src/app/clusters/test-cluster-server/test-cluster-server.cpp b/src/app/clusters/test-cluster-server/test-cluster-server.cpp index f517274e99faad..2144da3175d0af 100644 --- a/src/app/clusters/test-cluster-server/test-cluster-server.cpp +++ b/src/app/clusters/test-cluster-server/test-cluster-server.cpp @@ -24,9 +24,11 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -148,7 +150,8 @@ void emberAfPluginTestClusterServerInitCallback(void) } } -bool emberAfTestClusterClusterTestCallback(EndpointId endpoint, app::CommandHandler *) +bool emberAfTestClusterClusterTestCallback(app::CommandHandler *, const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + Commands::Test::DecodableType & commandData) { emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_SUCCESS); return true; @@ -177,18 +180,22 @@ bool sendNumericResponse(EndpointId endpoint, app::CommandHandler * apCommandObj return true; } -bool emberAfTestClusterClusterTestSpecificCallback(EndpointId endpoint, app::CommandHandler * apCommandObj) +bool emberAfTestClusterClusterTestSpecificCallback(app::CommandHandler * apCommandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, Commands::TestSpecific::DecodableType & commandData) { return sendNumericResponse(endpoint, apCommandObj, Commands::TestSpecificResponse::Id, 7); } -bool emberAfTestClusterClusterTestNotHandledCallback(EndpointId endpoint, app::CommandHandler *) +bool emberAfTestClusterClusterTestNotHandledCallback(app::CommandHandler *, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, Commands::TestNotHandled::DecodableType & commandData) { return false; } -bool emberAfTestClusterClusterTestAddArgumentsCallback(EndpointId endpoint, app::CommandHandler * apCommandObj, uint8_t arg1, - uint8_t arg2) +bool emberAfTestClusterClusterTestAddArgumentsCallback(app::CommandHandler * apCommandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + uint8_t arg1, uint8_t arg2, + Commands::TestAddArguments::DecodableType & commandData) { if (arg1 > UINT8_MAX - arg2) { diff --git a/src/app/clusters/thermostat-server/thermostat-server.cpp b/src/app/clusters/thermostat-server/thermostat-server.cpp index b79f4e9a95d11b..497d588bbb74d4 100644 --- a/src/app/clusters/thermostat-server/thermostat-server.cpp +++ b/src/app/clusters/thermostat-server/thermostat-server.cpp @@ -25,13 +25,16 @@ #include #include #include +#include #include #include #include #include +#include #include using namespace chip; +using namespace chip::app::Clusters::Thermostat; using namespace chip::app::Clusters::Thermostat::Attributes; constexpr int16_t kDefaultAbsMinHeatSetpointLimit = 700; // 7C (44.5 F) is the default @@ -253,27 +256,35 @@ EmberAfStatus emberAfThermostatClusterServerPreAttributeChangedCallback(chip::En return status; } -bool emberAfThermostatClusterClearWeeklyScheduleCallback(EndpointId aEndpointId, chip::app::CommandHandler * commandObj) +bool emberAfThermostatClusterClearWeeklyScheduleCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId aEndpointId, + Commands::ClearWeeklySchedule::DecodableType & commandData) { // TODO return false; } -bool emberAfThermostatClusterGetRelayStatusLogCallback(EndpointId aEndpointId, chip::app::CommandHandler * commandObj) +bool emberAfThermostatClusterGetRelayStatusLogCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId aEndpointId, + Commands::GetRelayStatusLog::DecodableType & commandData) { // TODO return false; } -bool emberAfThermostatClusterGetWeeklyScheduleCallback(EndpointId aEndpointId, chip::app::CommandHandler * commandObj, - uint8_t daysToReturn, uint8_t modeToReturn) +bool emberAfThermostatClusterGetWeeklyScheduleCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId aEndpointId, + uint8_t daysToReturn, uint8_t modeToReturn, + Commands::GetWeeklySchedule::DecodableType & commandData) { // TODO return false; } -bool emberAfThermostatClusterSetWeeklyScheduleCallback(EndpointId aEndpointId, chip::app::CommandHandler * commandObj, +bool emberAfThermostatClusterSetWeeklyScheduleCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId aEndpointId, uint8_t numberOfTransitionsForSequence, uint8_t daysOfWeekForSequence, - uint8_t modeForSequence, uint8_t * payload) + uint8_t modeForSequence, uint8_t * payload, + Commands::SetWeeklySchedule::DecodableType & commandData) { // TODO return false; @@ -422,8 +433,10 @@ int16_t EnforceCoolingSetpointLimits(int16_t CoolingSetpoint, EndpointId endpoin return CoolingSetpoint; } -bool emberAfThermostatClusterSetpointRaiseLowerCallback(EndpointId aEndpointId, chip::app::CommandHandler * commandObj, - uint8_t mode, int8_t amount) +bool emberAfThermostatClusterSetpointRaiseLowerCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId aEndpointId, + uint8_t mode, int8_t amount, + Commands::SetpointRaiseLower::DecodableType & commandData) { int16_t HeatingSetpoint = kDefaultHeatingSetpoint, CoolingSetpoint = kDefaultCoolingSetpoint; // Set to defaults to be safe EmberAfStatus status = EMBER_ZCL_STATUS_FAILURE; diff --git a/src/app/clusters/thread_network_diagnostics_server/thread_network_diagnostics_server.cpp b/src/app/clusters/thread_network_diagnostics_server/thread_network_diagnostics_server.cpp index f89fc496bcfc72..fdcd7d97bae7bd 100644 --- a/src/app/clusters/thread_network_diagnostics_server/thread_network_diagnostics_server.cpp +++ b/src/app/clusters/thread_network_diagnostics_server/thread_network_diagnostics_server.cpp @@ -16,10 +16,12 @@ */ #include +#include #include #include #include #include +#include #include #include #include @@ -33,6 +35,7 @@ using namespace chip; using namespace chip::app; using namespace chip::app::Clusters; +using namespace chip::app::Clusters::ThreadNetworkDiagnostics; using namespace chip::app::Clusters::ThreadNetworkDiagnostics::Attributes; using namespace chip::DeviceLayer; @@ -74,7 +77,9 @@ CHIP_ERROR ThreadDiagosticsAttrAccess::Read(ClusterInfo & aClusterInfo, const At } } // anonymous namespace -bool emberAfThreadNetworkDiagnosticsClusterResetCountsCallback(EndpointId endpoint, app::CommandHandler * commandObj) +bool emberAfThreadNetworkDiagnosticsClusterResetCountsCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + Commands::ResetCounts::DecodableType & commandData) { EmberAfStatus status = ThreadNetworkDiagnostics::Attributes::OverrunCount::Set(endpoint, 0); if (status != EMBER_ZCL_STATUS_SUCCESS) diff --git a/src/app/clusters/tv-channel-server/tv-channel-server.cpp b/src/app/clusters/tv-channel-server/tv-channel-server.cpp index 5fd96c8bc697e5..ebee8b104f8655 100644 --- a/src/app/clusters/tv-channel-server/tv-channel-server.cpp +++ b/src/app/clusters/tv-channel-server/tv-channel-server.cpp @@ -40,17 +40,20 @@ #include #include +#include #include #include +#include #include using namespace chip; +using namespace chip::app::Clusters::TvChannel; -TvChannelInfo tvChannelClusterChangeChannel(std::string match); +::TvChannelInfo tvChannelClusterChangeChannel(std::string match); bool tvChannelClusterChangeChannelByNumber(uint16_t majorNumer, uint16_t minorNumber); bool tvChannelClusterSkipChannel(uint16_t count); -void sendResponse(app::CommandHandler * command, TvChannelInfo channelInfo) +void sendResponse(app::CommandHandler * command, ::TvChannelInfo channelInfo) { CHIP_ERROR err = CHIP_NO_ERROR; app::CommandPathParams cmdParams = { emberAfCurrentEndpoint(), /* group id */ 0, ZCL_TV_CHANNEL_CLUSTER_ID, @@ -70,7 +73,9 @@ void sendResponse(app::CommandHandler * command, TvChannelInfo channelInfo) } } -bool emberAfTvChannelClusterChangeChannelCallback(EndpointId endpoint, app::CommandHandler * command, uint8_t * match) +bool emberAfTvChannelClusterChangeChannelCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint8_t * match, + Commands::ChangeChannel::DecodableType & commandData) { // TODO: char is not null terminated, verify this code once #7963 gets merged. std::string matchString(reinterpret_cast(match)); @@ -81,8 +86,10 @@ bool emberAfTvChannelClusterChangeChannelCallback(EndpointId endpoint, app::Comm return true; } -bool emberAfTvChannelClusterChangeChannelByNumberCallback(EndpointId endpoint, app::CommandHandler * command, uint16_t majorNumber, - uint16_t minorNumber) +bool emberAfTvChannelClusterChangeChannelByNumberCallback(app::CommandHandler * command, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + uint16_t majorNumber, uint16_t minorNumber, + Commands::ChangeChannelByNumber::DecodableType & commandData) { bool success = tvChannelClusterChangeChannelByNumber(majorNumber, minorNumber); EmberAfStatus status = success ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; @@ -90,7 +97,9 @@ bool emberAfTvChannelClusterChangeChannelByNumberCallback(EndpointId endpoint, a return true; } -bool emberAfTvChannelClusterSkipChannelCallback(EndpointId endpoint, app::CommandHandler * command, uint16_t count) +bool emberAfTvChannelClusterSkipChannelCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, uint16_t count, + Commands::SkipChannel::DecodableType & commandData) { bool success = tvChannelClusterSkipChannel(count); EmberAfStatus status = success ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; diff --git a/src/app/clusters/wifi_network_diagnostics_server/wifi_network_diagnostics_server.cpp b/src/app/clusters/wifi_network_diagnostics_server/wifi_network_diagnostics_server.cpp index 0fc10a46f3c061..ed1d6889c0afc6 100644 --- a/src/app/clusters/wifi_network_diagnostics_server/wifi_network_diagnostics_server.cpp +++ b/src/app/clusters/wifi_network_diagnostics_server/wifi_network_diagnostics_server.cpp @@ -16,10 +16,12 @@ */ #include +#include #include #include #include #include +#include #include #include #include @@ -29,6 +31,7 @@ using namespace chip; using namespace chip::app; using namespace chip::app::Clusters; +using namespace chip::app::Clusters::WiFiNetworkDiagnostics; using namespace chip::app::Clusters::WiFiNetworkDiagnostics::Attributes; using chip::DeviceLayer::ConnectivityManager; @@ -78,7 +81,7 @@ CHIP_ERROR WiFiDiagosticsAttrAccess::Read(ClusterInfo & aClusterInfo, const Attr *aDataRead = true; switch (aClusterInfo.mFieldId) { - case SecurityType::Id: { + case Attributes::SecurityType::Id: { return ReadIfSupported(&ConnectivityManager::GetWiFiSecurityType, aEncoder); } case WiFiVersion::Id: { @@ -123,7 +126,9 @@ CHIP_ERROR WiFiDiagosticsAttrAccess::Read(ClusterInfo & aClusterInfo, const Attr } } // anonymous namespace -bool emberAfWiFiNetworkDiagnosticsClusterResetCountsCallback(EndpointId endpoint, app::CommandHandler * commandObj) +bool emberAfWiFiNetworkDiagnosticsClusterResetCountsCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + Commands::ResetCounts::DecodableType & commandData) { EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; diff --git a/src/app/clusters/window-covering-server/window-covering-server.cpp b/src/app/clusters/window-covering-server/window-covering-server.cpp index aa96a7218f1b64..0e6b0650c7a253 100644 --- a/src/app/clusters/window-covering-server/window-covering-server.cpp +++ b/src/app/clusters/window-covering-server/window-covering-server.cpp @@ -37,8 +37,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -51,6 +53,7 @@ #include #endif // EMBER_AF_PLUGIN_SCENES +using namespace chip; using namespace chip::app::Clusters::WindowCovering; #define WC_PERCENT100THS_MAX 10000 @@ -378,7 +381,8 @@ void emberAfWindowCoveringClusterInitCallback(chip::EndpointId endpoint) /** * @brief Cluster UpOrOpen Command callback (from client) */ -bool emberAfWindowCoveringClusterUpOrOpenCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj) +bool emberAfWindowCoveringClusterUpOrOpenCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, Commands::UpOrOpen::DecodableType & commandData) { emberAfWindowCoveringClusterPrint("UpOrOpen command received"); if (HasFeature(endpoint, Features::Lift)) @@ -396,7 +400,8 @@ bool emberAfWindowCoveringClusterUpOrOpenCallback(chip::EndpointId endpoint, chi /** * @brief Cluster DownOrClose Command callback (from client) */ -bool emberAfWindowCoveringClusterDownOrCloseCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj) +bool emberAfWindowCoveringClusterDownOrCloseCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, Commands::DownOrClose::DecodableType & commandData) { emberAfWindowCoveringClusterPrint("DownOrClose command received"); if (HasFeature(endpoint, Features::Lift)) @@ -415,7 +420,8 @@ bool emberAfWindowCoveringClusterDownOrCloseCallback(chip::EndpointId endpoint, * @brief Cluster StopMotion Command callback (from client) */ bool __attribute__((weak)) -emberAfWindowCoveringClusterStopMotionCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj) +emberAfWindowCoveringClusterStopMotionCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + EndpointId endpoint, Commands::StopMotion::DecodableType & fields) { emberAfWindowCoveringClusterPrint("StopMotion command received"); @@ -426,8 +432,9 @@ emberAfWindowCoveringClusterStopMotionCallback(chip::EndpointId endpoint, chip:: /** * @brief Cluster GoToLiftValue Command callback (from client) */ -bool emberAfWindowCoveringClusterGoToLiftValueCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint16_t liftValue) +bool emberAfWindowCoveringClusterGoToLiftValueCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + uint16_t liftValue, Commands::GoToLiftValue::DecodableType & commandData) { bool hasLift = HasFeature(endpoint, Features::Lift); bool isPositionAware = HasFeature(endpoint, Features::PositionAware); @@ -449,8 +456,10 @@ bool emberAfWindowCoveringClusterGoToLiftValueCallback(chip::EndpointId endpoint /** * @brief Cluster GoToLiftPercentage Command callback (from client) */ -bool emberAfWindowCoveringClusterGoToLiftPercentageCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t liftPercentageValue, uint16_t liftPercent100thsValue) +bool emberAfWindowCoveringClusterGoToLiftPercentageCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + uint8_t liftPercentageValue, uint16_t liftPercent100thsValue, + Commands::GoToLiftPercentage::DecodableType & commandData) { bool hasLift = HasFeature(endpoint, Features::Lift); bool isPositionAware = HasFeature(endpoint, Features::PositionAware); @@ -473,8 +482,9 @@ bool emberAfWindowCoveringClusterGoToLiftPercentageCallback(chip::EndpointId end /** * @brief Cluster GoToTiltValue Command callback (from client) */ -bool emberAfWindowCoveringClusterGoToTiltValueCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint16_t tiltValue) +bool emberAfWindowCoveringClusterGoToTiltValueCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + uint16_t tiltValue, Commands::GoToTiltValue::DecodableType & commandData) { bool hasTilt = HasFeature(endpoint, Features::Tilt); bool isPositionAware = HasFeature(endpoint, Features::PositionAware); @@ -496,8 +506,10 @@ bool emberAfWindowCoveringClusterGoToTiltValueCallback(chip::EndpointId endpoint /** * @brief Cluster GoToTiltPercentage Command callback (from client) */ -bool emberAfWindowCoveringClusterGoToTiltPercentageCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t tiltPercentageValue, uint16_t tiltPercent100thsValue) +bool emberAfWindowCoveringClusterGoToTiltPercentageCallback(app::CommandHandler * commandObj, + const app::ConcreteCommandPath & commandPath, EndpointId endpoint, + uint8_t tiltPercentageValue, uint16_t tiltPercent100thsValue, + Commands::GoToTiltPercentage::DecodableType & commandData) { bool hasTilt = HasFeature(endpoint, Features::Tilt); bool isPositionAware = HasFeature(endpoint, Features::PositionAware); diff --git a/src/app/zap-templates/partials/im_command_handler_cluster_commands.zapt b/src/app/zap-templates/partials/im_command_handler_cluster_commands.zapt index c79aedd09ce422..123ec9a2e2b6e3 100644 --- a/src/app/zap-templates/partials/im_command_handler_cluster_commands.zapt +++ b/src/app/zap-templates/partials/im_command_handler_cluster_commands.zapt @@ -1,3 +1,6 @@ +{{#if (isServer parent.side)}} +Commands::{{asUpperCamelCase name}}::DecodableType commandData; +{{/if}} {{#if (zcl_command_arguments_count this.id)}} expectArgumentCount = {{ zcl_command_arguments_count this.id }}; {{#zcl_command_arguments}} @@ -71,7 +74,12 @@ if (CHIP_END_OF_TLV == TLVError) if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && {{zcl_command_arguments_count this.id}} == validArgumentCount) { {{/if}} -wasHandled = emberAf{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Callback(aEndpointId, apCommandObj{{#zcl_command_arguments}}, {{#if (isCharString type)}}const_cast({{asSymbol label}}){{else}}{{asSymbol label}}{{/if}}{{/zcl_command_arguments}}); +{{! TODO: if the command has a response command defined, put its id in the command path. }} +{{#if (isServer parent.side)}} +wasHandled = emberAf{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Callback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, {{#zcl_command_arguments}}{{#if (isCharString type)}}const_cast({{asSymbol label}}){{else}}{{asSymbol label}}{{/if}},{{/zcl_command_arguments}} commandData); +{{else}} +wasHandled = emberAf{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Callback(aCommandPath.mEndpointId, apCommandObj{{#zcl_command_arguments}}, {{#if (isCharString type)}}const_cast({{asSymbol label}}){{else}}{{asSymbol label}}{{/if}}{{/zcl_command_arguments}}); +{{/if}} {{#if (zcl_command_arguments_count this.id)}} } {{/if}} diff --git a/src/app/zap-templates/templates/app/callback.zapt b/src/app/zap-templates/templates/app/callback.zapt index 9da40b0e8f0202..c4849ee9ab98d9 100644 --- a/src/app/zap-templates/templates/app/callback.zapt +++ b/src/app/zap-templates/templates/app/callback.zapt @@ -4,12 +4,14 @@ #pragma once #include +#include #include #include #include #include #include +#include #include /** @brief Cluster Init @@ -172,9 +174,15 @@ void emberAf{{asUpperCamelCase label}}ClusterClientTickCallback(chip::EndpointId /** * @brief {{parent.name}} Cluster {{name}} Command callback (from {{source}}) */ + {{#if (isServer source)}} bool emberAf{{asUpperCamelCase parent.label}}Cluster{{asUpperCamelCase name}}Callback(chip::EndpointId endpoint, - {{#if (isServer source)}}chip::app::CommandSender{{else}}chip::app::CommandHandler{{/if}} * commandObj + chip::app::CommandSender * commandObj {{#zcl_command_arguments}}, {{asUnderlyingZclType type}} {{asSymbol label}}{{/zcl_command_arguments}}); + {{else}} +bool emberAf{{asUpperCamelCase parent.label}}Cluster{{asUpperCamelCase name}}Callback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + {{#zcl_command_arguments}}{{asUnderlyingZclType type}} {{asSymbol label}},{{/zcl_command_arguments}} chip::app::Clusters::{{asUpperCamelCase parent.label}}::Commands::{{asUpperCamelCase name}}::DecodableType & fields); +{{/if}} {{/zcl_commands}} {{/zcl_clusters}} diff --git a/src/app/zap-templates/templates/app/cluster-objects.zapt b/src/app/zap-templates/templates/app/cluster-objects.zapt index 103ca07d40b822..c97a7f0b59cc7a 100644 --- a/src/app/zap-templates/templates/app/cluster-objects.zapt +++ b/src/app/zap-templates/templates/app/cluster-objects.zapt @@ -63,6 +63,20 @@ namespace {{name}} { } // namespace {{name}} {{/zcl_structs}} +{{#zcl_commands}} +{{#first}} +namespace Commands { +{{/first}} +namespace {{asUpperCamelCase name}} { +struct Type {}; + +struct DecodableType {}; +} // namespace {{asUpperCamelCase name}} + +{{#last}} +} // namespace Commands +{{/last}} +{{/zcl_commands}} } // namespace {{asUpperCamelCase name}} {{/zcl_clusters}} 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 5397687945bb46..4502f4f66a4bb3 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 @@ -5,6 +5,7 @@ #include #include +#include #include #include #include "app/util/util.h" @@ -18,16 +19,16 @@ namespace chip { namespace app { namespace { -void ReportCommandUnsupported(Command * aCommandObj, EndpointId aEndpointId, ClusterId aClusterId, CommandId aCommandId) +void ReportCommandUnsupported(Command * aCommandObj, const ConcreteCommandPath & aCommandPath) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - aClusterId, - aCommandId, + aCommandPath.mClusterId, + aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; aCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kNotFound, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandId), ChipLogValueMEI(aClusterId)); + ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); } } // anonymous namespace @@ -39,7 +40,7 @@ namespace Clusters { {{#if (user_cluster_has_enabled_command name side)}} namespace {{asUpperCamelCase name}} { -void Dispatch{{asUpperCamelCase side}}Command({{#if (isServer side)}}CommandHandler{{else}}CommandSender{{/if}} * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void Dispatch{{asUpperCamelCase side}}Command({{#if (isServer side)}}CommandHandler{{else}}CommandSender{{/if}} * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { {{#chip_available_cluster_commands}} {{#first}} @@ -54,7 +55,7 @@ void Dispatch{{asUpperCamelCase side}}Command({{#if (isServer side)}}CommandHand uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { {{/first}} case Commands::{{asUpperCamelCase name}}::Id: { @@ -64,7 +65,7 @@ void Dispatch{{asUpperCamelCase side}}Command({{#if (isServer side)}}CommandHand {{#last}} default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, {{asUpperCamelCase parent.name}}::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -72,10 +73,10 @@ void Dispatch{{asUpperCamelCase side}}Command({{#if (isServer side)}}CommandHand if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId {{asUpperCamelCase parent.name}}::Id, - aCommandId, + aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); @@ -87,7 +88,7 @@ void Dispatch{{asUpperCamelCase side}}Command({{#if (isServer side)}}CommandHand } {{/last}} {{else}} - ReportCommandUnsupported(apCommandObj, aEndpointId, {{asUpperCamelCase parent.name}}::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); {{/chip_available_cluster_commands}} } @@ -104,6 +105,7 @@ void DispatchSingleClusterCommand(ClusterId aClusterId, CommandId aCommandId, En 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); TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); switch (aClusterId) @@ -111,7 +113,7 @@ void DispatchSingleClusterCommand(ClusterId aClusterId, CommandId aCommandId, En {{#chip_server_clusters}} {{#if (user_cluster_has_enabled_command name side)}} case Clusters::{{asUpperCamelCase name}}::Id: - Clusters::{{asUpperCamelCase name}}::Dispatch{{asUpperCamelCase side}}Command(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::{{asUpperCamelCase name}}::Dispatch{{asUpperCamelCase side}}Command(apCommandObj, commandPath, aReader); break; {{/if}} {{/chip_server_clusters}} @@ -138,6 +140,7 @@ void DispatchSingleClusterResponseCommand(ClusterId aClusterId, CommandId aComma 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); TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); switch (aClusterId) @@ -145,7 +148,7 @@ void DispatchSingleClusterResponseCommand(ClusterId aClusterId, CommandId aComma {{#chip_client_clusters}} {{#if (user_cluster_has_enabled_command name side)}} case Clusters::{{asUpperCamelCase name}}::Id: - Clusters::{{asUpperCamelCase name}}::Dispatch{{asUpperCamelCase side}}Command(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::{{asUpperCamelCase name}}::Dispatch{{asUpperCamelCase side}}Command(apCommandObj, commandPath, aReader); break; {{/if}} {{/chip_client_clusters}} diff --git a/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp index 9f3e0eb3b7703c..1ff7ae4305f89b 100644 --- a/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp @@ -23,6 +23,7 @@ #include "app/util/util.h" #include #include +#include #include #include @@ -35,15 +36,16 @@ namespace chip { namespace app { namespace { -void ReportCommandUnsupported(Command * aCommandObj, EndpointId aEndpointId, ClusterId aClusterId, CommandId aCommandId) +void ReportCommandUnsupported(Command * aCommandObj, const ConcreteCommandPath & aCommandPath) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - aClusterId, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + aCommandPath.mClusterId, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; aCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kNotFound, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandId), - ChipLogValueMEI(aClusterId)); + ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, + ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); } } // anonymous namespace @@ -53,7 +55,7 @@ namespace Clusters { namespace AdministratorCommissioning { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -66,9 +68,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::OpenBasicCommissioningWindow::Id: { + Commands::OpenBasicCommissioningWindow::DecodableType commandData; expectArgumentCount = 1; uint16_t CommissioningTimeout; bool argExists[1]; @@ -122,12 +125,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfAdministratorCommissioningClusterOpenBasicCommissioningWindowCallback(aEndpointId, apCommandObj, - CommissioningTimeout); + wasHandled = emberAfAdministratorCommissioningClusterOpenBasicCommissioningWindowCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CommissioningTimeout, commandData); } break; } case Commands::OpenCommissioningWindow::Id: { + Commands::OpenCommissioningWindow::DecodableType commandData; expectArgumentCount = 6; uint16_t CommissioningTimeout; chip::ByteSpan PAKEVerifier; @@ -202,18 +206,21 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 6 == validArgumentCount) { wasHandled = emberAfAdministratorCommissioningClusterOpenCommissioningWindowCallback( - aEndpointId, apCommandObj, CommissioningTimeout, PAKEVerifier, Discriminator, Iterations, Salt, PasscodeID); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CommissioningTimeout, PAKEVerifier, Discriminator, + Iterations, Salt, PasscodeID, commandData); } break; } case Commands::RevokeCommissioning::Id: { + Commands::RevokeCommissioning::DecodableType commandData; - wasHandled = emberAfAdministratorCommissioningClusterRevokeCommissioningCallback(aEndpointId, apCommandObj); + wasHandled = emberAfAdministratorCommissioningClusterRevokeCommissioningCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, AdministratorCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -221,9 +228,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - AdministratorCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + AdministratorCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -241,7 +249,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace BarrierControl { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -254,9 +262,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::BarrierControlGoToPercent::Id: { + Commands::BarrierControlGoToPercent::DecodableType commandData; expectArgumentCount = 1; uint8_t percentOpen; bool argExists[1]; @@ -310,18 +319,21 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfBarrierControlClusterBarrierControlGoToPercentCallback(aEndpointId, apCommandObj, percentOpen); + wasHandled = emberAfBarrierControlClusterBarrierControlGoToPercentCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, percentOpen, commandData); } break; } case Commands::BarrierControlStop::Id: { + Commands::BarrierControlStop::DecodableType commandData; - wasHandled = emberAfBarrierControlClusterBarrierControlStopCallback(aEndpointId, apCommandObj); + wasHandled = emberAfBarrierControlClusterBarrierControlStopCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, BarrierControl::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -329,9 +341,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - BarrierControl::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + BarrierControl::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -349,16 +361,16 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace Basic { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { - ReportCommandUnsupported(apCommandObj, aEndpointId, Basic::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); } } // namespace Basic namespace Binding { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -371,9 +383,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::Bind::Id: { + Commands::Bind::DecodableType commandData; expectArgumentCount = 4; chip::NodeId nodeId; chip::GroupId groupId; @@ -439,11 +452,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfBindingClusterBindCallback(aEndpointId, apCommandObj, nodeId, groupId, endpointId, clusterId); + wasHandled = emberAfBindingClusterBindCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, nodeId, + groupId, endpointId, clusterId, commandData); } break; } case Commands::Unbind::Id: { + Commands::Unbind::DecodableType commandData; expectArgumentCount = 4; chip::NodeId nodeId; chip::GroupId groupId; @@ -509,13 +524,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfBindingClusterUnbindCallback(aEndpointId, apCommandObj, nodeId, groupId, endpointId, clusterId); + wasHandled = emberAfBindingClusterUnbindCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, nodeId, + groupId, endpointId, clusterId, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, Binding::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -523,9 +539,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - Binding::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + Binding::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -543,7 +559,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace ColorControl { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -556,9 +572,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ColorLoopSet::Id: { + Commands::ColorLoopSet::DecodableType commandData; expectArgumentCount = 7; uint8_t updateFlags; uint8_t action; @@ -636,12 +653,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 7 == validArgumentCount) { - wasHandled = emberAfColorControlClusterColorLoopSetCallback( - aEndpointId, apCommandObj, updateFlags, action, direction, time, startHue, optionsMask, optionsOverride); + wasHandled = emberAfColorControlClusterColorLoopSetCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + updateFlags, action, direction, time, startHue, + optionsMask, optionsOverride, commandData); } break; } case Commands::EnhancedMoveHue::Id: { + Commands::EnhancedMoveHue::DecodableType commandData; expectArgumentCount = 4; uint8_t moveMode; uint16_t rate; @@ -707,12 +726,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfColorControlClusterEnhancedMoveHueCallback(aEndpointId, apCommandObj, moveMode, rate, - optionsMask, optionsOverride); + wasHandled = + emberAfColorControlClusterEnhancedMoveHueCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + moveMode, rate, optionsMask, optionsOverride, commandData); } break; } case Commands::EnhancedMoveToHue::Id: { + Commands::EnhancedMoveToHue::DecodableType commandData; expectArgumentCount = 5; uint16_t enhancedHue; uint8_t direction; @@ -782,12 +803,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfColorControlClusterEnhancedMoveToHueCallback(aEndpointId, apCommandObj, enhancedHue, direction, - transitionTime, optionsMask, optionsOverride); + wasHandled = emberAfColorControlClusterEnhancedMoveToHueCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, enhancedHue, direction, transitionTime, optionsMask, + optionsOverride, commandData); } break; } case Commands::EnhancedMoveToHueAndSaturation::Id: { + Commands::EnhancedMoveToHueAndSaturation::DecodableType commandData; expectArgumentCount = 5; uint16_t enhancedHue; uint8_t saturation; @@ -858,11 +881,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { wasHandled = emberAfColorControlClusterEnhancedMoveToHueAndSaturationCallback( - aEndpointId, apCommandObj, enhancedHue, saturation, transitionTime, optionsMask, optionsOverride); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, enhancedHue, saturation, transitionTime, optionsMask, + optionsOverride, commandData); } break; } case Commands::EnhancedStepHue::Id: { + Commands::EnhancedStepHue::DecodableType commandData; expectArgumentCount = 5; uint8_t stepMode; uint16_t stepSize; @@ -932,12 +957,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfColorControlClusterEnhancedStepHueCallback(aEndpointId, apCommandObj, stepMode, stepSize, - transitionTime, optionsMask, optionsOverride); + wasHandled = emberAfColorControlClusterEnhancedStepHueCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + stepMode, stepSize, transitionTime, optionsMask, + optionsOverride, commandData); } break; } case Commands::MoveColor::Id: { + Commands::MoveColor::DecodableType commandData; expectArgumentCount = 4; int16_t rateX; int16_t rateY; @@ -1003,12 +1030,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfColorControlClusterMoveColorCallback(aEndpointId, apCommandObj, rateX, rateY, optionsMask, - optionsOverride); + wasHandled = emberAfColorControlClusterMoveColorCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + rateX, rateY, optionsMask, optionsOverride, commandData); } break; } case Commands::MoveColorTemperature::Id: { + Commands::MoveColorTemperature::DecodableType commandData; expectArgumentCount = 6; uint8_t moveMode; uint16_t rate; @@ -1083,12 +1111,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 6 == validArgumentCount) { wasHandled = emberAfColorControlClusterMoveColorTemperatureCallback( - aEndpointId, apCommandObj, moveMode, rate, colorTemperatureMinimum, colorTemperatureMaximum, optionsMask, - optionsOverride); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, moveMode, rate, colorTemperatureMinimum, + colorTemperatureMaximum, optionsMask, optionsOverride, commandData); } break; } case Commands::MoveHue::Id: { + Commands::MoveHue::DecodableType commandData; expectArgumentCount = 4; uint8_t moveMode; uint8_t rate; @@ -1154,12 +1183,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfColorControlClusterMoveHueCallback(aEndpointId, apCommandObj, moveMode, rate, optionsMask, - optionsOverride); + wasHandled = emberAfColorControlClusterMoveHueCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + moveMode, rate, optionsMask, optionsOverride, commandData); } break; } case Commands::MoveSaturation::Id: { + Commands::MoveSaturation::DecodableType commandData; expectArgumentCount = 4; uint8_t moveMode; uint8_t rate; @@ -1225,12 +1255,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfColorControlClusterMoveSaturationCallback(aEndpointId, apCommandObj, moveMode, rate, - optionsMask, optionsOverride); + wasHandled = + emberAfColorControlClusterMoveSaturationCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, moveMode, + rate, optionsMask, optionsOverride, commandData); } break; } case Commands::MoveToColor::Id: { + Commands::MoveToColor::DecodableType commandData; expectArgumentCount = 5; uint16_t colorX; uint16_t colorY; @@ -1300,12 +1332,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfColorControlClusterMoveToColorCallback(aEndpointId, apCommandObj, colorX, colorY, - transitionTime, optionsMask, optionsOverride); + wasHandled = emberAfColorControlClusterMoveToColorCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + colorX, colorY, transitionTime, optionsMask, + optionsOverride, commandData); } break; } case Commands::MoveToColorTemperature::Id: { + Commands::MoveToColorTemperature::DecodableType commandData; expectArgumentCount = 4; uint16_t colorTemperature; uint16_t transitionTime; @@ -1371,12 +1405,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfColorControlClusterMoveToColorTemperatureCallback(aEndpointId, apCommandObj, colorTemperature, - transitionTime, optionsMask, optionsOverride); + wasHandled = emberAfColorControlClusterMoveToColorTemperatureCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, colorTemperature, transitionTime, optionsMask, + optionsOverride, commandData); } break; } case Commands::MoveToHue::Id: { + Commands::MoveToHue::DecodableType commandData; expectArgumentCount = 5; uint8_t hue; uint8_t direction; @@ -1446,12 +1482,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfColorControlClusterMoveToHueCallback(aEndpointId, apCommandObj, hue, direction, transitionTime, - optionsMask, optionsOverride); + wasHandled = emberAfColorControlClusterMoveToHueCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, hue, + direction, transitionTime, optionsMask, optionsOverride, + commandData); } break; } case Commands::MoveToHueAndSaturation::Id: { + Commands::MoveToHueAndSaturation::DecodableType commandData; expectArgumentCount = 5; uint8_t hue; uint8_t saturation; @@ -1521,12 +1559,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfColorControlClusterMoveToHueAndSaturationCallback(aEndpointId, apCommandObj, hue, saturation, - transitionTime, optionsMask, optionsOverride); + wasHandled = emberAfColorControlClusterMoveToHueAndSaturationCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, hue, saturation, transitionTime, optionsMask, + optionsOverride, commandData); } break; } case Commands::MoveToSaturation::Id: { + Commands::MoveToSaturation::DecodableType commandData; expectArgumentCount = 4; uint8_t saturation; uint16_t transitionTime; @@ -1592,12 +1632,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfColorControlClusterMoveToSaturationCallback(aEndpointId, apCommandObj, saturation, - transitionTime, optionsMask, optionsOverride); + wasHandled = emberAfColorControlClusterMoveToSaturationCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, saturation, transitionTime, optionsMask, optionsOverride, + commandData); } break; } case Commands::StepColor::Id: { + Commands::StepColor::DecodableType commandData; expectArgumentCount = 5; int16_t stepX; int16_t stepY; @@ -1667,12 +1709,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfColorControlClusterStepColorCallback(aEndpointId, apCommandObj, stepX, stepY, transitionTime, - optionsMask, optionsOverride); + wasHandled = + emberAfColorControlClusterStepColorCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, stepX, stepY, + transitionTime, optionsMask, optionsOverride, commandData); } break; } case Commands::StepColorTemperature::Id: { + Commands::StepColorTemperature::DecodableType commandData; expectArgumentCount = 7; uint8_t stepMode; uint16_t stepSize; @@ -1751,12 +1795,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 7 == validArgumentCount) { wasHandled = emberAfColorControlClusterStepColorTemperatureCallback( - aEndpointId, apCommandObj, stepMode, stepSize, transitionTime, colorTemperatureMinimum, colorTemperatureMaximum, - optionsMask, optionsOverride); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, stepMode, stepSize, transitionTime, + colorTemperatureMinimum, colorTemperatureMaximum, optionsMask, optionsOverride, commandData); } break; } case Commands::StepHue::Id: { + Commands::StepHue::DecodableType commandData; expectArgumentCount = 5; uint8_t stepMode; uint8_t stepSize; @@ -1826,12 +1871,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfColorControlClusterStepHueCallback(aEndpointId, apCommandObj, stepMode, stepSize, - transitionTime, optionsMask, optionsOverride); + wasHandled = + emberAfColorControlClusterStepHueCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, stepMode, + stepSize, transitionTime, optionsMask, optionsOverride, commandData); } break; } case Commands::StepSaturation::Id: { + Commands::StepSaturation::DecodableType commandData; expectArgumentCount = 5; uint8_t stepMode; uint8_t stepSize; @@ -1901,12 +1948,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfColorControlClusterStepSaturationCallback(aEndpointId, apCommandObj, stepMode, stepSize, - transitionTime, optionsMask, optionsOverride); + wasHandled = emberAfColorControlClusterStepSaturationCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + stepMode, stepSize, transitionTime, optionsMask, + optionsOverride, commandData); } break; } case Commands::StopMoveStep::Id: { + Commands::StopMoveStep::DecodableType commandData; expectArgumentCount = 2; uint8_t optionsMask; uint8_t optionsOverride; @@ -1964,14 +2013,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = - emberAfColorControlClusterStopMoveStepCallback(aEndpointId, apCommandObj, optionsMask, optionsOverride); + wasHandled = emberAfColorControlClusterStopMoveStepCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + optionsMask, optionsOverride, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, ColorControl::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -1979,9 +2028,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - ColorControl::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + ColorControl::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -1999,7 +2048,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace DiagnosticLogs { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -2012,9 +2061,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::RetrieveLogsRequest::Id: { + Commands::RetrieveLogsRequest::DecodableType commandData; expectArgumentCount = 3; uint8_t intent; uint8_t requestedProtocol; @@ -2076,14 +2126,15 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfDiagnosticLogsClusterRetrieveLogsRequestCallback(aEndpointId, apCommandObj, intent, - requestedProtocol, transferFileDesignator); + wasHandled = emberAfDiagnosticLogsClusterRetrieveLogsRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, intent, requestedProtocol, transferFileDesignator, + commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, DiagnosticLogs::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -2091,9 +2142,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - DiagnosticLogs::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + DiagnosticLogs::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -2111,7 +2162,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace DoorLock { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -2124,19 +2175,24 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ClearAllPins::Id: { + Commands::ClearAllPins::DecodableType commandData; - wasHandled = emberAfDoorLockClusterClearAllPinsCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfDoorLockClusterClearAllPinsCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::ClearAllRfids::Id: { + Commands::ClearAllRfids::DecodableType commandData; - wasHandled = emberAfDoorLockClusterClearAllRfidsCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfDoorLockClusterClearAllRfidsCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::ClearHolidaySchedule::Id: { + Commands::ClearHolidaySchedule::DecodableType commandData; expectArgumentCount = 1; uint8_t scheduleId; bool argExists[1]; @@ -2190,11 +2246,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterClearHolidayScheduleCallback(aEndpointId, apCommandObj, scheduleId); + wasHandled = emberAfDoorLockClusterClearHolidayScheduleCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, scheduleId, commandData); } break; } case Commands::ClearPin::Id: { + Commands::ClearPin::DecodableType commandData; expectArgumentCount = 1; uint16_t userId; bool argExists[1]; @@ -2248,11 +2306,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterClearPinCallback(aEndpointId, apCommandObj, userId); + wasHandled = emberAfDoorLockClusterClearPinCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, userId, + commandData); } break; } case Commands::ClearRfid::Id: { + Commands::ClearRfid::DecodableType commandData; expectArgumentCount = 1; uint16_t userId; bool argExists[1]; @@ -2306,11 +2366,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterClearRfidCallback(aEndpointId, apCommandObj, userId); + wasHandled = emberAfDoorLockClusterClearRfidCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, userId, + commandData); } break; } case Commands::ClearWeekdaySchedule::Id: { + Commands::ClearWeekdaySchedule::DecodableType commandData; expectArgumentCount = 2; uint8_t scheduleId; uint16_t userId; @@ -2368,11 +2430,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterClearWeekdayScheduleCallback(aEndpointId, apCommandObj, scheduleId, userId); + wasHandled = emberAfDoorLockClusterClearWeekdayScheduleCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, scheduleId, userId, commandData); } break; } case Commands::ClearYeardaySchedule::Id: { + Commands::ClearYeardaySchedule::DecodableType commandData; expectArgumentCount = 2; uint8_t scheduleId; uint16_t userId; @@ -2430,11 +2494,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterClearYeardayScheduleCallback(aEndpointId, apCommandObj, scheduleId, userId); + wasHandled = emberAfDoorLockClusterClearYeardayScheduleCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, scheduleId, userId, commandData); } break; } case Commands::GetHolidaySchedule::Id: { + Commands::GetHolidaySchedule::DecodableType commandData; expectArgumentCount = 1; uint8_t scheduleId; bool argExists[1]; @@ -2488,11 +2554,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterGetHolidayScheduleCallback(aEndpointId, apCommandObj, scheduleId); + wasHandled = emberAfDoorLockClusterGetHolidayScheduleCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + scheduleId, commandData); } break; } case Commands::GetLogRecord::Id: { + Commands::GetLogRecord::DecodableType commandData; expectArgumentCount = 1; uint16_t logIndex; bool argExists[1]; @@ -2546,11 +2614,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterGetLogRecordCallback(aEndpointId, apCommandObj, logIndex); + wasHandled = emberAfDoorLockClusterGetLogRecordCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + logIndex, commandData); } break; } case Commands::GetPin::Id: { + Commands::GetPin::DecodableType commandData; expectArgumentCount = 1; uint16_t userId; bool argExists[1]; @@ -2604,11 +2674,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterGetPinCallback(aEndpointId, apCommandObj, userId); + wasHandled = + emberAfDoorLockClusterGetPinCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, userId, commandData); } break; } case Commands::GetRfid::Id: { + Commands::GetRfid::DecodableType commandData; expectArgumentCount = 1; uint16_t userId; bool argExists[1]; @@ -2662,11 +2734,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterGetRfidCallback(aEndpointId, apCommandObj, userId); + wasHandled = emberAfDoorLockClusterGetRfidCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, userId, + commandData); } break; } case Commands::GetUserType::Id: { + Commands::GetUserType::DecodableType commandData; expectArgumentCount = 1; uint16_t userId; bool argExists[1]; @@ -2720,11 +2794,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterGetUserTypeCallback(aEndpointId, apCommandObj, userId); + wasHandled = emberAfDoorLockClusterGetUserTypeCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, userId, + commandData); } break; } case Commands::GetWeekdaySchedule::Id: { + Commands::GetWeekdaySchedule::DecodableType commandData; expectArgumentCount = 2; uint8_t scheduleId; uint16_t userId; @@ -2782,11 +2858,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterGetWeekdayScheduleCallback(aEndpointId, apCommandObj, scheduleId, userId); + wasHandled = emberAfDoorLockClusterGetWeekdayScheduleCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + scheduleId, userId, commandData); } break; } case Commands::GetYeardaySchedule::Id: { + Commands::GetYeardaySchedule::DecodableType commandData; expectArgumentCount = 2; uint8_t scheduleId; uint16_t userId; @@ -2844,11 +2922,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterGetYeardayScheduleCallback(aEndpointId, apCommandObj, scheduleId, userId); + wasHandled = emberAfDoorLockClusterGetYeardayScheduleCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + scheduleId, userId, commandData); } break; } case Commands::LockDoor::Id: { + Commands::LockDoor::DecodableType commandData; expectArgumentCount = 1; const uint8_t * PIN; bool argExists[1]; @@ -2903,11 +2983,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterLockDoorCallback(aEndpointId, apCommandObj, const_cast(PIN)); + wasHandled = emberAfDoorLockClusterLockDoorCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + const_cast(PIN), commandData); } break; } case Commands::SetHolidaySchedule::Id: { + Commands::SetHolidaySchedule::DecodableType commandData; expectArgumentCount = 4; uint8_t scheduleId; uint32_t localStartTime; @@ -2973,12 +3055,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterSetHolidayScheduleCallback(aEndpointId, apCommandObj, scheduleId, localStartTime, - localEndTime, operatingModeDuringHoliday); + wasHandled = emberAfDoorLockClusterSetHolidayScheduleCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + scheduleId, localStartTime, localEndTime, + operatingModeDuringHoliday, commandData); } break; } case Commands::SetPin::Id: { + Commands::SetPin::DecodableType commandData; expectArgumentCount = 4; uint16_t userId; uint8_t userStatus; @@ -3045,12 +3129,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterSetPinCallback(aEndpointId, apCommandObj, userId, userStatus, userType, - const_cast(pin)); + wasHandled = emberAfDoorLockClusterSetPinCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, userId, + userStatus, userType, const_cast(pin), commandData); } break; } case Commands::SetRfid::Id: { + Commands::SetRfid::DecodableType commandData; expectArgumentCount = 4; uint16_t userId; uint8_t userStatus; @@ -3117,12 +3202,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterSetRfidCallback(aEndpointId, apCommandObj, userId, userStatus, userType, - const_cast(id)); + wasHandled = emberAfDoorLockClusterSetRfidCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, userId, + userStatus, userType, const_cast(id), commandData); } break; } case Commands::SetUserType::Id: { + Commands::SetUserType::DecodableType commandData; expectArgumentCount = 2; uint16_t userId; uint8_t userType; @@ -3180,11 +3266,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterSetUserTypeCallback(aEndpointId, apCommandObj, userId, userType); + wasHandled = emberAfDoorLockClusterSetUserTypeCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, userId, + userType, commandData); } break; } case Commands::SetWeekdaySchedule::Id: { + Commands::SetWeekdaySchedule::DecodableType commandData; expectArgumentCount = 7; uint8_t scheduleId; uint16_t userId; @@ -3262,12 +3350,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 7 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterSetWeekdayScheduleCallback(aEndpointId, apCommandObj, scheduleId, userId, - daysMask, startHour, startMinute, endHour, endMinute); + wasHandled = emberAfDoorLockClusterSetWeekdayScheduleCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + scheduleId, userId, daysMask, startHour, startMinute, + endHour, endMinute, commandData); } break; } case Commands::SetYeardaySchedule::Id: { + Commands::SetYeardaySchedule::DecodableType commandData; expectArgumentCount = 4; uint8_t scheduleId; uint16_t userId; @@ -3333,12 +3423,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterSetYeardayScheduleCallback(aEndpointId, apCommandObj, scheduleId, userId, - localStartTime, localEndTime); + wasHandled = + emberAfDoorLockClusterSetYeardayScheduleCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + scheduleId, userId, localStartTime, localEndTime, commandData); } break; } case Commands::UnlockDoor::Id: { + Commands::UnlockDoor::DecodableType commandData; expectArgumentCount = 1; const uint8_t * PIN; bool argExists[1]; @@ -3393,11 +3485,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterUnlockDoorCallback(aEndpointId, apCommandObj, const_cast(PIN)); + wasHandled = emberAfDoorLockClusterUnlockDoorCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + const_cast(PIN), commandData); } break; } case Commands::UnlockWithTimeout::Id: { + Commands::UnlockWithTimeout::DecodableType commandData; expectArgumentCount = 2; uint16_t timeoutInSeconds; const uint8_t * pin; @@ -3456,14 +3550,15 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterUnlockWithTimeoutCallback(aEndpointId, apCommandObj, timeoutInSeconds, - const_cast(pin)); + wasHandled = + emberAfDoorLockClusterUnlockWithTimeoutCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + timeoutInSeconds, const_cast(pin), commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, DoorLock::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -3471,9 +3566,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - DoorLock::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + DoorLock::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -3491,7 +3586,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace EthernetNetworkDiagnostics { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -3504,16 +3599,18 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ResetCounts::Id: { + Commands::ResetCounts::DecodableType commandData; - wasHandled = emberAfEthernetNetworkDiagnosticsClusterResetCountsCallback(aEndpointId, apCommandObj); + wasHandled = emberAfEthernetNetworkDiagnosticsClusterResetCountsCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, EthernetNetworkDiagnostics::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -3521,9 +3618,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - EthernetNetworkDiagnostics::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + EthernetNetworkDiagnostics::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -3541,7 +3639,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace GeneralCommissioning { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -3554,9 +3652,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ArmFailSafe::Id: { + Commands::ArmFailSafe::DecodableType commandData; expectArgumentCount = 3; uint16_t expiryLengthSeconds; uint64_t breadcrumb; @@ -3618,17 +3717,20 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfGeneralCommissioningClusterArmFailSafeCallback(aEndpointId, apCommandObj, expiryLengthSeconds, - breadcrumb, timeoutMs); + wasHandled = emberAfGeneralCommissioningClusterArmFailSafeCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, expiryLengthSeconds, breadcrumb, timeoutMs, commandData); } break; } case Commands::CommissioningComplete::Id: { + Commands::CommissioningComplete::DecodableType commandData; - wasHandled = emberAfGeneralCommissioningClusterCommissioningCompleteCallback(aEndpointId, apCommandObj); + wasHandled = emberAfGeneralCommissioningClusterCommissioningCompleteCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, commandData); break; } case Commands::SetRegulatoryConfig::Id: { + Commands::SetRegulatoryConfig::DecodableType commandData; expectArgumentCount = 4; uint8_t location; const uint8_t * countryCode; @@ -3696,13 +3798,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { wasHandled = emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback( - aEndpointId, apCommandObj, location, const_cast(countryCode), breadcrumb, timeoutMs); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, location, const_cast(countryCode), breadcrumb, + timeoutMs, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, GeneralCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -3710,9 +3813,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - GeneralCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + GeneralCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -3730,7 +3834,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace Groups { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -3743,9 +3847,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::AddGroup::Id: { + Commands::AddGroup::DecodableType commandData; expectArgumentCount = 2; uint16_t groupId; const uint8_t * groupName; @@ -3804,12 +3909,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = - emberAfGroupsClusterAddGroupCallback(aEndpointId, apCommandObj, groupId, const_cast(groupName)); + wasHandled = emberAfGroupsClusterAddGroupCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, groupId, + const_cast(groupName), commandData); } break; } case Commands::AddGroupIfIdentifying::Id: { + Commands::AddGroupIfIdentifying::DecodableType commandData; expectArgumentCount = 2; uint16_t groupId; const uint8_t * groupName; @@ -3868,12 +3974,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfGroupsClusterAddGroupIfIdentifyingCallback(aEndpointId, apCommandObj, groupId, - const_cast(groupName)); + wasHandled = emberAfGroupsClusterAddGroupIfIdentifyingCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, groupId, const_cast(groupName), commandData); } break; } case Commands::GetGroupMembership::Id: { + Commands::GetGroupMembership::DecodableType commandData; expectArgumentCount = 2; uint8_t groupCount; /* TYPE WARNING: array array defaults to */ uint8_t * groupList; @@ -3932,16 +4039,20 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfGroupsClusterGetGroupMembershipCallback(aEndpointId, apCommandObj, groupCount, groupList); + wasHandled = emberAfGroupsClusterGetGroupMembershipCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + groupCount, groupList, commandData); } break; } case Commands::RemoveAllGroups::Id: { + Commands::RemoveAllGroups::DecodableType commandData; - wasHandled = emberAfGroupsClusterRemoveAllGroupsCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfGroupsClusterRemoveAllGroupsCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::RemoveGroup::Id: { + Commands::RemoveGroup::DecodableType commandData; expectArgumentCount = 1; uint16_t groupId; bool argExists[1]; @@ -3995,11 +4106,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfGroupsClusterRemoveGroupCallback(aEndpointId, apCommandObj, groupId); + wasHandled = emberAfGroupsClusterRemoveGroupCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, groupId, + commandData); } break; } case Commands::ViewGroup::Id: { + Commands::ViewGroup::DecodableType commandData; expectArgumentCount = 1; uint16_t groupId; bool argExists[1]; @@ -4053,13 +4166,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfGroupsClusterViewGroupCallback(aEndpointId, apCommandObj, groupId); + wasHandled = emberAfGroupsClusterViewGroupCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, groupId, + commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, Groups::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -4067,9 +4181,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - Groups::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + Groups::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -4087,7 +4201,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace IasZone { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -4100,9 +4214,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ZoneEnrollResponse::Id: { + Commands::ZoneEnrollResponse::DecodableType commandData; expectArgumentCount = 2; uint8_t enrollResponseCode; uint8_t zoneId; @@ -4160,13 +4275,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfIasZoneClusterZoneEnrollResponseCallback(aEndpointId, apCommandObj, enrollResponseCode, zoneId); + wasHandled = emberAfIasZoneClusterZoneEnrollResponseCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + enrollResponseCode, zoneId, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, IasZone::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -4174,9 +4290,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - IasZone::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + IasZone::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -4194,7 +4310,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace Identify { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -4207,9 +4323,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::Identify::Id: { + Commands::Identify::DecodableType commandData; expectArgumentCount = 1; uint16_t identifyTime; bool argExists[1]; @@ -4263,18 +4380,21 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfIdentifyClusterIdentifyCallback(aEndpointId, apCommandObj, identifyTime); + wasHandled = emberAfIdentifyClusterIdentifyCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + identifyTime, commandData); } break; } case Commands::IdentifyQuery::Id: { + Commands::IdentifyQuery::DecodableType commandData; - wasHandled = emberAfIdentifyClusterIdentifyQueryCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfIdentifyClusterIdentifyQueryCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, Identify::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -4282,9 +4402,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - Identify::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + Identify::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -4302,7 +4422,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace LevelControl { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -4315,9 +4435,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::Move::Id: { + Commands::Move::DecodableType commandData; expectArgumentCount = 4; uint8_t moveMode; uint8_t rate; @@ -4383,12 +4504,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = - emberAfLevelControlClusterMoveCallback(aEndpointId, apCommandObj, moveMode, rate, optionMask, optionOverride); + wasHandled = emberAfLevelControlClusterMoveCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, moveMode, + rate, optionMask, optionOverride, commandData); } break; } case Commands::MoveToLevel::Id: { + Commands::MoveToLevel::DecodableType commandData; expectArgumentCount = 4; uint8_t level; uint16_t transitionTime; @@ -4454,12 +4576,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfLevelControlClusterMoveToLevelCallback(aEndpointId, apCommandObj, level, transitionTime, - optionMask, optionOverride); + wasHandled = + emberAfLevelControlClusterMoveToLevelCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, level, + transitionTime, optionMask, optionOverride, commandData); } break; } case Commands::MoveToLevelWithOnOff::Id: { + Commands::MoveToLevelWithOnOff::DecodableType commandData; expectArgumentCount = 2; uint8_t level; uint16_t transitionTime; @@ -4517,12 +4641,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = - emberAfLevelControlClusterMoveToLevelWithOnOffCallback(aEndpointId, apCommandObj, level, transitionTime); + wasHandled = emberAfLevelControlClusterMoveToLevelWithOnOffCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, level, transitionTime, commandData); } break; } case Commands::MoveWithOnOff::Id: { + Commands::MoveWithOnOff::DecodableType commandData; expectArgumentCount = 2; uint8_t moveMode; uint8_t rate; @@ -4580,11 +4705,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfLevelControlClusterMoveWithOnOffCallback(aEndpointId, apCommandObj, moveMode, rate); + wasHandled = emberAfLevelControlClusterMoveWithOnOffCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + moveMode, rate, commandData); } break; } case Commands::Step::Id: { + Commands::Step::DecodableType commandData; expectArgumentCount = 5; uint8_t stepMode; uint8_t stepSize; @@ -4654,12 +4781,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfLevelControlClusterStepCallback(aEndpointId, apCommandObj, stepMode, stepSize, transitionTime, - optionMask, optionOverride); + wasHandled = + emberAfLevelControlClusterStepCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, stepMode, stepSize, + transitionTime, optionMask, optionOverride, commandData); } break; } case Commands::StepWithOnOff::Id: { + Commands::StepWithOnOff::DecodableType commandData; expectArgumentCount = 3; uint8_t stepMode; uint8_t stepSize; @@ -4721,12 +4850,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = - emberAfLevelControlClusterStepWithOnOffCallback(aEndpointId, apCommandObj, stepMode, stepSize, transitionTime); + wasHandled = emberAfLevelControlClusterStepWithOnOffCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + stepMode, stepSize, transitionTime, commandData); } break; } case Commands::Stop::Id: { + Commands::Stop::DecodableType commandData; expectArgumentCount = 2; uint8_t optionMask; uint8_t optionOverride; @@ -4784,18 +4914,21 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfLevelControlClusterStopCallback(aEndpointId, apCommandObj, optionMask, optionOverride); + wasHandled = emberAfLevelControlClusterStopCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + optionMask, optionOverride, commandData); } break; } case Commands::StopWithOnOff::Id: { + Commands::StopWithOnOff::DecodableType commandData; - wasHandled = emberAfLevelControlClusterStopWithOnOffCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfLevelControlClusterStopWithOnOffCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, LevelControl::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -4803,9 +4936,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - LevelControl::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + LevelControl::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -4823,7 +4956,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace LowPower { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -4836,16 +4969,17 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::Sleep::Id: { + Commands::Sleep::DecodableType commandData; - wasHandled = emberAfLowPowerClusterSleepCallback(aEndpointId, apCommandObj); + wasHandled = emberAfLowPowerClusterSleepCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, LowPower::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -4853,9 +4987,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - LowPower::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + LowPower::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -4873,7 +5007,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace NetworkCommissioning { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -4886,9 +5020,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::AddThreadNetwork::Id: { + Commands::AddThreadNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan operationalDataset; uint64_t breadcrumb; @@ -4950,12 +5085,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterAddThreadNetworkCallback(aEndpointId, apCommandObj, - operationalDataset, breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterAddThreadNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, operationalDataset, breadcrumb, timeoutMs, commandData); } break; } case Commands::AddWiFiNetwork::Id: { + Commands::AddWiFiNetwork::DecodableType commandData; expectArgumentCount = 4; chip::ByteSpan ssid; chip::ByteSpan credentials; @@ -5021,12 +5157,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterAddWiFiNetworkCallback(aEndpointId, apCommandObj, ssid, credentials, - breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterAddWiFiNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, ssid, credentials, breadcrumb, timeoutMs, commandData); } break; } case Commands::DisableNetwork::Id: { + Commands::DisableNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan networkID; uint64_t breadcrumb; @@ -5088,12 +5225,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterDisableNetworkCallback(aEndpointId, apCommandObj, networkID, - breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterDisableNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, networkID, breadcrumb, timeoutMs, commandData); } break; } case Commands::EnableNetwork::Id: { + Commands::EnableNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan networkID; uint64_t breadcrumb; @@ -5155,12 +5293,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterEnableNetworkCallback(aEndpointId, apCommandObj, networkID, - breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterEnableNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, networkID, breadcrumb, timeoutMs, commandData); } break; } case Commands::GetLastNetworkCommissioningResult::Id: { + Commands::GetLastNetworkCommissioningResult::DecodableType commandData; expectArgumentCount = 1; uint32_t timeoutMs; bool argExists[1]; @@ -5214,12 +5353,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback(aEndpointId, apCommandObj, - timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, timeoutMs, commandData); } break; } case Commands::RemoveNetwork::Id: { + Commands::RemoveNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan NetworkID; uint64_t Breadcrumb; @@ -5281,12 +5421,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterRemoveNetworkCallback(aEndpointId, apCommandObj, NetworkID, - Breadcrumb, TimeoutMs); + wasHandled = emberAfNetworkCommissioningClusterRemoveNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, NetworkID, Breadcrumb, TimeoutMs, commandData); } break; } case Commands::ScanNetworks::Id: { + Commands::ScanNetworks::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan ssid; uint64_t breadcrumb; @@ -5348,12 +5489,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = - emberAfNetworkCommissioningClusterScanNetworksCallback(aEndpointId, apCommandObj, ssid, breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterScanNetworksCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, ssid, breadcrumb, timeoutMs, commandData); } break; } case Commands::UpdateThreadNetwork::Id: { + Commands::UpdateThreadNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan operationalDataset; uint64_t breadcrumb; @@ -5416,11 +5558,12 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { wasHandled = emberAfNetworkCommissioningClusterUpdateThreadNetworkCallback( - aEndpointId, apCommandObj, operationalDataset, breadcrumb, timeoutMs); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, operationalDataset, breadcrumb, timeoutMs, commandData); } break; } case Commands::UpdateWiFiNetwork::Id: { + Commands::UpdateWiFiNetwork::DecodableType commandData; expectArgumentCount = 4; chip::ByteSpan ssid; chip::ByteSpan credentials; @@ -5486,14 +5629,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback(aEndpointId, apCommandObj, ssid, - credentials, breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, ssid, credentials, breadcrumb, timeoutMs, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, NetworkCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -5501,9 +5644,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - NetworkCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + NetworkCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -5521,7 +5665,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace OtaSoftwareUpdateProvider { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -5534,9 +5678,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ApplyUpdateRequest::Id: { + Commands::ApplyUpdateRequest::DecodableType commandData; expectArgumentCount = 2; chip::ByteSpan updateToken; uint32_t newVersion; @@ -5594,12 +5739,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestCallback(aEndpointId, apCommandObj, - updateToken, newVersion); + wasHandled = emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, updateToken, newVersion, commandData); } break; } case Commands::NotifyUpdateApplied::Id: { + Commands::NotifyUpdateApplied::DecodableType commandData; expectArgumentCount = 2; chip::ByteSpan updateToken; uint32_t softwareVersion; @@ -5657,12 +5803,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedCallback(aEndpointId, apCommandObj, - updateToken, softwareVersion); + wasHandled = emberAfOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, updateToken, softwareVersion, commandData); } break; } case Commands::QueryImage::Id: { + Commands::QueryImage::DecodableType commandData; expectArgumentCount = 8; uint16_t vendorId; uint16_t productId; @@ -5746,14 +5893,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 8 == validArgumentCount) { wasHandled = emberAfOtaSoftwareUpdateProviderClusterQueryImageCallback( - aEndpointId, apCommandObj, vendorId, productId, hardwareVersion, softwareVersion, protocolsSupported, - const_cast(location), requestorCanConsent, metadataForProvider); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, vendorId, productId, hardwareVersion, softwareVersion, + protocolsSupported, const_cast(location), requestorCanConsent, metadataForProvider, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, OtaSoftwareUpdateProvider::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -5761,9 +5908,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - OtaSoftwareUpdateProvider::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + OtaSoftwareUpdateProvider::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -5781,7 +5929,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace OnOff { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -5794,26 +5942,29 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::Off::Id: { + Commands::Off::DecodableType commandData; - wasHandled = emberAfOnOffClusterOffCallback(aEndpointId, apCommandObj); + wasHandled = emberAfOnOffClusterOffCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::On::Id: { + Commands::On::DecodableType commandData; - wasHandled = emberAfOnOffClusterOnCallback(aEndpointId, apCommandObj); + wasHandled = emberAfOnOffClusterOnCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::Toggle::Id: { + Commands::Toggle::DecodableType commandData; - wasHandled = emberAfOnOffClusterToggleCallback(aEndpointId, apCommandObj); + wasHandled = emberAfOnOffClusterToggleCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, OnOff::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -5821,9 +5972,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - OnOff::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + OnOff::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -5841,7 +5992,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace OperationalCredentials { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -5854,9 +6005,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::AddNOC::Id: { + Commands::AddNOC::DecodableType commandData; expectArgumentCount = 5; chip::ByteSpan NOCValue; chip::ByteSpan ICACValue; @@ -5926,12 +6078,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterAddNOCCallback(aEndpointId, apCommandObj, NOCValue, ICACValue, - IPKValue, CaseAdminNode, AdminVendorId); + wasHandled = emberAfOperationalCredentialsClusterAddNOCCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, NOCValue, ICACValue, IPKValue, CaseAdminNode, + AdminVendorId, commandData); } break; } case Commands::AddTrustedRootCertificate::Id: { + Commands::AddTrustedRootCertificate::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan RootCertificate; bool argExists[1]; @@ -5985,12 +6139,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback(aEndpointId, apCommandObj, - RootCertificate); + wasHandled = emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, RootCertificate, commandData); } break; } case Commands::AttestationRequest::Id: { + Commands::AttestationRequest::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan AttestationNonce; bool argExists[1]; @@ -6044,12 +6199,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = - emberAfOperationalCredentialsClusterAttestationRequestCallback(aEndpointId, apCommandObj, AttestationNonce); + wasHandled = emberAfOperationalCredentialsClusterAttestationRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, AttestationNonce, commandData); } break; } case Commands::CertificateChainRequest::Id: { + Commands::CertificateChainRequest::DecodableType commandData; expectArgumentCount = 1; uint8_t CertificateType; bool argExists[1]; @@ -6103,12 +6259,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = - emberAfOperationalCredentialsClusterCertificateChainRequestCallback(aEndpointId, apCommandObj, CertificateType); + wasHandled = emberAfOperationalCredentialsClusterCertificateChainRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CertificateType, commandData); } break; } case Commands::OpCSRRequest::Id: { + Commands::OpCSRRequest::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan CSRNonce; bool argExists[1]; @@ -6162,11 +6319,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterOpCSRRequestCallback(aEndpointId, apCommandObj, CSRNonce); + wasHandled = emberAfOperationalCredentialsClusterOpCSRRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CSRNonce, commandData); } break; } case Commands::RemoveFabric::Id: { + Commands::RemoveFabric::DecodableType commandData; expectArgumentCount = 1; uint8_t FabricIndex; bool argExists[1]; @@ -6220,11 +6379,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterRemoveFabricCallback(aEndpointId, apCommandObj, FabricIndex); + wasHandled = emberAfOperationalCredentialsClusterRemoveFabricCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, FabricIndex, commandData); } break; } case Commands::RemoveTrustedRootCertificate::Id: { + Commands::RemoveTrustedRootCertificate::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan TrustedRootIdentifier; bool argExists[1]; @@ -6278,12 +6439,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterRemoveTrustedRootCertificateCallback(aEndpointId, apCommandObj, - TrustedRootIdentifier); + wasHandled = emberAfOperationalCredentialsClusterRemoveTrustedRootCertificateCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, TrustedRootIdentifier, commandData); } break; } case Commands::UpdateFabricLabel::Id: { + Commands::UpdateFabricLabel::DecodableType commandData; expectArgumentCount = 1; const uint8_t * Label; bool argExists[1]; @@ -6338,12 +6500,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterUpdateFabricLabelCallback(aEndpointId, apCommandObj, - const_cast(Label)); + wasHandled = emberAfOperationalCredentialsClusterUpdateFabricLabelCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, const_cast(Label), commandData); } break; } case Commands::UpdateNOC::Id: { + Commands::UpdateNOC::DecodableType commandData; expectArgumentCount = 2; chip::ByteSpan NOCValue; chip::ByteSpan ICACValue; @@ -6401,13 +6564,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterUpdateNOCCallback(aEndpointId, apCommandObj, NOCValue, ICACValue); + wasHandled = emberAfOperationalCredentialsClusterUpdateNOCCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, NOCValue, ICACValue, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, OperationalCredentials::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -6415,9 +6579,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - OperationalCredentials::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + OperationalCredentials::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -6435,7 +6600,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace Scenes { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -6448,9 +6613,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::AddScene::Id: { + Commands::AddScene::DecodableType commandData; expectArgumentCount = 5; uint16_t groupId; uint8_t sceneId; @@ -6522,12 +6688,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfScenesClusterAddSceneCallback(aEndpointId, apCommandObj, groupId, sceneId, transitionTime, - const_cast(sceneName), extensionFieldSets); + wasHandled = emberAfScenesClusterAddSceneCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, groupId, + sceneId, transitionTime, const_cast(sceneName), + extensionFieldSets, commandData); } break; } case Commands::GetSceneMembership::Id: { + Commands::GetSceneMembership::DecodableType commandData; expectArgumentCount = 1; uint16_t groupId; bool argExists[1]; @@ -6581,11 +6749,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfScenesClusterGetSceneMembershipCallback(aEndpointId, apCommandObj, groupId); + wasHandled = emberAfScenesClusterGetSceneMembershipCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + groupId, commandData); } break; } case Commands::RecallScene::Id: { + Commands::RecallScene::DecodableType commandData; expectArgumentCount = 3; uint16_t groupId; uint8_t sceneId; @@ -6647,11 +6817,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfScenesClusterRecallSceneCallback(aEndpointId, apCommandObj, groupId, sceneId, transitionTime); + wasHandled = emberAfScenesClusterRecallSceneCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, groupId, + sceneId, transitionTime, commandData); } break; } case Commands::RemoveAllScenes::Id: { + Commands::RemoveAllScenes::DecodableType commandData; expectArgumentCount = 1; uint16_t groupId; bool argExists[1]; @@ -6705,11 +6877,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfScenesClusterRemoveAllScenesCallback(aEndpointId, apCommandObj, groupId); + wasHandled = emberAfScenesClusterRemoveAllScenesCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + groupId, commandData); } break; } case Commands::RemoveScene::Id: { + Commands::RemoveScene::DecodableType commandData; expectArgumentCount = 2; uint16_t groupId; uint8_t sceneId; @@ -6767,11 +6941,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfScenesClusterRemoveSceneCallback(aEndpointId, apCommandObj, groupId, sceneId); + wasHandled = emberAfScenesClusterRemoveSceneCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, groupId, + sceneId, commandData); } break; } case Commands::StoreScene::Id: { + Commands::StoreScene::DecodableType commandData; expectArgumentCount = 2; uint16_t groupId; uint8_t sceneId; @@ -6829,11 +7005,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfScenesClusterStoreSceneCallback(aEndpointId, apCommandObj, groupId, sceneId); + wasHandled = emberAfScenesClusterStoreSceneCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, groupId, + sceneId, commandData); } break; } case Commands::ViewScene::Id: { + Commands::ViewScene::DecodableType commandData; expectArgumentCount = 2; uint16_t groupId; uint8_t sceneId; @@ -6891,13 +7069,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfScenesClusterViewSceneCallback(aEndpointId, apCommandObj, groupId, sceneId); + wasHandled = emberAfScenesClusterViewSceneCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, groupId, + sceneId, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, Scenes::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -6905,9 +7084,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - Scenes::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + Scenes::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -6925,7 +7104,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace SoftwareDiagnostics { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -6938,16 +7117,18 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ResetWatermarks::Id: { + Commands::ResetWatermarks::DecodableType commandData; - wasHandled = emberAfSoftwareDiagnosticsClusterResetWatermarksCallback(aEndpointId, apCommandObj); + wasHandled = emberAfSoftwareDiagnosticsClusterResetWatermarksCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, SoftwareDiagnostics::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -6955,9 +7136,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - SoftwareDiagnostics::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + SoftwareDiagnostics::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -6975,7 +7157,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace TestCluster { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -6988,14 +7170,16 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::Test::Id: { + Commands::Test::DecodableType commandData; - wasHandled = emberAfTestClusterClusterTestCallback(aEndpointId, apCommandObj); + wasHandled = emberAfTestClusterClusterTestCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::TestAddArguments::Id: { + Commands::TestAddArguments::DecodableType commandData; expectArgumentCount = 2; uint8_t arg1; uint8_t arg2; @@ -7053,23 +7237,28 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfTestClusterClusterTestAddArgumentsCallback(aEndpointId, apCommandObj, arg1, arg2); + wasHandled = emberAfTestClusterClusterTestAddArgumentsCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + arg1, arg2, commandData); } break; } case Commands::TestNotHandled::Id: { + Commands::TestNotHandled::DecodableType commandData; - wasHandled = emberAfTestClusterClusterTestNotHandledCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfTestClusterClusterTestNotHandledCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::TestSpecific::Id: { + Commands::TestSpecific::DecodableType commandData; - wasHandled = emberAfTestClusterClusterTestSpecificCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfTestClusterClusterTestSpecificCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, TestCluster::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -7077,9 +7266,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - TestCluster::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + TestCluster::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -7097,7 +7286,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace ThreadNetworkDiagnostics { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -7110,16 +7299,18 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ResetCounts::Id: { + Commands::ResetCounts::DecodableType commandData; - wasHandled = emberAfThreadNetworkDiagnosticsClusterResetCountsCallback(aEndpointId, apCommandObj); + wasHandled = emberAfThreadNetworkDiagnosticsClusterResetCountsCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, ThreadNetworkDiagnostics::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -7127,9 +7318,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - ThreadNetworkDiagnostics::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + ThreadNetworkDiagnostics::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -7147,7 +7339,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace WiFiNetworkDiagnostics { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -7160,16 +7352,18 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ResetCounts::Id: { + Commands::ResetCounts::DecodableType commandData; - wasHandled = emberAfWiFiNetworkDiagnosticsClusterResetCountsCallback(aEndpointId, apCommandObj); + wasHandled = emberAfWiFiNetworkDiagnosticsClusterResetCountsCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, WiFiNetworkDiagnostics::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -7177,9 +7371,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - WiFiNetworkDiagnostics::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + WiFiNetworkDiagnostics::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -7197,7 +7392,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace WindowCovering { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -7210,26 +7405,32 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::DownOrClose::Id: { + Commands::DownOrClose::DecodableType commandData; - wasHandled = emberAfWindowCoveringClusterDownOrCloseCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfWindowCoveringClusterDownOrCloseCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::StopMotion::Id: { + Commands::StopMotion::DecodableType commandData; - wasHandled = emberAfWindowCoveringClusterStopMotionCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfWindowCoveringClusterStopMotionCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::UpOrOpen::Id: { + Commands::UpOrOpen::DecodableType commandData; - wasHandled = emberAfWindowCoveringClusterUpOrOpenCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfWindowCoveringClusterUpOrOpenCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, WindowCovering::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -7237,9 +7438,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - WindowCovering::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + WindowCovering::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -7263,81 +7464,82 @@ void DispatchSingleClusterCommand(ClusterId aClusterId, CommandId aCommandId, En 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); TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); switch (aClusterId) { case Clusters::AdministratorCommissioning::Id: - Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::BarrierControl::Id: - Clusters::BarrierControl::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::BarrierControl::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::Basic::Id: - Clusters::Basic::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::Basic::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::Binding::Id: - Clusters::Binding::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::Binding::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::ColorControl::Id: - Clusters::ColorControl::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::ColorControl::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::DiagnosticLogs::Id: - Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::DoorLock::Id: - Clusters::DoorLock::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::DoorLock::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::EthernetNetworkDiagnostics::Id: - Clusters::EthernetNetworkDiagnostics::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::EthernetNetworkDiagnostics::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::GeneralCommissioning::Id: - Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::Groups::Id: - Clusters::Groups::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::Groups::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::IasZone::Id: - Clusters::IasZone::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::IasZone::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::Identify::Id: - Clusters::Identify::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::Identify::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::LevelControl::Id: - Clusters::LevelControl::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::LevelControl::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::LowPower::Id: - Clusters::LowPower::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::LowPower::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::NetworkCommissioning::Id: - Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::OtaSoftwareUpdateProvider::Id: - Clusters::OtaSoftwareUpdateProvider::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::OtaSoftwareUpdateProvider::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::OnOff::Id: - Clusters::OnOff::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::OnOff::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::OperationalCredentials::Id: - Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::Scenes::Id: - Clusters::Scenes::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::Scenes::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::SoftwareDiagnostics::Id: - Clusters::SoftwareDiagnostics::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::SoftwareDiagnostics::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::TestCluster::Id: - Clusters::TestCluster::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::TestCluster::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::ThreadNetworkDiagnostics::Id: - Clusters::ThreadNetworkDiagnostics::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::ThreadNetworkDiagnostics::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::WiFiNetworkDiagnostics::Id: - Clusters::WiFiNetworkDiagnostics::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::WiFiNetworkDiagnostics::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::WindowCovering::Id: - Clusters::WindowCovering::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::WindowCovering::DispatchServerCommand(apCommandObj, commandPath, aReader); break; default: // Unrecognized cluster ID, error status will apply. @@ -7360,6 +7562,7 @@ void DispatchSingleClusterResponseCommand(ClusterId aClusterId, CommandId aComma 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); TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); switch (aClusterId) diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index ef7e6954bc6941..6b248336e263aa 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -21,12 +21,14 @@ #pragma once #include +#include #include #include #include #include #include +#include #include /** @brief Cluster Init @@ -15161,8 +15163,10 @@ void emberAfSampleMfgSpecificCluster2ClusterClientTickCallback(chip::EndpointId /** * @brief Identify Cluster Identify Command callback (from client) */ -bool emberAfIdentifyClusterIdentifyCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint16_t identifyTime); +bool emberAfIdentifyClusterIdentifyCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t identifyTime, + chip::app::Clusters::Identify::Commands::Identify::DecodableType & fields); /** * @brief Identify Cluster IdentifyQueryResponse Command callback (from server) */ @@ -15171,17 +15175,23 @@ bool emberAfIdentifyClusterIdentifyQueryResponseCallback(chip::EndpointId endpoi /** * @brief Identify Cluster IdentifyQuery Command callback (from client) */ -bool emberAfIdentifyClusterIdentifyQueryCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfIdentifyClusterIdentifyQueryCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::Identify::Commands::IdentifyQuery::DecodableType & fields); /** * @brief Identify Cluster TriggerEffect Command callback (from client) */ -bool emberAfIdentifyClusterTriggerEffectCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t effectIdentifier, uint8_t effectVariant); +bool emberAfIdentifyClusterTriggerEffectCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t effectIdentifier, uint8_t effectVariant, + chip::app::Clusters::Identify::Commands::TriggerEffect::DecodableType & fields); /** * @brief Groups Cluster AddGroup Command callback (from client) */ -bool emberAfGroupsClusterAddGroupCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint16_t groupId, - uint8_t * groupName); +bool emberAfGroupsClusterAddGroupCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t groupId, uint8_t * groupName, + chip::app::Clusters::Groups::Commands::AddGroup::DecodableType & fields); /** * @brief Groups Cluster AddGroupResponse Command callback (from server) */ @@ -15190,7 +15200,10 @@ bool emberAfGroupsClusterAddGroupResponseCallback(chip::EndpointId endpoint, chi /** * @brief Groups Cluster ViewGroup Command callback (from client) */ -bool emberAfGroupsClusterViewGroupCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint16_t groupId); +bool emberAfGroupsClusterViewGroupCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t groupId, + chip::app::Clusters::Groups::Commands::ViewGroup::DecodableType & fields); /** * @brief Groups Cluster ViewGroupResponse Command callback (from server) */ @@ -15199,9 +15212,10 @@ bool emberAfGroupsClusterViewGroupResponseCallback(chip::EndpointId endpoint, ch /** * @brief Groups Cluster GetGroupMembership Command callback (from client) */ -bool emberAfGroupsClusterGetGroupMembershipCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t groupCount, - /* TYPE WARNING: array array defaults to */ uint8_t * groupList); +bool emberAfGroupsClusterGetGroupMembershipCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t groupCount, /* TYPE WARNING: array array defaults to */ uint8_t * groupList, + chip::app::Clusters::Groups::Commands::GetGroupMembership::DecodableType & fields); /** * @brief Groups Cluster GetGroupMembershipResponse Command callback (from server) */ @@ -15211,7 +15225,10 @@ bool emberAfGroupsClusterGetGroupMembershipResponseCallback(chip::EndpointId end /** * @brief Groups Cluster RemoveGroup Command callback (from client) */ -bool emberAfGroupsClusterRemoveGroupCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint16_t groupId); +bool emberAfGroupsClusterRemoveGroupCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t groupId, + chip::app::Clusters::Groups::Commands::RemoveGroup::DecodableType & fields); /** * @brief Groups Cluster RemoveGroupResponse Command callback (from server) */ @@ -15220,18 +15237,23 @@ bool emberAfGroupsClusterRemoveGroupResponseCallback(chip::EndpointId endpoint, /** * @brief Groups Cluster RemoveAllGroups Command callback (from client) */ -bool emberAfGroupsClusterRemoveAllGroupsCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfGroupsClusterRemoveAllGroupsCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::Groups::Commands::RemoveAllGroups::DecodableType & fields); /** * @brief Groups Cluster AddGroupIfIdentifying Command callback (from client) */ -bool emberAfGroupsClusterAddGroupIfIdentifyingCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint16_t groupId, uint8_t * groupName); +bool emberAfGroupsClusterAddGroupIfIdentifyingCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t groupId, uint8_t * groupName, chip::app::Clusters::Groups::Commands::AddGroupIfIdentifying::DecodableType & fields); /** * @brief Scenes Cluster AddScene Command callback (from client) */ -bool emberAfScenesClusterAddSceneCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint16_t groupId, - uint8_t sceneId, uint16_t transitionTime, uint8_t * sceneName, - /* TYPE WARNING: array array defaults to */ uint8_t * extensionFieldSets); +bool emberAfScenesClusterAddSceneCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t groupId, uint8_t sceneId, uint16_t transitionTime, uint8_t * sceneName, + /* TYPE WARNING: array array defaults to */ uint8_t * extensionFieldSets, + chip::app::Clusters::Scenes::Commands::AddScene::DecodableType & fields); /** * @brief Scenes Cluster AddSceneResponse Command callback (from server) */ @@ -15240,8 +15262,10 @@ bool emberAfScenesClusterAddSceneResponseCallback(chip::EndpointId endpoint, chi /** * @brief Scenes Cluster ViewScene Command callback (from client) */ -bool emberAfScenesClusterViewSceneCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint16_t groupId, - uint8_t sceneId); +bool emberAfScenesClusterViewSceneCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t groupId, uint8_t sceneId, + chip::app::Clusters::Scenes::Commands::ViewScene::DecodableType & fields); /** * @brief Scenes Cluster ViewSceneResponse Command callback (from server) */ @@ -15251,8 +15275,10 @@ bool emberAfScenesClusterViewSceneResponseCallback(chip::EndpointId endpoint, ch /** * @brief Scenes Cluster RemoveScene Command callback (from client) */ -bool emberAfScenesClusterRemoveSceneCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint16_t groupId, - uint8_t sceneId); +bool emberAfScenesClusterRemoveSceneCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t groupId, uint8_t sceneId, + chip::app::Clusters::Scenes::Commands::RemoveScene::DecodableType & fields); /** * @brief Scenes Cluster RemoveSceneResponse Command callback (from server) */ @@ -15261,8 +15287,10 @@ bool emberAfScenesClusterRemoveSceneResponseCallback(chip::EndpointId endpoint, /** * @brief Scenes Cluster RemoveAllScenes Command callback (from client) */ -bool emberAfScenesClusterRemoveAllScenesCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint16_t groupId); +bool emberAfScenesClusterRemoveAllScenesCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t groupId, + chip::app::Clusters::Scenes::Commands::RemoveAllScenes::DecodableType & fields); /** * @brief Scenes Cluster RemoveAllScenesResponse Command callback (from server) */ @@ -15271,8 +15299,10 @@ bool emberAfScenesClusterRemoveAllScenesResponseCallback(chip::EndpointId endpoi /** * @brief Scenes Cluster StoreScene Command callback (from client) */ -bool emberAfScenesClusterStoreSceneCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint16_t groupId, - uint8_t sceneId); +bool emberAfScenesClusterStoreSceneCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t groupId, uint8_t sceneId, + chip::app::Clusters::Scenes::Commands::StoreScene::DecodableType & fields); /** * @brief Scenes Cluster StoreSceneResponse Command callback (from server) */ @@ -15281,13 +15311,16 @@ bool emberAfScenesClusterStoreSceneResponseCallback(chip::EndpointId endpoint, c /** * @brief Scenes Cluster RecallScene Command callback (from client) */ -bool emberAfScenesClusterRecallSceneCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint16_t groupId, - uint8_t sceneId, uint16_t transitionTime); +bool emberAfScenesClusterRecallSceneCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t groupId, uint8_t sceneId, uint16_t transitionTime, + chip::app::Clusters::Scenes::Commands::RecallScene::DecodableType & fields); /** * @brief Scenes Cluster GetSceneMembership Command callback (from client) */ -bool emberAfScenesClusterGetSceneMembershipCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint16_t groupId); +bool emberAfScenesClusterGetSceneMembershipCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t groupId, chip::app::Clusters::Scenes::Commands::GetSceneMembership::DecodableType & fields); /** * @brief Scenes Cluster GetSceneMembershipResponse Command callback (from server) */ @@ -15297,9 +15330,11 @@ bool emberAfScenesClusterGetSceneMembershipResponseCallback(chip::EndpointId end /** * @brief Scenes Cluster EnhancedAddScene Command callback (from client) */ -bool emberAfScenesClusterEnhancedAddSceneCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, +bool emberAfScenesClusterEnhancedAddSceneCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, uint16_t groupId, uint8_t sceneId, uint16_t transitionTime, uint8_t * sceneName, - /* TYPE WARNING: array array defaults to */ uint8_t * extensionFieldSets); + /* TYPE WARNING: array array defaults to */ uint8_t * extensionFieldSets, + chip::app::Clusters::Scenes::Commands::EnhancedAddScene::DecodableType & fields); /** * @brief Scenes Cluster EnhancedAddSceneResponse Command callback (from server) */ @@ -15308,8 +15343,9 @@ bool emberAfScenesClusterEnhancedAddSceneResponseCallback(chip::EndpointId endpo /** * @brief Scenes Cluster EnhancedViewScene Command callback (from client) */ -bool emberAfScenesClusterEnhancedViewSceneCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint16_t groupId, uint8_t sceneId); +bool emberAfScenesClusterEnhancedViewSceneCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t groupId, uint8_t sceneId, chip::app::Clusters::Scenes::Commands::EnhancedViewScene::DecodableType & fields); /** * @brief Scenes Cluster EnhancedViewSceneResponse Command callback (from server) */ @@ -15319,8 +15355,11 @@ bool emberAfScenesClusterEnhancedViewSceneResponseCallback( /** * @brief Scenes Cluster CopyScene Command callback (from client) */ -bool emberAfScenesClusterCopySceneCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint8_t mode, - uint16_t groupIdFrom, uint8_t sceneIdFrom, uint16_t groupIdTo, uint8_t sceneIdTo); +bool emberAfScenesClusterCopySceneCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t mode, uint16_t groupIdFrom, uint8_t sceneIdFrom, uint16_t groupIdTo, + uint8_t sceneIdTo, + chip::app::Clusters::Scenes::Commands::CopyScene::DecodableType & fields); /** * @brief Scenes Cluster CopySceneResponse Command callback (from server) */ @@ -15329,98 +15368,131 @@ bool emberAfScenesClusterCopySceneResponseCallback(chip::EndpointId endpoint, ch /** * @brief On/Off Cluster Off Command callback (from client) */ -bool emberAfOnOffClusterOffCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfOnOffClusterOffCallback(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + chip::EndpointId endpoint, chip::app::Clusters::OnOff::Commands::Off::DecodableType & fields); /** * @brief On/Off Cluster SampleMfgSpecificOffWithTransition Command callback (from client) */ -bool emberAfOnOffClusterSampleMfgSpecificOffWithTransitionCallback(chip::EndpointId endpoint, - chip::app::CommandHandler * commandObj); +bool emberAfOnOffClusterSampleMfgSpecificOffWithTransitionCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::OnOff::Commands::SampleMfgSpecificOffWithTransition::DecodableType & fields); /** * @brief On/Off Cluster On Command callback (from client) */ -bool emberAfOnOffClusterOnCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfOnOffClusterOnCallback(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + chip::EndpointId endpoint, chip::app::Clusters::OnOff::Commands::On::DecodableType & fields); /** * @brief On/Off Cluster SampleMfgSpecificOnWithTransition Command callback (from client) */ -bool emberAfOnOffClusterSampleMfgSpecificOnWithTransitionCallback(chip::EndpointId endpoint, - chip::app::CommandHandler * commandObj); +bool emberAfOnOffClusterSampleMfgSpecificOnWithTransitionCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::OnOff::Commands::SampleMfgSpecificOnWithTransition::DecodableType & fields); /** * @brief On/Off Cluster SampleMfgSpecificOnWithTransition2 Command callback (from client) */ -bool emberAfOnOffClusterSampleMfgSpecificOnWithTransition2Callback(chip::EndpointId endpoint, - chip::app::CommandHandler * commandObj); +bool emberAfOnOffClusterSampleMfgSpecificOnWithTransition2Callback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::OnOff::Commands::SampleMfgSpecificOnWithTransition2::DecodableType & fields); /** * @brief On/Off Cluster Toggle Command callback (from client) */ -bool emberAfOnOffClusterToggleCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfOnOffClusterToggleCallback(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + chip::EndpointId endpoint, + chip::app::Clusters::OnOff::Commands::Toggle::DecodableType & fields); /** * @brief On/Off Cluster SampleMfgSpecificToggleWithTransition Command callback (from client) */ -bool emberAfOnOffClusterSampleMfgSpecificToggleWithTransitionCallback(chip::EndpointId endpoint, - chip::app::CommandHandler * commandObj); +bool emberAfOnOffClusterSampleMfgSpecificToggleWithTransitionCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::OnOff::Commands::SampleMfgSpecificToggleWithTransition::DecodableType & fields); /** * @brief On/Off Cluster SampleMfgSpecificToggleWithTransition2 Command callback (from client) */ -bool emberAfOnOffClusterSampleMfgSpecificToggleWithTransition2Callback(chip::EndpointId endpoint, - chip::app::CommandHandler * commandObj); +bool emberAfOnOffClusterSampleMfgSpecificToggleWithTransition2Callback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::OnOff::Commands::SampleMfgSpecificToggleWithTransition2::DecodableType & fields); /** * @brief On/Off Cluster OffWithEffect Command callback (from client) */ -bool emberAfOnOffClusterOffWithEffectCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint8_t EffectId, - uint8_t EffectVariant); +bool emberAfOnOffClusterOffWithEffectCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t EffectId, uint8_t EffectVariant, + chip::app::Clusters::OnOff::Commands::OffWithEffect::DecodableType & fields); /** * @brief On/Off Cluster OnWithRecallGlobalScene Command callback (from client) */ -bool emberAfOnOffClusterOnWithRecallGlobalSceneCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfOnOffClusterOnWithRecallGlobalSceneCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::OnOff::Commands::OnWithRecallGlobalScene::DecodableType & fields); /** * @brief On/Off Cluster OnWithTimedOff Command callback (from client) */ -bool emberAfOnOffClusterOnWithTimedOffCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t OnOffControl, uint16_t OnTime, uint16_t OffWaitTime); +bool emberAfOnOffClusterOnWithTimedOffCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t OnOffControl, uint16_t OnTime, uint16_t OffWaitTime, + chip::app::Clusters::OnOff::Commands::OnWithTimedOff::DecodableType & fields); /** * @brief Level Control Cluster MoveToLevel Command callback (from client) */ -bool emberAfLevelControlClusterMoveToLevelCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint8_t level, - uint16_t transitionTime, uint8_t optionMask, uint8_t optionOverride); +bool emberAfLevelControlClusterMoveToLevelCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t level, uint16_t transitionTime, uint8_t optionMask, uint8_t optionOverride, + chip::app::Clusters::LevelControl::Commands::MoveToLevel::DecodableType & fields); /** * @brief Level Control Cluster Move Command callback (from client) */ -bool emberAfLevelControlClusterMoveCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint8_t moveMode, - uint8_t rate, uint8_t optionMask, uint8_t optionOverride); +bool emberAfLevelControlClusterMoveCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t moveMode, uint8_t rate, uint8_t optionMask, uint8_t optionOverride, + chip::app::Clusters::LevelControl::Commands::Move::DecodableType & fields); /** * @brief Level Control Cluster Step Command callback (from client) */ -bool emberAfLevelControlClusterStepCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint8_t stepMode, - uint8_t stepSize, uint16_t transitionTime, uint8_t optionMask, uint8_t optionOverride); +bool emberAfLevelControlClusterStepCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t stepMode, uint8_t stepSize, uint16_t transitionTime, uint8_t optionMask, + uint8_t optionOverride, + chip::app::Clusters::LevelControl::Commands::Step::DecodableType & fields); /** * @brief Level Control Cluster Stop Command callback (from client) */ -bool emberAfLevelControlClusterStopCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint8_t optionMask, - uint8_t optionOverride); +bool emberAfLevelControlClusterStopCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t optionMask, uint8_t optionOverride, + chip::app::Clusters::LevelControl::Commands::Stop::DecodableType & fields); /** * @brief Level Control Cluster MoveToLevelWithOnOff Command callback (from client) */ -bool emberAfLevelControlClusterMoveToLevelWithOnOffCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t level, uint16_t transitionTime); +bool emberAfLevelControlClusterMoveToLevelWithOnOffCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t level, uint16_t transitionTime, + chip::app::Clusters::LevelControl::Commands::MoveToLevelWithOnOff::DecodableType & fields); /** * @brief Level Control Cluster MoveWithOnOff Command callback (from client) */ -bool emberAfLevelControlClusterMoveWithOnOffCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t moveMode, uint8_t rate); +bool emberAfLevelControlClusterMoveWithOnOffCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t moveMode, uint8_t rate, chip::app::Clusters::LevelControl::Commands::MoveWithOnOff::DecodableType & fields); /** * @brief Level Control Cluster StepWithOnOff Command callback (from client) */ -bool emberAfLevelControlClusterStepWithOnOffCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t stepMode, uint8_t stepSize, uint16_t transitionTime); +bool emberAfLevelControlClusterStepWithOnOffCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t stepMode, uint8_t stepSize, uint16_t transitionTime, + chip::app::Clusters::LevelControl::Commands::StepWithOnOff::DecodableType & fields); /** * @brief Level Control Cluster StopWithOnOff Command callback (from client) */ -bool emberAfLevelControlClusterStopWithOnOffCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfLevelControlClusterStopWithOnOffCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::LevelControl::Commands::StopWithOnOff::DecodableType & fields); /** * @brief Alarms Cluster ResetAlarm Command callback (from client) */ -bool emberAfAlarmsClusterResetAlarmCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint8_t alarmCode, - chip::ClusterId clusterId); +bool emberAfAlarmsClusterResetAlarmCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t alarmCode, chip::ClusterId clusterId, + chip::app::Clusters::Alarms::Commands::ResetAlarm::DecodableType & fields); /** * @brief Alarms Cluster Alarm Command callback (from server) */ @@ -15429,7 +15501,9 @@ bool emberAfAlarmsClusterAlarmCallback(chip::EndpointId endpoint, chip::app::Com /** * @brief Alarms Cluster ResetAllAlarms Command callback (from client) */ -bool emberAfAlarmsClusterResetAllAlarmsCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfAlarmsClusterResetAllAlarmsCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::Alarms::Commands::ResetAllAlarms::DecodableType & fields); /** * @brief Alarms Cluster GetAlarmResponse Command callback (from server) */ @@ -15438,16 +15512,21 @@ bool emberAfAlarmsClusterGetAlarmResponseCallback(chip::EndpointId endpoint, chi /** * @brief Alarms Cluster GetAlarm Command callback (from client) */ -bool emberAfAlarmsClusterGetAlarmCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfAlarmsClusterGetAlarmCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::Alarms::Commands::GetAlarm::DecodableType & fields); /** * @brief Alarms Cluster ResetAlarmLog Command callback (from client) */ -bool emberAfAlarmsClusterResetAlarmLogCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfAlarmsClusterResetAlarmLogCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::Alarms::Commands::ResetAlarmLog::DecodableType & fields); /** * @brief Power Profile Cluster PowerProfileRequest Command callback (from client) */ -bool emberAfPowerProfileClusterPowerProfileRequestCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t powerProfileId); +bool emberAfPowerProfileClusterPowerProfileRequestCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t powerProfileId, chip::app::Clusters::PowerProfile::Commands::PowerProfileRequest::DecodableType & fields); /** * @brief Power Profile Cluster PowerProfileNotification Command callback (from server) */ @@ -15457,7 +15536,9 @@ bool emberAfPowerProfileClusterPowerProfileNotificationCallback( /** * @brief Power Profile Cluster PowerProfileStateRequest Command callback (from client) */ -bool emberAfPowerProfileClusterPowerProfileStateRequestCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfPowerProfileClusterPowerProfileStateRequestCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::PowerProfile::Commands::PowerProfileStateRequest::DecodableType & fields); /** * @brief Power Profile Cluster PowerProfileResponse Command callback (from server) */ @@ -15467,9 +15548,10 @@ bool emberAfPowerProfileClusterPowerProfileResponseCallback( /** * @brief Power Profile Cluster GetPowerProfilePriceResponse Command callback (from client) */ -bool emberAfPowerProfileClusterGetPowerProfilePriceResponseCallback(chip::EndpointId endpoint, - chip::app::CommandHandler * commandObj, uint8_t powerProfileId, - uint16_t currency, uint32_t price, uint8_t priceTrailingDigit); +bool emberAfPowerProfileClusterGetPowerProfilePriceResponseCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t powerProfileId, uint16_t currency, uint32_t price, uint8_t priceTrailingDigit, + chip::app::Clusters::PowerProfile::Commands::GetPowerProfilePriceResponse::DecodableType & fields); /** * @brief Power Profile Cluster PowerProfileStateResponse Command callback (from server) */ @@ -15479,9 +15561,10 @@ bool emberAfPowerProfileClusterPowerProfileStateResponseCallback( /** * @brief Power Profile Cluster GetOverallSchedulePriceResponse Command callback (from client) */ -bool emberAfPowerProfileClusterGetOverallSchedulePriceResponseCallback(chip::EndpointId endpoint, - chip::app::CommandHandler * commandObj, uint16_t currency, - uint32_t price, uint8_t priceTrailingDigit); +bool emberAfPowerProfileClusterGetOverallSchedulePriceResponseCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t currency, uint32_t price, uint8_t priceTrailingDigit, + chip::app::Clusters::PowerProfile::Commands::GetOverallSchedulePriceResponse::DecodableType & fields); /** * @brief Power Profile Cluster GetPowerProfilePrice Command callback (from server) */ @@ -15491,8 +15574,9 @@ bool emberAfPowerProfileClusterGetPowerProfilePriceCallback(chip::EndpointId end * @brief Power Profile Cluster EnergyPhasesScheduleNotification Command callback (from client) */ bool emberAfPowerProfileClusterEnergyPhasesScheduleNotificationCallback( - chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint8_t powerProfileId, uint8_t numOfScheduledPhases, - /* TYPE WARNING: array array defaults to */ uint8_t * scheduledPhases); + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t powerProfileId, uint8_t numOfScheduledPhases, /* TYPE WARNING: array array defaults to */ uint8_t * scheduledPhases, + chip::app::Clusters::PowerProfile::Commands::EnergyPhasesScheduleNotification::DecodableType & fields); /** * @brief Power Profile Cluster PowerProfilesStateNotification Command callback (from server) */ @@ -15503,8 +15587,9 @@ bool emberAfPowerProfileClusterPowerProfilesStateNotificationCallback( * @brief Power Profile Cluster EnergyPhasesScheduleResponse Command callback (from client) */ bool emberAfPowerProfileClusterEnergyPhasesScheduleResponseCallback( - chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint8_t powerProfileId, uint8_t numOfScheduledPhases, - /* TYPE WARNING: array array defaults to */ uint8_t * scheduledPhases); + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t powerProfileId, uint8_t numOfScheduledPhases, /* TYPE WARNING: array array defaults to */ uint8_t * scheduledPhases, + chip::app::Clusters::PowerProfile::Commands::EnergyPhasesScheduleResponse::DecodableType & fields); /** * @brief Power Profile Cluster GetOverallSchedulePrice Command callback (from server) */ @@ -15512,9 +15597,10 @@ bool emberAfPowerProfileClusterGetOverallSchedulePriceCallback(chip::EndpointId /** * @brief Power Profile Cluster PowerProfileScheduleConstraintsRequest Command callback (from client) */ -bool emberAfPowerProfileClusterPowerProfileScheduleConstraintsRequestCallback(chip::EndpointId endpoint, - chip::app::CommandHandler * commandObj, - uint8_t powerProfileId); +bool emberAfPowerProfileClusterPowerProfileScheduleConstraintsRequestCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t powerProfileId, + chip::app::Clusters::PowerProfile::Commands::PowerProfileScheduleConstraintsRequest::DecodableType & fields); /** * @brief Power Profile Cluster EnergyPhasesScheduleRequest Command callback (from server) */ @@ -15523,9 +15609,9 @@ bool emberAfPowerProfileClusterEnergyPhasesScheduleRequestCallback(chip::Endpoin /** * @brief Power Profile Cluster EnergyPhasesScheduleStateRequest Command callback (from client) */ -bool emberAfPowerProfileClusterEnergyPhasesScheduleStateRequestCallback(chip::EndpointId endpoint, - chip::app::CommandHandler * commandObj, - uint8_t powerProfileId); +bool emberAfPowerProfileClusterEnergyPhasesScheduleStateRequestCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t powerProfileId, chip::app::Clusters::PowerProfile::Commands::EnergyPhasesScheduleStateRequest::DecodableType & fields); /** * @brief Power Profile Cluster EnergyPhasesScheduleStateResponse Command callback (from server) */ @@ -15535,10 +15621,10 @@ bool emberAfPowerProfileClusterEnergyPhasesScheduleStateResponseCallback( /** * @brief Power Profile Cluster GetPowerProfilePriceExtendedResponse Command callback (from client) */ -bool emberAfPowerProfileClusterGetPowerProfilePriceExtendedResponseCallback(chip::EndpointId endpoint, - chip::app::CommandHandler * commandObj, - uint8_t powerProfileId, uint16_t currency, - uint32_t price, uint8_t priceTrailingDigit); +bool emberAfPowerProfileClusterGetPowerProfilePriceExtendedResponseCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t powerProfileId, uint16_t currency, uint32_t price, uint8_t priceTrailingDigit, + chip::app::Clusters::PowerProfile::Commands::GetPowerProfilePriceExtendedResponse::DecodableType & fields); /** * @brief Power Profile Cluster EnergyPhasesScheduleStateNotification Command callback (from server) */ @@ -15568,8 +15654,9 @@ bool emberAfPowerProfileClusterGetPowerProfilePriceExtendedCallback(chip::Endpoi /** * @brief Appliance Control Cluster ExecutionOfACommand Command callback (from client) */ -bool emberAfApplianceControlClusterExecutionOfACommandCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t commandId); +bool emberAfApplianceControlClusterExecutionOfACommandCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t commandId, chip::app::Clusters::ApplianceControl::Commands::ExecutionOfACommand::DecodableType & fields); /** * @brief Appliance Control Cluster SignalStateResponse Command callback (from server) */ @@ -15579,7 +15666,9 @@ bool emberAfApplianceControlClusterSignalStateResponseCallback(chip::EndpointId /** * @brief Appliance Control Cluster SignalState Command callback (from client) */ -bool emberAfApplianceControlClusterSignalStateCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfApplianceControlClusterSignalStateCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::ApplianceControl::Commands::SignalState::DecodableType & fields); /** * @brief Appliance Control Cluster SignalStateNotification Command callback (from server) */ @@ -15590,22 +15679,28 @@ bool emberAfApplianceControlClusterSignalStateNotificationCallback(chip::Endpoin /** * @brief Appliance Control Cluster WriteFunctions Command callback (from client) */ -bool emberAfApplianceControlClusterWriteFunctionsCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint16_t functionId, uint8_t functionDataType, - /* TYPE WARNING: array array defaults to */ uint8_t * functionData); +bool emberAfApplianceControlClusterWriteFunctionsCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t functionId, uint8_t functionDataType, /* TYPE WARNING: array array defaults to */ uint8_t * functionData, + chip::app::Clusters::ApplianceControl::Commands::WriteFunctions::DecodableType & fields); /** * @brief Appliance Control Cluster OverloadPauseResume Command callback (from client) */ -bool emberAfApplianceControlClusterOverloadPauseResumeCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfApplianceControlClusterOverloadPauseResumeCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::ApplianceControl::Commands::OverloadPauseResume::DecodableType & fields); /** * @brief Appliance Control Cluster OverloadPause Command callback (from client) */ -bool emberAfApplianceControlClusterOverloadPauseCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfApplianceControlClusterOverloadPauseCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::ApplianceControl::Commands::OverloadPause::DecodableType & fields); /** * @brief Appliance Control Cluster OverloadWarning Command callback (from client) */ -bool emberAfApplianceControlClusterOverloadWarningCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t warningEvent); +bool emberAfApplianceControlClusterOverloadWarningCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t warningEvent, chip::app::Clusters::ApplianceControl::Commands::OverloadWarning::DecodableType & fields); /** * @brief Poll Control Cluster CheckIn Command callback (from server) */ @@ -15613,22 +15708,28 @@ bool emberAfPollControlClusterCheckInCallback(chip::EndpointId endpoint, chip::a /** * @brief Poll Control Cluster CheckInResponse Command callback (from client) */ -bool emberAfPollControlClusterCheckInResponseCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - bool startFastPolling, uint16_t fastPollTimeout); +bool emberAfPollControlClusterCheckInResponseCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + bool startFastPolling, uint16_t fastPollTimeout, + chip::app::Clusters::PollControl::Commands::CheckInResponse::DecodableType & fields); /** * @brief Poll Control Cluster FastPollStop Command callback (from client) */ -bool emberAfPollControlClusterFastPollStopCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfPollControlClusterFastPollStopCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::PollControl::Commands::FastPollStop::DecodableType & fields); /** * @brief Poll Control Cluster SetLongPollInterval Command callback (from client) */ -bool emberAfPollControlClusterSetLongPollIntervalCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint32_t newLongPollInterval); +bool emberAfPollControlClusterSetLongPollIntervalCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint32_t newLongPollInterval, chip::app::Clusters::PollControl::Commands::SetLongPollInterval::DecodableType & fields); /** * @brief Poll Control Cluster SetShortPollInterval Command callback (from client) */ -bool emberAfPollControlClusterSetShortPollIntervalCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint16_t newShortPollInterval); +bool emberAfPollControlClusterSetShortPollIntervalCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t newShortPollInterval, chip::app::Clusters::PollControl::Commands::SetShortPollInterval::DecodableType & fields); /** * @brief Basic Cluster StartUp Command callback (from server) */ @@ -15636,7 +15737,9 @@ bool emberAfBasicClusterStartUpCallback(chip::EndpointId endpoint, chip::app::Co /** * @brief Basic Cluster MfgSpecificPing Command callback (from client) */ -bool emberAfBasicClusterMfgSpecificPingCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::Basic::Commands::MfgSpecificPing::DecodableType & fields); /** * @brief Basic Cluster ShutDown Command callback (from server) */ @@ -15648,23 +15751,25 @@ bool emberAfBasicClusterLeaveCallback(chip::EndpointId endpoint, chip::app::Comm /** * @brief OTA Software Update Provider Cluster QueryImage Command callback (from client) */ -bool emberAfOtaSoftwareUpdateProviderClusterQueryImageCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint16_t vendorId, uint16_t productId, uint16_t hardwareVersion, - uint32_t softwareVersion, uint8_t protocolsSupported, - uint8_t * location, bool requestorCanConsent, - chip::ByteSpan metadataForProvider); +bool emberAfOtaSoftwareUpdateProviderClusterQueryImageCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t vendorId, uint16_t productId, uint16_t hardwareVersion, uint32_t softwareVersion, uint8_t protocolsSupported, + uint8_t * location, bool requestorCanConsent, chip::ByteSpan metadataForProvider, + chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImage::DecodableType & fields); /** * @brief OTA Software Update Provider Cluster ApplyUpdateRequest Command callback (from client) */ -bool emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestCallback(chip::EndpointId endpoint, - chip::app::CommandHandler * commandObj, - chip::ByteSpan updateToken, uint32_t newVersion); +bool emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::ByteSpan updateToken, uint32_t newVersion, + chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateRequest::DecodableType & fields); /** * @brief OTA Software Update Provider Cluster NotifyUpdateApplied Command callback (from client) */ -bool emberAfOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedCallback(chip::EndpointId endpoint, - chip::app::CommandHandler * commandObj, - chip::ByteSpan updateToken, uint32_t softwareVersion); +bool emberAfOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::ByteSpan updateToken, uint32_t softwareVersion, + chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::NotifyUpdateApplied::DecodableType & fields); /** * @brief OTA Software Update Provider Cluster QueryImageResponse Command callback (from server) */ @@ -15683,16 +15788,17 @@ bool emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestResponseCallback(c /** * @brief OTA Software Update Requestor Cluster AnnounceOtaProvider Command callback (from client) */ -bool emberAfOtaSoftwareUpdateRequestorClusterAnnounceOtaProviderCallback(chip::EndpointId endpoint, - chip::app::CommandHandler * commandObj, - chip::ByteSpan providerLocation, uint16_t vendorId, - uint8_t announcementReason, - chip::ByteSpan metadataForNode); +bool emberAfOtaSoftwareUpdateRequestorClusterAnnounceOtaProviderCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::ByteSpan providerLocation, uint16_t vendorId, uint8_t announcementReason, chip::ByteSpan metadataForNode, + chip::app::Clusters::OtaSoftwareUpdateRequestor::Commands::AnnounceOtaProvider::DecodableType & fields); /** * @brief General Commissioning Cluster ArmFailSafe Command callback (from client) */ -bool emberAfGeneralCommissioningClusterArmFailSafeCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint16_t expiryLengthSeconds, uint64_t breadcrumb, uint32_t timeoutMs); +bool emberAfGeneralCommissioningClusterArmFailSafeCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t expiryLengthSeconds, uint64_t breadcrumb, uint32_t timeoutMs, + chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafe::DecodableType & fields); /** * @brief General Commissioning Cluster ArmFailSafeResponse Command callback (from server) */ @@ -15701,9 +15807,10 @@ bool emberAfGeneralCommissioningClusterArmFailSafeResponseCallback(chip::Endpoin /** * @brief General Commissioning Cluster SetRegulatoryConfig Command callback (from client) */ -bool emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback(chip::EndpointId endpoint, - chip::app::CommandHandler * commandObj, uint8_t location, - uint8_t * countryCode, uint64_t breadcrumb, uint32_t timeoutMs); +bool emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t location, uint8_t * countryCode, uint64_t breadcrumb, uint32_t timeoutMs, + chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfig::DecodableType & fields); /** * @brief General Commissioning Cluster SetRegulatoryConfigResponse Command callback (from server) */ @@ -15713,8 +15820,9 @@ bool emberAfGeneralCommissioningClusterSetRegulatoryConfigResponseCallback(chip: /** * @brief General Commissioning Cluster CommissioningComplete Command callback (from client) */ -bool emberAfGeneralCommissioningClusterCommissioningCompleteCallback(chip::EndpointId endpoint, - chip::app::CommandHandler * commandObj); +bool emberAfGeneralCommissioningClusterCommissioningCompleteCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::GeneralCommissioning::Commands::CommissioningComplete::DecodableType & fields); /** * @brief General Commissioning Cluster CommissioningCompleteResponse Command callback (from server) */ @@ -15724,8 +15832,10 @@ bool emberAfGeneralCommissioningClusterCommissioningCompleteResponseCallback(chi /** * @brief Network Commissioning Cluster ScanNetworks Command callback (from client) */ -bool emberAfNetworkCommissioningClusterScanNetworksCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - chip::ByteSpan ssid, uint64_t breadcrumb, uint32_t timeoutMs); +bool emberAfNetworkCommissioningClusterScanNetworksCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::ByteSpan ssid, uint64_t breadcrumb, uint32_t timeoutMs, + chip::app::Clusters::NetworkCommissioning::Commands::ScanNetworks::DecodableType & fields); /** * @brief Network Commissioning Cluster ScanNetworksResponse Command callback (from server) */ @@ -15736,9 +15846,10 @@ bool emberAfNetworkCommissioningClusterScanNetworksResponseCallback( /** * @brief Network Commissioning Cluster AddWiFiNetwork Command callback (from client) */ -bool emberAfNetworkCommissioningClusterAddWiFiNetworkCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - chip::ByteSpan ssid, chip::ByteSpan credentials, uint64_t breadcrumb, - uint32_t timeoutMs); +bool emberAfNetworkCommissioningClusterAddWiFiNetworkCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::ByteSpan ssid, chip::ByteSpan credentials, uint64_t breadcrumb, uint32_t timeoutMs, + chip::app::Clusters::NetworkCommissioning::Commands::AddWiFiNetwork::DecodableType & fields); /** * @brief Network Commissioning Cluster AddWiFiNetworkResponse Command callback (from server) */ @@ -15748,9 +15859,10 @@ bool emberAfNetworkCommissioningClusterAddWiFiNetworkResponseCallback(chip::Endp /** * @brief Network Commissioning Cluster UpdateWiFiNetwork Command callback (from client) */ -bool emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - chip::ByteSpan ssid, chip::ByteSpan credentials, - uint64_t breadcrumb, uint32_t timeoutMs); +bool emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::ByteSpan ssid, chip::ByteSpan credentials, uint64_t breadcrumb, uint32_t timeoutMs, + chip::app::Clusters::NetworkCommissioning::Commands::UpdateWiFiNetwork::DecodableType & fields); /** * @brief Network Commissioning Cluster UpdateWiFiNetworkResponse Command callback (from server) */ @@ -15760,9 +15872,10 @@ bool emberAfNetworkCommissioningClusterUpdateWiFiNetworkResponseCallback(chip::E /** * @brief Network Commissioning Cluster AddThreadNetwork Command callback (from client) */ -bool emberAfNetworkCommissioningClusterAddThreadNetworkCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - chip::ByteSpan operationalDataset, uint64_t breadcrumb, - uint32_t timeoutMs); +bool emberAfNetworkCommissioningClusterAddThreadNetworkCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::ByteSpan operationalDataset, uint64_t breadcrumb, uint32_t timeoutMs, + chip::app::Clusters::NetworkCommissioning::Commands::AddThreadNetwork::DecodableType & fields); /** * @brief Network Commissioning Cluster AddThreadNetworkResponse Command callback (from server) */ @@ -15772,10 +15885,10 @@ bool emberAfNetworkCommissioningClusterAddThreadNetworkResponseCallback(chip::En /** * @brief Network Commissioning Cluster UpdateThreadNetwork Command callback (from client) */ -bool emberAfNetworkCommissioningClusterUpdateThreadNetworkCallback(chip::EndpointId endpoint, - chip::app::CommandHandler * commandObj, - chip::ByteSpan operationalDataset, uint64_t breadcrumb, - uint32_t timeoutMs); +bool emberAfNetworkCommissioningClusterUpdateThreadNetworkCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::ByteSpan operationalDataset, uint64_t breadcrumb, uint32_t timeoutMs, + chip::app::Clusters::NetworkCommissioning::Commands::UpdateThreadNetwork::DecodableType & fields); /** * @brief Network Commissioning Cluster UpdateThreadNetworkResponse Command callback (from server) */ @@ -15785,8 +15898,10 @@ bool emberAfNetworkCommissioningClusterUpdateThreadNetworkResponseCallback(chip: /** * @brief Network Commissioning Cluster RemoveNetwork Command callback (from client) */ -bool emberAfNetworkCommissioningClusterRemoveNetworkCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - chip::ByteSpan NetworkID, uint64_t Breadcrumb, uint32_t TimeoutMs); +bool emberAfNetworkCommissioningClusterRemoveNetworkCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::ByteSpan NetworkID, uint64_t Breadcrumb, uint32_t TimeoutMs, + chip::app::Clusters::NetworkCommissioning::Commands::RemoveNetwork::DecodableType & fields); /** * @brief Network Commissioning Cluster RemoveNetworkResponse Command callback (from server) */ @@ -15796,8 +15911,10 @@ bool emberAfNetworkCommissioningClusterRemoveNetworkResponseCallback(chip::Endpo /** * @brief Network Commissioning Cluster EnableNetwork Command callback (from client) */ -bool emberAfNetworkCommissioningClusterEnableNetworkCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - chip::ByteSpan networkID, uint64_t breadcrumb, uint32_t timeoutMs); +bool emberAfNetworkCommissioningClusterEnableNetworkCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::ByteSpan networkID, uint64_t breadcrumb, uint32_t timeoutMs, + chip::app::Clusters::NetworkCommissioning::Commands::EnableNetwork::DecodableType & fields); /** * @brief Network Commissioning Cluster EnableNetworkResponse Command callback (from server) */ @@ -15807,8 +15924,10 @@ bool emberAfNetworkCommissioningClusterEnableNetworkResponseCallback(chip::Endpo /** * @brief Network Commissioning Cluster DisableNetwork Command callback (from client) */ -bool emberAfNetworkCommissioningClusterDisableNetworkCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - chip::ByteSpan networkID, uint64_t breadcrumb, uint32_t timeoutMs); +bool emberAfNetworkCommissioningClusterDisableNetworkCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::ByteSpan networkID, uint64_t breadcrumb, uint32_t timeoutMs, + chip::app::Clusters::NetworkCommissioning::Commands::DisableNetwork::DecodableType & fields); /** * @brief Network Commissioning Cluster DisableNetworkResponse Command callback (from server) */ @@ -15818,15 +15937,17 @@ bool emberAfNetworkCommissioningClusterDisableNetworkResponseCallback(chip::Endp /** * @brief Network Commissioning Cluster GetLastNetworkCommissioningResult Command callback (from client) */ -bool emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback(chip::EndpointId endpoint, - chip::app::CommandHandler * commandObj, - uint32_t timeoutMs); +bool emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint32_t timeoutMs, + chip::app::Clusters::NetworkCommissioning::Commands::GetLastNetworkCommissioningResult::DecodableType & fields); /** * @brief Diagnostic Logs Cluster RetrieveLogsRequest Command callback (from client) */ -bool emberAfDiagnosticLogsClusterRetrieveLogsRequestCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t intent, uint8_t requestedProtocol, - chip::ByteSpan transferFileDesignator); +bool emberAfDiagnosticLogsClusterRetrieveLogsRequestCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t intent, uint8_t requestedProtocol, chip::ByteSpan transferFileDesignator, + chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsRequest::DecodableType & fields); /** * @brief Diagnostic Logs Cluster RetrieveLogsResponse Command callback (from server) */ @@ -15837,19 +15958,27 @@ bool emberAfDiagnosticLogsClusterRetrieveLogsResponseCallback(chip::EndpointId e /** * @brief Software Diagnostics Cluster ResetWatermarks Command callback (from client) */ -bool emberAfSoftwareDiagnosticsClusterResetWatermarksCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfSoftwareDiagnosticsClusterResetWatermarksCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::SoftwareDiagnostics::Commands::ResetWatermarks::DecodableType & fields); /** * @brief Thread Network Diagnostics Cluster ResetCounts Command callback (from client) */ -bool emberAfThreadNetworkDiagnosticsClusterResetCountsCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfThreadNetworkDiagnosticsClusterResetCountsCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::ThreadNetworkDiagnostics::Commands::ResetCounts::DecodableType & fields); /** * @brief WiFi Network Diagnostics Cluster ResetCounts Command callback (from client) */ -bool emberAfWiFiNetworkDiagnosticsClusterResetCountsCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfWiFiNetworkDiagnosticsClusterResetCountsCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::WiFiNetworkDiagnostics::Commands::ResetCounts::DecodableType & fields); /** * @brief Ethernet Network Diagnostics Cluster ResetCounts Command callback (from client) */ -bool emberAfEthernetNetworkDiagnosticsClusterResetCountsCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfEthernetNetworkDiagnosticsClusterResetCountsCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::EthernetNetworkDiagnostics::Commands::ResetCounts::DecodableType & fields); /** * @brief Bridged Device Basic Cluster StartUp Command callback (from server) */ @@ -15870,25 +15999,30 @@ bool emberAfBridgedDeviceBasicClusterReachableChangedCallback(chip::EndpointId e * @brief AdministratorCommissioning Cluster OpenCommissioningWindow Command callback (from client) */ bool emberAfAdministratorCommissioningClusterOpenCommissioningWindowCallback( - chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint16_t CommissioningTimeout, chip::ByteSpan PAKEVerifier, - uint16_t Discriminator, uint32_t Iterations, chip::ByteSpan Salt, uint16_t PasscodeID); + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t CommissioningTimeout, chip::ByteSpan PAKEVerifier, uint16_t Discriminator, uint32_t Iterations, chip::ByteSpan Salt, + uint16_t PasscodeID, + chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::DecodableType & fields); /** * @brief AdministratorCommissioning Cluster OpenBasicCommissioningWindow Command callback (from client) */ -bool emberAfAdministratorCommissioningClusterOpenBasicCommissioningWindowCallback(chip::EndpointId endpoint, - chip::app::CommandHandler * commandObj, - uint16_t CommissioningTimeout); +bool emberAfAdministratorCommissioningClusterOpenBasicCommissioningWindowCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t CommissioningTimeout, + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::DecodableType & fields); /** * @brief AdministratorCommissioning Cluster RevokeCommissioning Command callback (from client) */ -bool emberAfAdministratorCommissioningClusterRevokeCommissioningCallback(chip::EndpointId endpoint, - chip::app::CommandHandler * commandObj); +bool emberAfAdministratorCommissioningClusterRevokeCommissioningCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::AdministratorCommissioning::Commands::RevokeCommissioning::DecodableType & fields); /** * @brief Operational Credentials Cluster AttestationRequest Command callback (from client) */ -bool emberAfOperationalCredentialsClusterAttestationRequestCallback(chip::EndpointId endpoint, - chip::app::CommandHandler * commandObj, - chip::ByteSpan AttestationNonce); +bool emberAfOperationalCredentialsClusterAttestationRequestCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::ByteSpan AttestationNonce, + chip::app::Clusters::OperationalCredentials::Commands::AttestationRequest::DecodableType & fields); /** * @brief Operational Credentials Cluster AttestationResponse Command callback (from server) */ @@ -15898,9 +16032,10 @@ bool emberAfOperationalCredentialsClusterAttestationResponseCallback(chip::Endpo /** * @brief Operational Credentials Cluster CertificateChainRequest Command callback (from client) */ -bool emberAfOperationalCredentialsClusterCertificateChainRequestCallback(chip::EndpointId endpoint, - chip::app::CommandHandler * commandObj, - uint8_t CertificateType); +bool emberAfOperationalCredentialsClusterCertificateChainRequestCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t CertificateType, + chip::app::Clusters::OperationalCredentials::Commands::CertificateChainRequest::DecodableType & fields); /** * @brief Operational Credentials Cluster CertificateChainResponse Command callback (from server) */ @@ -15910,8 +16045,9 @@ bool emberAfOperationalCredentialsClusterCertificateChainResponseCallback(chip:: /** * @brief Operational Credentials Cluster OpCSRRequest Command callback (from client) */ -bool emberAfOperationalCredentialsClusterOpCSRRequestCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - chip::ByteSpan CSRNonce); +bool emberAfOperationalCredentialsClusterOpCSRRequestCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::ByteSpan CSRNonce, chip::app::Clusters::OperationalCredentials::Commands::OpCSRRequest::DecodableType & fields); /** * @brief Operational Credentials Cluster OpCSRResponse Command callback (from server) */ @@ -15920,14 +16056,17 @@ bool emberAfOperationalCredentialsClusterOpCSRResponseCallback(chip::EndpointId /** * @brief Operational Credentials Cluster AddNOC Command callback (from client) */ -bool emberAfOperationalCredentialsClusterAddNOCCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - chip::ByteSpan NOCValue, chip::ByteSpan ICACValue, chip::ByteSpan IPKValue, - chip::NodeId CaseAdminNode, uint16_t AdminVendorId); +bool emberAfOperationalCredentialsClusterAddNOCCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::ByteSpan NOCValue, chip::ByteSpan ICACValue, chip::ByteSpan IPKValue, chip::NodeId CaseAdminNode, uint16_t AdminVendorId, + chip::app::Clusters::OperationalCredentials::Commands::AddNOC::DecodableType & fields); /** * @brief Operational Credentials Cluster UpdateNOC Command callback (from client) */ -bool emberAfOperationalCredentialsClusterUpdateNOCCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - chip::ByteSpan NOCValue, chip::ByteSpan ICACValue); +bool emberAfOperationalCredentialsClusterUpdateNOCCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::ByteSpan NOCValue, chip::ByteSpan ICACValue, + chip::app::Clusters::OperationalCredentials::Commands::UpdateNOC::DecodableType & fields); /** * @brief Operational Credentials Cluster NOCResponse Command callback (from server) */ @@ -15936,29 +16075,36 @@ bool emberAfOperationalCredentialsClusterNOCResponseCallback(chip::EndpointId en /** * @brief Operational Credentials Cluster UpdateFabricLabel Command callback (from client) */ -bool emberAfOperationalCredentialsClusterUpdateFabricLabelCallback(chip::EndpointId endpoint, - chip::app::CommandHandler * commandObj, uint8_t * Label); +bool emberAfOperationalCredentialsClusterUpdateFabricLabelCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t * Label, chip::app::Clusters::OperationalCredentials::Commands::UpdateFabricLabel::DecodableType & fields); /** * @brief Operational Credentials Cluster RemoveFabric Command callback (from client) */ -bool emberAfOperationalCredentialsClusterRemoveFabricCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t FabricIndex); +bool emberAfOperationalCredentialsClusterRemoveFabricCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t FabricIndex, chip::app::Clusters::OperationalCredentials::Commands::RemoveFabric::DecodableType & fields); /** * @brief Operational Credentials Cluster AddTrustedRootCertificate Command callback (from client) */ -bool emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback(chip::EndpointId endpoint, - chip::app::CommandHandler * commandObj, - chip::ByteSpan RootCertificate); +bool emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::ByteSpan RootCertificate, + chip::app::Clusters::OperationalCredentials::Commands::AddTrustedRootCertificate::DecodableType & fields); /** * @brief Operational Credentials Cluster RemoveTrustedRootCertificate Command callback (from client) */ -bool emberAfOperationalCredentialsClusterRemoveTrustedRootCertificateCallback(chip::EndpointId endpoint, - chip::app::CommandHandler * commandObj, - chip::ByteSpan TrustedRootIdentifier); +bool emberAfOperationalCredentialsClusterRemoveTrustedRootCertificateCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::ByteSpan TrustedRootIdentifier, + chip::app::Clusters::OperationalCredentials::Commands::RemoveTrustedRootCertificate::DecodableType & fields); /** * @brief Door Lock Cluster LockDoor Command callback (from client) */ -bool emberAfDoorLockClusterLockDoorCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint8_t * PIN); +bool emberAfDoorLockClusterLockDoorCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t * PIN, + chip::app::Clusters::DoorLock::Commands::LockDoor::DecodableType & fields); /** * @brief Door Lock Cluster LockDoorResponse Command callback (from server) */ @@ -15967,7 +16113,10 @@ bool emberAfDoorLockClusterLockDoorResponseCallback(chip::EndpointId endpoint, c /** * @brief Door Lock Cluster UnlockDoor Command callback (from client) */ -bool emberAfDoorLockClusterUnlockDoorCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint8_t * PIN); +bool emberAfDoorLockClusterUnlockDoorCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t * PIN, + chip::app::Clusters::DoorLock::Commands::UnlockDoor::DecodableType & fields); /** * @brief Door Lock Cluster UnlockDoorResponse Command callback (from server) */ @@ -15976,7 +16125,9 @@ bool emberAfDoorLockClusterUnlockDoorResponseCallback(chip::EndpointId endpoint, /** * @brief Door Lock Cluster Toggle Command callback (from client) */ -bool emberAfDoorLockClusterToggleCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint8_t * pin); +bool emberAfDoorLockClusterToggleCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t * pin, chip::app::Clusters::DoorLock::Commands::Toggle::DecodableType & fields); /** * @brief Door Lock Cluster ToggleResponse Command callback (from server) */ @@ -15984,8 +16135,9 @@ bool emberAfDoorLockClusterToggleResponseCallback(chip::EndpointId endpoint, chi /** * @brief Door Lock Cluster UnlockWithTimeout Command callback (from client) */ -bool emberAfDoorLockClusterUnlockWithTimeoutCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint16_t timeoutInSeconds, uint8_t * pin); +bool emberAfDoorLockClusterUnlockWithTimeoutCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t timeoutInSeconds, uint8_t * pin, chip::app::Clusters::DoorLock::Commands::UnlockWithTimeout::DecodableType & fields); /** * @brief Door Lock Cluster UnlockWithTimeoutResponse Command callback (from server) */ @@ -15994,8 +16146,10 @@ bool emberAfDoorLockClusterUnlockWithTimeoutResponseCallback(chip::EndpointId en /** * @brief Door Lock Cluster GetLogRecord Command callback (from client) */ -bool emberAfDoorLockClusterGetLogRecordCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint16_t logIndex); +bool emberAfDoorLockClusterGetLogRecordCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t logIndex, + chip::app::Clusters::DoorLock::Commands::GetLogRecord::DecodableType & fields); /** * @brief Door Lock Cluster GetLogRecordResponse Command callback (from server) */ @@ -16005,8 +16159,10 @@ bool emberAfDoorLockClusterGetLogRecordResponseCallback(chip::EndpointId endpoin /** * @brief Door Lock Cluster SetPin Command callback (from client) */ -bool emberAfDoorLockClusterSetPinCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint16_t userId, - uint8_t userStatus, uint8_t userType, uint8_t * pin); +bool emberAfDoorLockClusterSetPinCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t userId, uint8_t userStatus, uint8_t userType, uint8_t * pin, + chip::app::Clusters::DoorLock::Commands::SetPin::DecodableType & fields); /** * @brief Door Lock Cluster SetPinResponse Command callback (from server) */ @@ -16014,7 +16170,9 @@ bool emberAfDoorLockClusterSetPinResponseCallback(chip::EndpointId endpoint, chi /** * @brief Door Lock Cluster GetPin Command callback (from client) */ -bool emberAfDoorLockClusterGetPinCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint16_t userId); +bool emberAfDoorLockClusterGetPinCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t userId, chip::app::Clusters::DoorLock::Commands::GetPin::DecodableType & fields); /** * @brief Door Lock Cluster GetPinResponse Command callback (from server) */ @@ -16023,7 +16181,10 @@ bool emberAfDoorLockClusterGetPinResponseCallback(chip::EndpointId endpoint, chi /** * @brief Door Lock Cluster ClearPin Command callback (from client) */ -bool emberAfDoorLockClusterClearPinCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint16_t userId); +bool emberAfDoorLockClusterClearPinCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t userId, + chip::app::Clusters::DoorLock::Commands::ClearPin::DecodableType & fields); /** * @brief Door Lock Cluster ClearPinResponse Command callback (from server) */ @@ -16032,7 +16193,9 @@ bool emberAfDoorLockClusterClearPinResponseCallback(chip::EndpointId endpoint, c /** * @brief Door Lock Cluster ClearAllPins Command callback (from client) */ -bool emberAfDoorLockClusterClearAllPinsCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfDoorLockClusterClearAllPinsCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::DoorLock::Commands::ClearAllPins::DecodableType & fields); /** * @brief Door Lock Cluster ClearAllPinsResponse Command callback (from server) */ @@ -16041,8 +16204,10 @@ bool emberAfDoorLockClusterClearAllPinsResponseCallback(chip::EndpointId endpoin /** * @brief Door Lock Cluster SetUserStatus Command callback (from client) */ -bool emberAfDoorLockClusterSetUserStatusCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint16_t userId, - uint8_t userStatus); +bool emberAfDoorLockClusterSetUserStatusCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t userId, uint8_t userStatus, + chip::app::Clusters::DoorLock::Commands::SetUserStatus::DecodableType & fields); /** * @brief Door Lock Cluster SetUserStatusResponse Command callback (from server) */ @@ -16051,8 +16216,10 @@ bool emberAfDoorLockClusterSetUserStatusResponseCallback(chip::EndpointId endpoi /** * @brief Door Lock Cluster GetUserStatus Command callback (from client) */ -bool emberAfDoorLockClusterGetUserStatusCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint16_t userId); +bool emberAfDoorLockClusterGetUserStatusCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t userId, + chip::app::Clusters::DoorLock::Commands::GetUserStatus::DecodableType & fields); /** * @brief Door Lock Cluster GetUserStatusResponse Command callback (from server) */ @@ -16061,9 +16228,10 @@ bool emberAfDoorLockClusterGetUserStatusResponseCallback(chip::EndpointId endpoi /** * @brief Door Lock Cluster SetWeekdaySchedule Command callback (from client) */ -bool emberAfDoorLockClusterSetWeekdayScheduleCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t scheduleId, uint16_t userId, uint8_t daysMask, uint8_t startHour, - uint8_t startMinute, uint8_t endHour, uint8_t endMinute); +bool emberAfDoorLockClusterSetWeekdayScheduleCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t scheduleId, uint16_t userId, uint8_t daysMask, uint8_t startHour, uint8_t startMinute, uint8_t endHour, + uint8_t endMinute, chip::app::Clusters::DoorLock::Commands::SetWeekdaySchedule::DecodableType & fields); /** * @brief Door Lock Cluster SetWeekdayScheduleResponse Command callback (from server) */ @@ -16072,8 +16240,9 @@ bool emberAfDoorLockClusterSetWeekdayScheduleResponseCallback(chip::EndpointId e /** * @brief Door Lock Cluster GetWeekdaySchedule Command callback (from client) */ -bool emberAfDoorLockClusterGetWeekdayScheduleCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t scheduleId, uint16_t userId); +bool emberAfDoorLockClusterGetWeekdayScheduleCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t scheduleId, uint16_t userId, chip::app::Clusters::DoorLock::Commands::GetWeekdaySchedule::DecodableType & fields); /** * @brief Door Lock Cluster GetWeekdayScheduleResponse Command callback (from server) */ @@ -16084,8 +16253,9 @@ bool emberAfDoorLockClusterGetWeekdayScheduleResponseCallback(chip::EndpointId e /** * @brief Door Lock Cluster ClearWeekdaySchedule Command callback (from client) */ -bool emberAfDoorLockClusterClearWeekdayScheduleCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t scheduleId, uint16_t userId); +bool emberAfDoorLockClusterClearWeekdayScheduleCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t scheduleId, uint16_t userId, chip::app::Clusters::DoorLock::Commands::ClearWeekdaySchedule::DecodableType & fields); /** * @brief Door Lock Cluster ClearWeekdayScheduleResponse Command callback (from server) */ @@ -16094,9 +16264,10 @@ bool emberAfDoorLockClusterClearWeekdayScheduleResponseCallback(chip::EndpointId /** * @brief Door Lock Cluster SetYeardaySchedule Command callback (from client) */ -bool emberAfDoorLockClusterSetYeardayScheduleCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t scheduleId, uint16_t userId, uint32_t localStartTime, - uint32_t localEndTime); +bool emberAfDoorLockClusterSetYeardayScheduleCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t scheduleId, uint16_t userId, uint32_t localStartTime, uint32_t localEndTime, + chip::app::Clusters::DoorLock::Commands::SetYeardaySchedule::DecodableType & fields); /** * @brief Door Lock Cluster SetYeardayScheduleResponse Command callback (from server) */ @@ -16105,8 +16276,9 @@ bool emberAfDoorLockClusterSetYeardayScheduleResponseCallback(chip::EndpointId e /** * @brief Door Lock Cluster GetYeardaySchedule Command callback (from client) */ -bool emberAfDoorLockClusterGetYeardayScheduleCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t scheduleId, uint16_t userId); +bool emberAfDoorLockClusterGetYeardayScheduleCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t scheduleId, uint16_t userId, chip::app::Clusters::DoorLock::Commands::GetYeardaySchedule::DecodableType & fields); /** * @brief Door Lock Cluster GetYeardayScheduleResponse Command callback (from server) */ @@ -16116,8 +16288,9 @@ bool emberAfDoorLockClusterGetYeardayScheduleResponseCallback(chip::EndpointId e /** * @brief Door Lock Cluster ClearYeardaySchedule Command callback (from client) */ -bool emberAfDoorLockClusterClearYeardayScheduleCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t scheduleId, uint16_t userId); +bool emberAfDoorLockClusterClearYeardayScheduleCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t scheduleId, uint16_t userId, chip::app::Clusters::DoorLock::Commands::ClearYeardaySchedule::DecodableType & fields); /** * @brief Door Lock Cluster ClearYeardayScheduleResponse Command callback (from server) */ @@ -16126,9 +16299,10 @@ bool emberAfDoorLockClusterClearYeardayScheduleResponseCallback(chip::EndpointId /** * @brief Door Lock Cluster SetHolidaySchedule Command callback (from client) */ -bool emberAfDoorLockClusterSetHolidayScheduleCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t scheduleId, uint32_t localStartTime, uint32_t localEndTime, - uint8_t operatingModeDuringHoliday); +bool emberAfDoorLockClusterSetHolidayScheduleCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t scheduleId, uint32_t localStartTime, uint32_t localEndTime, uint8_t operatingModeDuringHoliday, + chip::app::Clusters::DoorLock::Commands::SetHolidaySchedule::DecodableType & fields); /** * @brief Door Lock Cluster SetHolidayScheduleResponse Command callback (from server) */ @@ -16137,8 +16311,9 @@ bool emberAfDoorLockClusterSetHolidayScheduleResponseCallback(chip::EndpointId e /** * @brief Door Lock Cluster GetHolidaySchedule Command callback (from client) */ -bool emberAfDoorLockClusterGetHolidayScheduleCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t scheduleId); +bool emberAfDoorLockClusterGetHolidayScheduleCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t scheduleId, chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::DecodableType & fields); /** * @brief Door Lock Cluster GetHolidayScheduleResponse Command callback (from server) */ @@ -16148,8 +16323,9 @@ bool emberAfDoorLockClusterGetHolidayScheduleResponseCallback(chip::EndpointId e /** * @brief Door Lock Cluster ClearHolidaySchedule Command callback (from client) */ -bool emberAfDoorLockClusterClearHolidayScheduleCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t scheduleId); +bool emberAfDoorLockClusterClearHolidayScheduleCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t scheduleId, chip::app::Clusters::DoorLock::Commands::ClearHolidaySchedule::DecodableType & fields); /** * @brief Door Lock Cluster ClearHolidayScheduleResponse Command callback (from server) */ @@ -16158,8 +16334,10 @@ bool emberAfDoorLockClusterClearHolidayScheduleResponseCallback(chip::EndpointId /** * @brief Door Lock Cluster SetUserType Command callback (from client) */ -bool emberAfDoorLockClusterSetUserTypeCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint16_t userId, - uint8_t userType); +bool emberAfDoorLockClusterSetUserTypeCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t userId, uint8_t userType, + chip::app::Clusters::DoorLock::Commands::SetUserType::DecodableType & fields); /** * @brief Door Lock Cluster SetUserTypeResponse Command callback (from server) */ @@ -16168,7 +16346,10 @@ bool emberAfDoorLockClusterSetUserTypeResponseCallback(chip::EndpointId endpoint /** * @brief Door Lock Cluster GetUserType Command callback (from client) */ -bool emberAfDoorLockClusterGetUserTypeCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint16_t userId); +bool emberAfDoorLockClusterGetUserTypeCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t userId, + chip::app::Clusters::DoorLock::Commands::GetUserType::DecodableType & fields); /** * @brief Door Lock Cluster GetUserTypeResponse Command callback (from server) */ @@ -16177,8 +16358,10 @@ bool emberAfDoorLockClusterGetUserTypeResponseCallback(chip::EndpointId endpoint /** * @brief Door Lock Cluster SetRfid Command callback (from client) */ -bool emberAfDoorLockClusterSetRfidCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint16_t userId, - uint8_t userStatus, uint8_t userType, uint8_t * id); +bool emberAfDoorLockClusterSetRfidCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t userId, uint8_t userStatus, uint8_t userType, uint8_t * id, + chip::app::Clusters::DoorLock::Commands::SetRfid::DecodableType & fields); /** * @brief Door Lock Cluster SetRfidResponse Command callback (from server) */ @@ -16187,7 +16370,10 @@ bool emberAfDoorLockClusterSetRfidResponseCallback(chip::EndpointId endpoint, ch /** * @brief Door Lock Cluster GetRfid Command callback (from client) */ -bool emberAfDoorLockClusterGetRfidCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint16_t userId); +bool emberAfDoorLockClusterGetRfidCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t userId, + chip::app::Clusters::DoorLock::Commands::GetRfid::DecodableType & fields); /** * @brief Door Lock Cluster GetRfidResponse Command callback (from server) */ @@ -16196,7 +16382,10 @@ bool emberAfDoorLockClusterGetRfidResponseCallback(chip::EndpointId endpoint, ch /** * @brief Door Lock Cluster ClearRfid Command callback (from client) */ -bool emberAfDoorLockClusterClearRfidCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint16_t userId); +bool emberAfDoorLockClusterClearRfidCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t userId, + chip::app::Clusters::DoorLock::Commands::ClearRfid::DecodableType & fields); /** * @brief Door Lock Cluster ClearRfidResponse Command callback (from server) */ @@ -16205,7 +16394,9 @@ bool emberAfDoorLockClusterClearRfidResponseCallback(chip::EndpointId endpoint, /** * @brief Door Lock Cluster ClearAllRfids Command callback (from client) */ -bool emberAfDoorLockClusterClearAllRfidsCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfDoorLockClusterClearAllRfidsCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::DoorLock::Commands::ClearAllRfids::DecodableType & fields); /** * @brief Door Lock Cluster ClearAllRfidsResponse Command callback (from server) */ @@ -16227,49 +16418,65 @@ bool emberAfDoorLockClusterProgrammingEventNotificationCallback(chip::EndpointId /** * @brief Window Covering Cluster UpOrOpen Command callback (from client) */ -bool emberAfWindowCoveringClusterUpOrOpenCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfWindowCoveringClusterUpOrOpenCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::WindowCovering::Commands::UpOrOpen::DecodableType & fields); /** * @brief Window Covering Cluster DownOrClose Command callback (from client) */ -bool emberAfWindowCoveringClusterDownOrCloseCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfWindowCoveringClusterDownOrCloseCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::WindowCovering::Commands::DownOrClose::DecodableType & fields); /** * @brief Window Covering Cluster StopMotion Command callback (from client) */ -bool emberAfWindowCoveringClusterStopMotionCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfWindowCoveringClusterStopMotionCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::WindowCovering::Commands::StopMotion::DecodableType & fields); /** * @brief Window Covering Cluster GoToLiftValue Command callback (from client) */ -bool emberAfWindowCoveringClusterGoToLiftValueCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint16_t liftValue); +bool emberAfWindowCoveringClusterGoToLiftValueCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t liftValue, chip::app::Clusters::WindowCovering::Commands::GoToLiftValue::DecodableType & fields); /** * @brief Window Covering Cluster GoToLiftPercentage Command callback (from client) */ -bool emberAfWindowCoveringClusterGoToLiftPercentageCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t liftPercentageValue, uint16_t liftPercent100thsValue); +bool emberAfWindowCoveringClusterGoToLiftPercentageCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t liftPercentageValue, uint16_t liftPercent100thsValue, + chip::app::Clusters::WindowCovering::Commands::GoToLiftPercentage::DecodableType & fields); /** * @brief Window Covering Cluster GoToTiltValue Command callback (from client) */ -bool emberAfWindowCoveringClusterGoToTiltValueCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint16_t tiltValue); +bool emberAfWindowCoveringClusterGoToTiltValueCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t tiltValue, chip::app::Clusters::WindowCovering::Commands::GoToTiltValue::DecodableType & fields); /** * @brief Window Covering Cluster GoToTiltPercentage Command callback (from client) */ -bool emberAfWindowCoveringClusterGoToTiltPercentageCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t tiltPercentageValue, uint16_t tiltPercent100thsValue); +bool emberAfWindowCoveringClusterGoToTiltPercentageCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t tiltPercentageValue, uint16_t tiltPercent100thsValue, + chip::app::Clusters::WindowCovering::Commands::GoToTiltPercentage::DecodableType & fields); /** * @brief Barrier Control Cluster BarrierControlGoToPercent Command callback (from client) */ -bool emberAfBarrierControlClusterBarrierControlGoToPercentCallback(chip::EndpointId endpoint, - chip::app::CommandHandler * commandObj, uint8_t percentOpen); +bool emberAfBarrierControlClusterBarrierControlGoToPercentCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t percentOpen, chip::app::Clusters::BarrierControl::Commands::BarrierControlGoToPercent::DecodableType & fields); /** * @brief Barrier Control Cluster BarrierControlStop Command callback (from client) */ -bool emberAfBarrierControlClusterBarrierControlStopCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfBarrierControlClusterBarrierControlStopCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::BarrierControl::Commands::BarrierControlStop::DecodableType & fields); /** * @brief Thermostat Cluster SetpointRaiseLower Command callback (from client) */ -bool emberAfThermostatClusterSetpointRaiseLowerCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t mode, int8_t amount); +bool emberAfThermostatClusterSetpointRaiseLowerCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t mode, int8_t amount, chip::app::Clusters::Thermostat::Commands::SetpointRaiseLower::DecodableType & fields); /** * @brief Thermostat Cluster CurrentWeeklySchedule Command callback (from server) */ @@ -16280,10 +16487,11 @@ bool emberAfThermostatClusterCurrentWeeklyScheduleCallback(chip::EndpointId endp /** * @brief Thermostat Cluster SetWeeklySchedule Command callback (from client) */ -bool emberAfThermostatClusterSetWeeklyScheduleCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t numberOfTransitionsForSequence, uint8_t dayOfWeekForSequence, - uint8_t modeForSequence, - /* TYPE WARNING: array array defaults to */ uint8_t * payload); +bool emberAfThermostatClusterSetWeeklyScheduleCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t numberOfTransitionsForSequence, uint8_t dayOfWeekForSequence, uint8_t modeForSequence, + /* TYPE WARNING: array array defaults to */ uint8_t * payload, + chip::app::Clusters::Thermostat::Commands::SetWeeklySchedule::DecodableType & fields); /** * @brief Thermostat Cluster RelayStatusLog Command callback (from server) */ @@ -16293,134 +16501,165 @@ bool emberAfThermostatClusterRelayStatusLogCallback(chip::EndpointId endpoint, c /** * @brief Thermostat Cluster GetWeeklySchedule Command callback (from client) */ -bool emberAfThermostatClusterGetWeeklyScheduleCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t daysToReturn, uint8_t modeToReturn); +bool emberAfThermostatClusterGetWeeklyScheduleCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t daysToReturn, uint8_t modeToReturn, + chip::app::Clusters::Thermostat::Commands::GetWeeklySchedule::DecodableType & fields); /** * @brief Thermostat Cluster ClearWeeklySchedule Command callback (from client) */ -bool emberAfThermostatClusterClearWeeklyScheduleCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfThermostatClusterClearWeeklyScheduleCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::Thermostat::Commands::ClearWeeklySchedule::DecodableType & fields); /** * @brief Thermostat Cluster GetRelayStatusLog Command callback (from client) */ -bool emberAfThermostatClusterGetRelayStatusLogCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfThermostatClusterGetRelayStatusLogCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::Thermostat::Commands::GetRelayStatusLog::DecodableType & fields); /** * @brief Color Control Cluster MoveToHue Command callback (from client) */ -bool emberAfColorControlClusterMoveToHueCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint8_t hue, - uint8_t direction, uint16_t transitionTime, uint8_t optionsMask, - uint8_t optionsOverride); +bool emberAfColorControlClusterMoveToHueCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t hue, uint8_t direction, uint16_t transitionTime, uint8_t optionsMask, + uint8_t optionsOverride, + chip::app::Clusters::ColorControl::Commands::MoveToHue::DecodableType & fields); /** * @brief Color Control Cluster MoveHue Command callback (from client) */ -bool emberAfColorControlClusterMoveHueCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint8_t moveMode, - uint8_t rate, uint8_t optionsMask, uint8_t optionsOverride); +bool emberAfColorControlClusterMoveHueCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t moveMode, uint8_t rate, uint8_t optionsMask, uint8_t optionsOverride, + chip::app::Clusters::ColorControl::Commands::MoveHue::DecodableType & fields); /** * @brief Color Control Cluster StepHue Command callback (from client) */ -bool emberAfColorControlClusterStepHueCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint8_t stepMode, - uint8_t stepSize, uint8_t transitionTime, uint8_t optionsMask, - uint8_t optionsOverride); +bool emberAfColorControlClusterStepHueCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t stepMode, uint8_t stepSize, uint8_t transitionTime, uint8_t optionsMask, + uint8_t optionsOverride, + chip::app::Clusters::ColorControl::Commands::StepHue::DecodableType & fields); /** * @brief Color Control Cluster MoveToSaturation Command callback (from client) */ -bool emberAfColorControlClusterMoveToSaturationCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t saturation, uint16_t transitionTime, uint8_t optionsMask, - uint8_t optionsOverride); +bool emberAfColorControlClusterMoveToSaturationCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t saturation, uint16_t transitionTime, uint8_t optionsMask, uint8_t optionsOverride, + chip::app::Clusters::ColorControl::Commands::MoveToSaturation::DecodableType & fields); /** * @brief Color Control Cluster MoveSaturation Command callback (from client) */ -bool emberAfColorControlClusterMoveSaturationCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t moveMode, uint8_t rate, uint8_t optionsMask, uint8_t optionsOverride); +bool emberAfColorControlClusterMoveSaturationCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t moveMode, uint8_t rate, uint8_t optionsMask, uint8_t optionsOverride, + chip::app::Clusters::ColorControl::Commands::MoveSaturation::DecodableType & fields); /** * @brief Color Control Cluster StepSaturation Command callback (from client) */ -bool emberAfColorControlClusterStepSaturationCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t stepMode, uint8_t stepSize, uint8_t transitionTime, - uint8_t optionsMask, uint8_t optionsOverride); +bool emberAfColorControlClusterStepSaturationCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t stepMode, uint8_t stepSize, uint8_t transitionTime, uint8_t optionsMask, uint8_t optionsOverride, + chip::app::Clusters::ColorControl::Commands::StepSaturation::DecodableType & fields); /** * @brief Color Control Cluster MoveToHueAndSaturation Command callback (from client) */ -bool emberAfColorControlClusterMoveToHueAndSaturationCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t hue, uint8_t saturation, uint16_t transitionTime, - uint8_t optionsMask, uint8_t optionsOverride); +bool emberAfColorControlClusterMoveToHueAndSaturationCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t hue, uint8_t saturation, uint16_t transitionTime, uint8_t optionsMask, uint8_t optionsOverride, + chip::app::Clusters::ColorControl::Commands::MoveToHueAndSaturation::DecodableType & fields); /** * @brief Color Control Cluster MoveToColor Command callback (from client) */ -bool emberAfColorControlClusterMoveToColorCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint16_t colorX, uint16_t colorY, uint16_t transitionTime, uint8_t optionsMask, - uint8_t optionsOverride); +bool emberAfColorControlClusterMoveToColorCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t colorX, uint16_t colorY, uint16_t transitionTime, uint8_t optionsMask, uint8_t optionsOverride, + chip::app::Clusters::ColorControl::Commands::MoveToColor::DecodableType & fields); /** * @brief Color Control Cluster MoveColor Command callback (from client) */ -bool emberAfColorControlClusterMoveColorCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, int16_t rateX, - int16_t rateY, uint8_t optionsMask, uint8_t optionsOverride); +bool emberAfColorControlClusterMoveColorCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + int16_t rateX, int16_t rateY, uint8_t optionsMask, uint8_t optionsOverride, + chip::app::Clusters::ColorControl::Commands::MoveColor::DecodableType & fields); /** * @brief Color Control Cluster StepColor Command callback (from client) */ -bool emberAfColorControlClusterStepColorCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, int16_t stepX, - int16_t stepY, uint16_t transitionTime, uint8_t optionsMask, - uint8_t optionsOverride); +bool emberAfColorControlClusterStepColorCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + int16_t stepX, int16_t stepY, uint16_t transitionTime, uint8_t optionsMask, + uint8_t optionsOverride, + chip::app::Clusters::ColorControl::Commands::StepColor::DecodableType & fields); /** * @brief Color Control Cluster MoveToColorTemperature Command callback (from client) */ -bool emberAfColorControlClusterMoveToColorTemperatureCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint16_t colorTemperature, uint16_t transitionTime, - uint8_t optionsMask, uint8_t optionsOverride); +bool emberAfColorControlClusterMoveToColorTemperatureCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t colorTemperature, uint16_t transitionTime, uint8_t optionsMask, uint8_t optionsOverride, + chip::app::Clusters::ColorControl::Commands::MoveToColorTemperature::DecodableType & fields); /** * @brief Color Control Cluster EnhancedMoveToHue Command callback (from client) */ -bool emberAfColorControlClusterEnhancedMoveToHueCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint16_t enhancedHue, uint8_t direction, uint16_t transitionTime, - uint8_t optionsMask, uint8_t optionsOverride); +bool emberAfColorControlClusterEnhancedMoveToHueCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t enhancedHue, uint8_t direction, uint16_t transitionTime, uint8_t optionsMask, uint8_t optionsOverride, + chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::DecodableType & fields); /** * @brief Color Control Cluster EnhancedMoveHue Command callback (from client) */ -bool emberAfColorControlClusterEnhancedMoveHueCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t moveMode, uint16_t rate, uint8_t optionsMask, - uint8_t optionsOverride); +bool emberAfColorControlClusterEnhancedMoveHueCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t moveMode, uint16_t rate, uint8_t optionsMask, uint8_t optionsOverride, + chip::app::Clusters::ColorControl::Commands::EnhancedMoveHue::DecodableType & fields); /** * @brief Color Control Cluster EnhancedStepHue Command callback (from client) */ -bool emberAfColorControlClusterEnhancedStepHueCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t stepMode, uint16_t stepSize, uint16_t transitionTime, - uint8_t optionsMask, uint8_t optionsOverride); +bool emberAfColorControlClusterEnhancedStepHueCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t stepMode, uint16_t stepSize, uint16_t transitionTime, uint8_t optionsMask, uint8_t optionsOverride, + chip::app::Clusters::ColorControl::Commands::EnhancedStepHue::DecodableType & fields); /** * @brief Color Control Cluster EnhancedMoveToHueAndSaturation Command callback (from client) */ -bool emberAfColorControlClusterEnhancedMoveToHueAndSaturationCallback(chip::EndpointId endpoint, - chip::app::CommandHandler * commandObj, uint16_t enhancedHue, - uint8_t saturation, uint16_t transitionTime, - uint8_t optionsMask, uint8_t optionsOverride); +bool emberAfColorControlClusterEnhancedMoveToHueAndSaturationCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t enhancedHue, uint8_t saturation, uint16_t transitionTime, uint8_t optionsMask, uint8_t optionsOverride, + chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHueAndSaturation::DecodableType & fields); /** * @brief Color Control Cluster ColorLoopSet Command callback (from client) */ -bool emberAfColorControlClusterColorLoopSetCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t updateFlags, uint8_t action, uint8_t direction, uint16_t time, - uint16_t startHue, uint8_t optionsMask, uint8_t optionsOverride); +bool emberAfColorControlClusterColorLoopSetCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t updateFlags, uint8_t action, uint8_t direction, uint16_t time, uint16_t startHue, uint8_t optionsMask, + uint8_t optionsOverride, chip::app::Clusters::ColorControl::Commands::ColorLoopSet::DecodableType & fields); /** * @brief Color Control Cluster StopMoveStep Command callback (from client) */ -bool emberAfColorControlClusterStopMoveStepCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t optionsMask, uint8_t optionsOverride); +bool emberAfColorControlClusterStopMoveStepCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t optionsMask, uint8_t optionsOverride, + chip::app::Clusters::ColorControl::Commands::StopMoveStep::DecodableType & fields); /** * @brief Color Control Cluster MoveColorTemperature Command callback (from client) */ -bool emberAfColorControlClusterMoveColorTemperatureCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t moveMode, uint16_t rate, uint16_t colorTemperatureMinimum, - uint16_t colorTemperatureMaximum, uint8_t optionsMask, - uint8_t optionsOverride); +bool emberAfColorControlClusterMoveColorTemperatureCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t moveMode, uint16_t rate, uint16_t colorTemperatureMinimum, uint16_t colorTemperatureMaximum, uint8_t optionsMask, + uint8_t optionsOverride, chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::DecodableType & fields); /** * @brief Color Control Cluster StepColorTemperature Command callback (from client) */ -bool emberAfColorControlClusterStepColorTemperatureCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t stepMode, uint16_t stepSize, uint16_t transitionTime, - uint16_t colorTemperatureMinimum, uint16_t colorTemperatureMaximum, - uint8_t optionsMask, uint8_t optionsOverride); +bool emberAfColorControlClusterStepColorTemperatureCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t stepMode, uint16_t stepSize, uint16_t transitionTime, uint16_t colorTemperatureMinimum, + uint16_t colorTemperatureMaximum, uint8_t optionsMask, uint8_t optionsOverride, + chip::app::Clusters::ColorControl::Commands::StepColorTemperature::DecodableType & fields); /** * @brief IAS Zone Cluster ZoneEnrollResponse Command callback (from client) */ -bool emberAfIasZoneClusterZoneEnrollResponseCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t enrollResponseCode, uint8_t zoneId); +bool emberAfIasZoneClusterZoneEnrollResponseCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t enrollResponseCode, uint8_t zoneId, chip::app::Clusters::IasZone::Commands::ZoneEnrollResponse::DecodableType & fields); /** * @brief IAS Zone Cluster ZoneStatusChangeNotification Command callback (from server) */ @@ -16430,7 +16669,9 @@ bool emberAfIasZoneClusterZoneStatusChangeNotificationCallback(chip::EndpointId /** * @brief IAS Zone Cluster InitiateNormalOperationMode Command callback (from client) */ -bool emberAfIasZoneClusterInitiateNormalOperationModeCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfIasZoneClusterInitiateNormalOperationModeCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::IasZone::Commands::InitiateNormalOperationMode::DecodableType & fields); /** * @brief IAS Zone Cluster ZoneEnrollRequest Command callback (from server) */ @@ -16439,8 +16680,10 @@ bool emberAfIasZoneClusterZoneEnrollRequestCallback(chip::EndpointId endpoint, c /** * @brief IAS Zone Cluster InitiateTestMode Command callback (from client) */ -bool emberAfIasZoneClusterInitiateTestModeCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t testModeDuration, uint8_t currentZoneSensitivityLevel); +bool emberAfIasZoneClusterInitiateTestModeCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t testModeDuration, uint8_t currentZoneSensitivityLevel, + chip::app::Clusters::IasZone::Commands::InitiateTestMode::DecodableType & fields); /** * @brief IAS Zone Cluster InitiateNormalOperationModeResponse Command callback (from server) */ @@ -16453,8 +16696,9 @@ bool emberAfIasZoneClusterInitiateTestModeResponseCallback(chip::EndpointId endp /** * @brief IAS ACE Cluster Arm Command callback (from client) */ -bool emberAfIasAceClusterArmCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint8_t armMode, - uint8_t * armDisarmCode, uint8_t zoneId); +bool emberAfIasAceClusterArmCallback(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + chip::EndpointId endpoint, uint8_t armMode, uint8_t * armDisarmCode, uint8_t zoneId, + chip::app::Clusters::IasAce::Commands::Arm::DecodableType & fields); /** * @brief IAS ACE Cluster ArmResponse Command callback (from server) */ @@ -16463,8 +16707,10 @@ bool emberAfIasAceClusterArmResponseCallback(chip::EndpointId endpoint, chip::ap /** * @brief IAS ACE Cluster Bypass Command callback (from client) */ -bool emberAfIasAceClusterBypassCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint8_t numberOfZones, - /* TYPE WARNING: array array defaults to */ uint8_t * zoneIds, uint8_t * armDisarmCode); +bool emberAfIasAceClusterBypassCallback(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + chip::EndpointId endpoint, uint8_t numberOfZones, + /* TYPE WARNING: array array defaults to */ uint8_t * zoneIds, uint8_t * armDisarmCode, + chip::app::Clusters::IasAce::Commands::Bypass::DecodableType & fields); /** * @brief IAS ACE Cluster GetZoneIdMapResponse Command callback (from server) */ @@ -16477,7 +16723,9 @@ bool emberAfIasAceClusterGetZoneIdMapResponseCallback(chip::EndpointId endpoint, /** * @brief IAS ACE Cluster Emergency Command callback (from client) */ -bool emberAfIasAceClusterEmergencyCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfIasAceClusterEmergencyCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::IasAce::Commands::Emergency::DecodableType & fields); /** * @brief IAS ACE Cluster GetZoneInformationResponse Command callback (from server) */ @@ -16487,7 +16735,9 @@ bool emberAfIasAceClusterGetZoneInformationResponseCallback(chip::EndpointId end /** * @brief IAS ACE Cluster Fire Command callback (from client) */ -bool emberAfIasAceClusterFireCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfIasAceClusterFireCallback(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + chip::EndpointId endpoint, + chip::app::Clusters::IasAce::Commands::Fire::DecodableType & fields); /** * @brief IAS ACE Cluster ZoneStatusChanged Command callback (from server) */ @@ -16496,7 +16746,9 @@ bool emberAfIasAceClusterZoneStatusChangedCallback(chip::EndpointId endpoint, ch /** * @brief IAS ACE Cluster Panic Command callback (from client) */ -bool emberAfIasAceClusterPanicCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfIasAceClusterPanicCallback(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + chip::EndpointId endpoint, + chip::app::Clusters::IasAce::Commands::Panic::DecodableType & fields); /** * @brief IAS ACE Cluster PanelStatusChanged Command callback (from server) */ @@ -16506,7 +16758,9 @@ bool emberAfIasAceClusterPanelStatusChangedCallback(chip::EndpointId endpoint, c /** * @brief IAS ACE Cluster GetZoneIdMap Command callback (from client) */ -bool emberAfIasAceClusterGetZoneIdMapCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfIasAceClusterGetZoneIdMapCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::IasAce::Commands::GetZoneIdMap::DecodableType & fields); /** * @brief IAS ACE Cluster GetPanelStatusResponse Command callback (from server) */ @@ -16516,8 +16770,9 @@ bool emberAfIasAceClusterGetPanelStatusResponseCallback(chip::EndpointId endpoin /** * @brief IAS ACE Cluster GetZoneInformation Command callback (from client) */ -bool emberAfIasAceClusterGetZoneInformationCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t zoneId); +bool emberAfIasAceClusterGetZoneInformationCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t zoneId, chip::app::Clusters::IasAce::Commands::GetZoneInformation::DecodableType & fields); /** * @brief IAS ACE Cluster SetBypassedZoneList Command callback (from server) */ @@ -16527,7 +16782,9 @@ bool emberAfIasAceClusterSetBypassedZoneListCallback(chip::EndpointId endpoint, /** * @brief IAS ACE Cluster GetPanelStatus Command callback (from client) */ -bool emberAfIasAceClusterGetPanelStatusCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfIasAceClusterGetPanelStatusCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::IasAce::Commands::GetPanelStatus::DecodableType & fields); /** * @brief IAS ACE Cluster BypassResponse Command callback (from server) */ @@ -16537,7 +16794,9 @@ bool emberAfIasAceClusterBypassResponseCallback(chip::EndpointId endpoint, chip: /** * @brief IAS ACE Cluster GetBypassedZoneList Command callback (from client) */ -bool emberAfIasAceClusterGetBypassedZoneListCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfIasAceClusterGetBypassedZoneListCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::IasAce::Commands::GetBypassedZoneList::DecodableType & fields); /** * @brief IAS ACE Cluster GetZoneStatusResponse Command callback (from server) */ @@ -16547,23 +16806,32 @@ bool emberAfIasAceClusterGetZoneStatusResponseCallback(chip::EndpointId endpoint /** * @brief IAS ACE Cluster GetZoneStatus Command callback (from client) */ -bool emberAfIasAceClusterGetZoneStatusCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, +bool emberAfIasAceClusterGetZoneStatusCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, uint8_t startingZoneId, uint8_t maxNumberOfZoneIds, bool zoneStatusMaskFlag, - uint16_t zoneStatusMask); + uint16_t zoneStatusMask, + chip::app::Clusters::IasAce::Commands::GetZoneStatus::DecodableType & fields); /** * @brief IAS WD Cluster StartWarning Command callback (from client) */ -bool emberAfIasWdClusterStartWarningCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint8_t warningInfo, - uint16_t warningDuration, uint8_t strobeDutyCycle, uint8_t strobeLevel); +bool emberAfIasWdClusterStartWarningCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t warningInfo, uint16_t warningDuration, uint8_t strobeDutyCycle, + uint8_t strobeLevel, + chip::app::Clusters::IasWd::Commands::StartWarning::DecodableType & fields); /** * @brief IAS WD Cluster Squawk Command callback (from client) */ -bool emberAfIasWdClusterSquawkCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint8_t squawkInfo); +bool emberAfIasWdClusterSquawkCallback(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + chip::EndpointId endpoint, uint8_t squawkInfo, + chip::app::Clusters::IasWd::Commands::Squawk::DecodableType & fields); /** * @brief TV Channel Cluster ChangeChannel Command callback (from client) */ -bool emberAfTvChannelClusterChangeChannelCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t * match); +bool emberAfTvChannelClusterChangeChannelCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t * match, + chip::app::Clusters::TvChannel::Commands::ChangeChannel::DecodableType & fields); /** * @brief TV Channel Cluster ChangeChannelResponse Command callback (from server) */ @@ -16573,17 +16841,23 @@ bool emberAfTvChannelClusterChangeChannelResponseCallback(chip::EndpointId endpo /** * @brief TV Channel Cluster ChangeChannelByNumber Command callback (from client) */ -bool emberAfTvChannelClusterChangeChannelByNumberCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint16_t majorNumber, uint16_t minorNumber); +bool emberAfTvChannelClusterChangeChannelByNumberCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t majorNumber, uint16_t minorNumber, + chip::app::Clusters::TvChannel::Commands::ChangeChannelByNumber::DecodableType & fields); /** * @brief TV Channel Cluster SkipChannel Command callback (from client) */ -bool emberAfTvChannelClusterSkipChannelCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint16_t Count); +bool emberAfTvChannelClusterSkipChannelCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t Count, + chip::app::Clusters::TvChannel::Commands::SkipChannel::DecodableType & fields); /** * @brief Target Navigator Cluster NavigateTarget Command callback (from client) */ -bool emberAfTargetNavigatorClusterNavigateTargetCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t target, uint8_t * data); +bool emberAfTargetNavigatorClusterNavigateTargetCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t target, uint8_t * data, chip::app::Clusters::TargetNavigator::Commands::NavigateTarget::DecodableType & fields); /** * @brief Target Navigator Cluster NavigateTargetResponse Command callback (from server) */ @@ -16592,7 +16866,9 @@ bool emberAfTargetNavigatorClusterNavigateTargetResponseCallback(chip::EndpointI /** * @brief Media Playback Cluster MediaPlay Command callback (from client) */ -bool emberAfMediaPlaybackClusterMediaPlayCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfMediaPlaybackClusterMediaPlayCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::MediaPlayback::Commands::MediaPlay::DecodableType & fields); /** * @brief Media Playback Cluster MediaPlayResponse Command callback (from server) */ @@ -16601,7 +16877,9 @@ bool emberAfMediaPlaybackClusterMediaPlayResponseCallback(chip::EndpointId endpo /** * @brief Media Playback Cluster MediaPause Command callback (from client) */ -bool emberAfMediaPlaybackClusterMediaPauseCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfMediaPlaybackClusterMediaPauseCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::MediaPlayback::Commands::MediaPause::DecodableType & fields); /** * @brief Media Playback Cluster MediaPauseResponse Command callback (from server) */ @@ -16610,7 +16888,9 @@ bool emberAfMediaPlaybackClusterMediaPauseResponseCallback(chip::EndpointId endp /** * @brief Media Playback Cluster MediaStop Command callback (from client) */ -bool emberAfMediaPlaybackClusterMediaStopCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfMediaPlaybackClusterMediaStopCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::MediaPlayback::Commands::MediaStop::DecodableType & fields); /** * @brief Media Playback Cluster MediaStopResponse Command callback (from server) */ @@ -16619,7 +16899,9 @@ bool emberAfMediaPlaybackClusterMediaStopResponseCallback(chip::EndpointId endpo /** * @brief Media Playback Cluster MediaStartOver Command callback (from client) */ -bool emberAfMediaPlaybackClusterMediaStartOverCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfMediaPlaybackClusterMediaStartOverCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::MediaPlayback::Commands::MediaStartOver::DecodableType & fields); /** * @brief Media Playback Cluster MediaStartOverResponse Command callback (from server) */ @@ -16628,7 +16910,9 @@ bool emberAfMediaPlaybackClusterMediaStartOverResponseCallback(chip::EndpointId /** * @brief Media Playback Cluster MediaPrevious Command callback (from client) */ -bool emberAfMediaPlaybackClusterMediaPreviousCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfMediaPlaybackClusterMediaPreviousCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::MediaPlayback::Commands::MediaPrevious::DecodableType & fields); /** * @brief Media Playback Cluster MediaPreviousResponse Command callback (from server) */ @@ -16637,7 +16921,9 @@ bool emberAfMediaPlaybackClusterMediaPreviousResponseCallback(chip::EndpointId e /** * @brief Media Playback Cluster MediaNext Command callback (from client) */ -bool emberAfMediaPlaybackClusterMediaNextCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfMediaPlaybackClusterMediaNextCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::MediaPlayback::Commands::MediaNext::DecodableType & fields); /** * @brief Media Playback Cluster MediaNextResponse Command callback (from server) */ @@ -16646,7 +16932,9 @@ bool emberAfMediaPlaybackClusterMediaNextResponseCallback(chip::EndpointId endpo /** * @brief Media Playback Cluster MediaRewind Command callback (from client) */ -bool emberAfMediaPlaybackClusterMediaRewindCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfMediaPlaybackClusterMediaRewindCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::MediaPlayback::Commands::MediaRewind::DecodableType & fields); /** * @brief Media Playback Cluster MediaRewindResponse Command callback (from server) */ @@ -16655,7 +16943,9 @@ bool emberAfMediaPlaybackClusterMediaRewindResponseCallback(chip::EndpointId end /** * @brief Media Playback Cluster MediaFastForward Command callback (from client) */ -bool emberAfMediaPlaybackClusterMediaFastForwardCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfMediaPlaybackClusterMediaFastForwardCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::MediaPlayback::Commands::MediaFastForward::DecodableType & fields); /** * @brief Media Playback Cluster MediaFastForwardResponse Command callback (from server) */ @@ -16664,8 +16954,9 @@ bool emberAfMediaPlaybackClusterMediaFastForwardResponseCallback(chip::EndpointI /** * @brief Media Playback Cluster MediaSkipForward Command callback (from client) */ -bool emberAfMediaPlaybackClusterMediaSkipForwardCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint64_t deltaPositionMilliseconds); +bool emberAfMediaPlaybackClusterMediaSkipForwardCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint64_t deltaPositionMilliseconds, chip::app::Clusters::MediaPlayback::Commands::MediaSkipForward::DecodableType & fields); /** * @brief Media Playback Cluster MediaSkipForwardResponse Command callback (from server) */ @@ -16674,8 +16965,9 @@ bool emberAfMediaPlaybackClusterMediaSkipForwardResponseCallback(chip::EndpointI /** * @brief Media Playback Cluster MediaSkipBackward Command callback (from client) */ -bool emberAfMediaPlaybackClusterMediaSkipBackwardCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint64_t deltaPositionMilliseconds); +bool emberAfMediaPlaybackClusterMediaSkipBackwardCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint64_t deltaPositionMilliseconds, chip::app::Clusters::MediaPlayback::Commands::MediaSkipBackward::DecodableType & fields); /** * @brief Media Playback Cluster MediaSkipBackwardResponse Command callback (from server) */ @@ -16684,8 +16976,10 @@ bool emberAfMediaPlaybackClusterMediaSkipBackwardResponseCallback(chip::Endpoint /** * @brief Media Playback Cluster MediaSeek Command callback (from client) */ -bool emberAfMediaPlaybackClusterMediaSeekCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint64_t position); +bool emberAfMediaPlaybackClusterMediaSeekCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint64_t position, + chip::app::Clusters::MediaPlayback::Commands::MediaSeek::DecodableType & fields); /** * @brief Media Playback Cluster MediaSeekResponse Command callback (from server) */ @@ -16694,28 +16988,42 @@ bool emberAfMediaPlaybackClusterMediaSeekResponseCallback(chip::EndpointId endpo /** * @brief Media Input Cluster SelectInput Command callback (from client) */ -bool emberAfMediaInputClusterSelectInputCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint8_t index); +bool emberAfMediaInputClusterSelectInputCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t index, + chip::app::Clusters::MediaInput::Commands::SelectInput::DecodableType & fields); /** * @brief Media Input Cluster ShowInputStatus Command callback (from client) */ -bool emberAfMediaInputClusterShowInputStatusCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfMediaInputClusterShowInputStatusCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::MediaInput::Commands::ShowInputStatus::DecodableType & fields); /** * @brief Media Input Cluster HideInputStatus Command callback (from client) */ -bool emberAfMediaInputClusterHideInputStatusCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfMediaInputClusterHideInputStatusCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::MediaInput::Commands::HideInputStatus::DecodableType & fields); /** * @brief Media Input Cluster RenameInput Command callback (from client) */ -bool emberAfMediaInputClusterRenameInputCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint8_t index, - uint8_t * name); +bool emberAfMediaInputClusterRenameInputCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t index, uint8_t * name, + chip::app::Clusters::MediaInput::Commands::RenameInput::DecodableType & fields); /** * @brief Low Power Cluster Sleep Command callback (from client) */ -bool emberAfLowPowerClusterSleepCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfLowPowerClusterSleepCallback(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + chip::EndpointId endpoint, + chip::app::Clusters::LowPower::Commands::Sleep::DecodableType & fields); /** * @brief Keypad Input Cluster SendKey Command callback (from client) */ -bool emberAfKeypadInputClusterSendKeyCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint8_t keyCode); +bool emberAfKeypadInputClusterSendKeyCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t keyCode, + chip::app::Clusters::KeypadInput::Commands::SendKey::DecodableType & fields); /** * @brief Keypad Input Cluster SendKeyResponse Command callback (from server) */ @@ -16724,8 +17032,9 @@ bool emberAfKeypadInputClusterSendKeyResponseCallback(chip::EndpointId endpoint, /** * @brief Content Launcher Cluster LaunchContent Command callback (from client) */ -bool emberAfContentLauncherClusterLaunchContentCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - bool autoPlay, uint8_t * data); +bool emberAfContentLauncherClusterLaunchContentCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + bool autoPlay, uint8_t * data, chip::app::Clusters::ContentLauncher::Commands::LaunchContent::DecodableType & fields); /** * @brief Content Launcher Cluster LaunchContentResponse Command callback (from server) */ @@ -16734,8 +17043,10 @@ bool emberAfContentLauncherClusterLaunchContentResponseCallback(chip::EndpointId /** * @brief Content Launcher Cluster LaunchURL Command callback (from client) */ -bool emberAfContentLauncherClusterLaunchURLCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t * contentURL, uint8_t * displayString); +bool emberAfContentLauncherClusterLaunchURLCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t * contentURL, uint8_t * displayString, + chip::app::Clusters::ContentLauncher::Commands::LaunchURL::DecodableType & fields); /** * @brief Content Launcher Cluster LaunchURLResponse Command callback (from server) */ @@ -16744,18 +17055,22 @@ bool emberAfContentLauncherClusterLaunchURLResponseCallback(chip::EndpointId end /** * @brief Audio Output Cluster SelectOutput Command callback (from client) */ -bool emberAfAudioOutputClusterSelectOutputCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t index); +bool emberAfAudioOutputClusterSelectOutputCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t index, chip::app::Clusters::AudioOutput::Commands::SelectOutput::DecodableType & fields); /** * @brief Audio Output Cluster RenameOutput Command callback (from client) */ -bool emberAfAudioOutputClusterRenameOutputCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, uint8_t index, - uint8_t * name); +bool emberAfAudioOutputClusterRenameOutputCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t index, uint8_t * name, chip::app::Clusters::AudioOutput::Commands::RenameOutput::DecodableType & fields); /** * @brief Application Launcher Cluster LaunchApp Command callback (from client) */ -bool emberAfApplicationLauncherClusterLaunchAppCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t * data, uint16_t catalogVendorId, uint8_t * applicationId); +bool emberAfApplicationLauncherClusterLaunchAppCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t * data, uint16_t catalogVendorId, uint8_t * applicationId, + chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::DecodableType & fields); /** * @brief Application Launcher Cluster LaunchAppResponse Command callback (from server) */ @@ -16764,13 +17079,15 @@ bool emberAfApplicationLauncherClusterLaunchAppResponseCallback(chip::EndpointId /** * @brief Application Basic Cluster ChangeStatus Command callback (from client) */ -bool emberAfApplicationBasicClusterChangeStatusCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t status); +bool emberAfApplicationBasicClusterChangeStatusCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t status, chip::app::Clusters::ApplicationBasic::Commands::ChangeStatus::DecodableType & fields); /** * @brief Account Login Cluster GetSetupPIN Command callback (from client) */ -bool emberAfAccountLoginClusterGetSetupPINCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t * tempAccountIdentifier); +bool emberAfAccountLoginClusterGetSetupPINCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t * tempAccountIdentifier, chip::app::Clusters::AccountLogin::Commands::GetSetupPIN::DecodableType & fields); /** * @brief Account Login Cluster GetSetupPINResponse Command callback (from server) */ @@ -16779,12 +17096,16 @@ bool emberAfAccountLoginClusterGetSetupPINResponseCallback(chip::EndpointId endp /** * @brief Account Login Cluster Login Command callback (from client) */ -bool emberAfAccountLoginClusterLoginCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t * tempAccountIdentifier, uint8_t * setupPIN); +bool emberAfAccountLoginClusterLoginCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t * tempAccountIdentifier, uint8_t * setupPIN, + chip::app::Clusters::AccountLogin::Commands::Login::DecodableType & fields); /** * @brief Test Cluster Cluster Test Command callback (from client) */ -bool emberAfTestClusterClusterTestCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfTestClusterClusterTestCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::TestCluster::Commands::Test::DecodableType & fields); /** * @brief Test Cluster Cluster TestSpecificResponse Command callback (from server) */ @@ -16793,7 +17114,9 @@ bool emberAfTestClusterClusterTestSpecificResponseCallback(chip::EndpointId endp /** * @brief Test Cluster Cluster TestNotHandled Command callback (from client) */ -bool emberAfTestClusterClusterTestNotHandledCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfTestClusterClusterTestNotHandledCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::TestCluster::Commands::TestNotHandled::DecodableType & fields); /** * @brief Test Cluster Cluster TestAddArgumentsResponse Command callback (from server) */ @@ -16802,16 +17125,21 @@ bool emberAfTestClusterClusterTestAddArgumentsResponseCallback(chip::EndpointId /** * @brief Test Cluster Cluster TestSpecific Command callback (from client) */ -bool emberAfTestClusterClusterTestSpecificCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfTestClusterClusterTestSpecificCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::TestCluster::Commands::TestSpecific::DecodableType & fields); /** * @brief Test Cluster Cluster TestUnknownCommand Command callback (from client) */ -bool emberAfTestClusterClusterTestUnknownCommandCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfTestClusterClusterTestUnknownCommandCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::TestCluster::Commands::TestUnknownCommand::DecodableType & fields); /** * @brief Test Cluster Cluster TestAddArguments Command callback (from client) */ -bool emberAfTestClusterClusterTestAddArgumentsCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t arg1, uint8_t arg2); +bool emberAfTestClusterClusterTestAddArgumentsCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t arg1, uint8_t arg2, chip::app::Clusters::TestCluster::Commands::TestAddArguments::DecodableType & fields); /** * @brief Messaging Cluster DisplayMessage Command callback (from server) */ @@ -16823,7 +17151,9 @@ bool emberAfMessagingClusterDisplayMessageCallback(chip::EndpointId endpoint, ch /** * @brief Messaging Cluster GetLastMessage Command callback (from client) */ -bool emberAfMessagingClusterGetLastMessageCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfMessagingClusterGetLastMessageCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::Messaging::Commands::GetLastMessage::DecodableType & fields); /** * @brief Messaging Cluster CancelMessage Command callback (from server) */ @@ -16832,10 +17162,10 @@ bool emberAfMessagingClusterCancelMessageCallback(chip::EndpointId endpoint, chi /** * @brief Messaging Cluster MessageConfirmation Command callback (from client) */ -bool emberAfMessagingClusterMessageConfirmationCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint32_t messageId, - /* TYPE WARNING: utc defaults to */ uint8_t * confirmationTime, - uint8_t messageConfirmationControl, chip::ByteSpan messageResponse); +bool emberAfMessagingClusterMessageConfirmationCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint32_t messageId, /* TYPE WARNING: utc defaults to */ uint8_t * confirmationTime, uint8_t messageConfirmationControl, + chip::ByteSpan messageResponse, chip::app::Clusters::Messaging::Commands::MessageConfirmation::DecodableType & fields); /** * @brief Messaging Cluster DisplayProtectedMessage Command callback (from server) */ @@ -16848,8 +17178,9 @@ bool emberAfMessagingClusterDisplayProtectedMessageCallback(chip::EndpointId end * @brief Messaging Cluster GetMessageCancellation Command callback (from client) */ bool emberAfMessagingClusterGetMessageCancellationCallback( - chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - /* TYPE WARNING: utc defaults to */ uint8_t * earliestImplementationTime); + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + /* TYPE WARNING: utc defaults to */ uint8_t * earliestImplementationTime, + chip::app::Clusters::Messaging::Commands::GetMessageCancellation::DecodableType & fields); /** * @brief Messaging Cluster CancelAllMessages Command callback (from server) */ @@ -16858,7 +17189,9 @@ bool emberAfMessagingClusterCancelAllMessagesCallback(chip::EndpointId endpoint, /** * @brief Appliance Events and Alert Cluster GetAlerts Command callback (from client) */ -bool emberAfApplianceEventsAndAlertClusterGetAlertsCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfApplianceEventsAndAlertClusterGetAlertsCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::ApplianceEventsAndAlert::Commands::GetAlerts::DecodableType & fields); /** * @brief Appliance Events and Alert Cluster GetAlertsResponse Command callback (from server) */ @@ -16887,8 +17220,9 @@ bool emberAfApplianceStatisticsClusterLogNotificationCallback(chip::EndpointId e /** * @brief Appliance Statistics Cluster LogRequest Command callback (from client) */ -bool emberAfApplianceStatisticsClusterLogRequestCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint32_t logId); +bool emberAfApplianceStatisticsClusterLogRequestCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint32_t logId, chip::app::Clusters::ApplianceStatistics::Commands::LogRequest::DecodableType & fields); /** * @brief Appliance Statistics Cluster LogResponse Command callback (from server) */ @@ -16899,7 +17233,9 @@ bool emberAfApplianceStatisticsClusterLogResponseCallback(chip::EndpointId endpo /** * @brief Appliance Statistics Cluster LogQueueRequest Command callback (from client) */ -bool emberAfApplianceStatisticsClusterLogQueueRequestCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj); +bool emberAfApplianceStatisticsClusterLogQueueRequestCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::ApplianceStatistics::Commands::LogQueueRequest::DecodableType & fields); /** * @brief Appliance Statistics Cluster LogQueueResponse Command callback (from server) */ @@ -16921,8 +17257,9 @@ bool emberAfElectricalMeasurementClusterGetProfileInfoResponseCommandCallback( /** * @brief Electrical Measurement Cluster GetProfileInfoCommand Command callback (from client) */ -bool emberAfElectricalMeasurementClusterGetProfileInfoCommandCallback(chip::EndpointId endpoint, - chip::app::CommandHandler * commandObj); +bool emberAfElectricalMeasurementClusterGetProfileInfoCommandCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + chip::app::Clusters::ElectricalMeasurement::Commands::GetProfileInfoCommand::DecodableType & fields); /** * @brief Electrical Measurement Cluster GetMeasurementProfileResponseCommand Command callback (from server) */ @@ -16933,30 +17270,36 @@ bool emberAfElectricalMeasurementClusterGetMeasurementProfileResponseCommandCall /** * @brief Electrical Measurement Cluster GetMeasurementProfileCommand Command callback (from client) */ -bool emberAfElectricalMeasurementClusterGetMeasurementProfileCommandCallback(chip::EndpointId endpoint, - chip::app::CommandHandler * commandObj, - uint16_t attributeId, uint32_t startTime, - uint8_t numberOfIntervals); +bool emberAfElectricalMeasurementClusterGetMeasurementProfileCommandCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint16_t attributeId, uint32_t startTime, uint8_t numberOfIntervals, + chip::app::Clusters::ElectricalMeasurement::Commands::GetMeasurementProfileCommand::DecodableType & fields); /** * @brief Binding Cluster Bind Command callback (from client) */ -bool emberAfBindingClusterBindCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, chip::NodeId nodeId, - chip::GroupId groupId, chip::EndpointId endpointId, chip::ClusterId clusterId); +bool emberAfBindingClusterBindCallback(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + chip::EndpointId endpoint, chip::NodeId nodeId, chip::GroupId groupId, + chip::EndpointId endpointId, chip::ClusterId clusterId, + chip::app::Clusters::Binding::Commands::Bind::DecodableType & fields); /** * @brief Binding Cluster Unbind Command callback (from client) */ -bool emberAfBindingClusterUnbindCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, chip::NodeId nodeId, - chip::GroupId groupId, chip::EndpointId endpointId, chip::ClusterId clusterId); +bool emberAfBindingClusterUnbindCallback(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + chip::EndpointId endpoint, chip::NodeId nodeId, chip::GroupId groupId, + chip::EndpointId endpointId, chip::ClusterId clusterId, + chip::app::Clusters::Binding::Commands::Unbind::DecodableType & fields); /** * @brief Sample Mfg Specific Cluster Cluster CommandOne Command callback (from client) */ -bool emberAfSampleMfgSpecificClusterClusterCommandOneCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t argOne); +bool emberAfSampleMfgSpecificClusterClusterCommandOneCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t argOne, chip::app::Clusters::SampleMfgSpecificCluster::Commands::CommandOne::DecodableType & fields); /** * @brief Sample Mfg Specific Cluster 2 Cluster CommandTwo Command callback (from client) */ -bool emberAfSampleMfgSpecificCluster2ClusterCommandTwoCallback(chip::EndpointId endpoint, chip::app::CommandHandler * commandObj, - uint8_t argOne); +bool emberAfSampleMfgSpecificCluster2ClusterCommandTwoCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, chip::EndpointId endpoint, + uint8_t argOne, chip::app::Clusters::SampleMfgSpecificCluster2::Commands::CommandTwo::DecodableType & fields); /** @brief Add To Current App Tasks * diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index a89b28037604df..6946720c89daa2 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -37,1002 +37,4028 @@ namespace DeviceTemperatureConfiguration { } // namespace DeviceTemperatureConfiguration namespace Identify { +namespace Commands { +namespace Identify { +struct Type +{ +}; + +struct DecodableType +{ +}; } // namespace Identify -namespace Groups { -} // namespace Groups -namespace Scenes { +namespace IdentifyQueryResponse { +struct Type +{ +}; -} // namespace Scenes -namespace OnOff { -// Enum for OnOffDelayedAllOffEffectVariant -enum class OnOffDelayedAllOffEffectVariant : uint8_t +struct DecodableType { - ON_OFF_DELAYED_ALL_OFF_EFFECT_VARIANT_FADE_TO_OFF_IN_0P8_SECONDS = 0x00, - ON_OFF_DELAYED_ALL_OFF_EFFECT_VARIANT_NO_FADE = 0x01, - ON_OFF_DELAYED_ALL_OFF_EFFECT_VARIANT_50_PERCENT_DIM_DOWN_IN_0P8_SECONDS_THEN_FADE_TO_OFF_IN_12_SECONDS = 0x02, }; -// Enum for OnOffDyingLightEffectVariant -enum class OnOffDyingLightEffectVariant : uint8_t +} // namespace IdentifyQueryResponse + +namespace IdentifyQuery { +struct Type { - ON_OFF_DYING_LIGHT_EFFECT_VARIANT_20_PERCENTER_DIM_UP_IN_0P5_SECONDS_THEN_FADE_TO_OFF_IN_1_SECOND = 0x00, }; -// Enum for OnOffEffectIdentifier -enum class OnOffEffectIdentifier : uint8_t + +struct DecodableType { - ON_OFF_EFFECT_IDENTIFIER_DELAYED_ALL_OFF = 0x00, - ON_OFF_EFFECT_IDENTIFIER_DYING_LIGHT = 0x01, }; +} // namespace IdentifyQuery -} // namespace OnOff -namespace OnOffSwitchConfiguration { +namespace TriggerEffect { +struct Type +{ +}; -} // namespace OnOffSwitchConfiguration -namespace LevelControl { +struct DecodableType +{ +}; +} // namespace TriggerEffect -} // namespace LevelControl -namespace Alarms { +} // namespace Commands +} // namespace Identify +namespace Groups { -} // namespace Alarms -namespace Time { +namespace Commands { +namespace AddGroup { +struct Type +{ +}; -} // namespace Time -namespace BinaryInputBasic { +struct DecodableType +{ +}; +} // namespace AddGroup -} // namespace BinaryInputBasic -namespace PowerProfile { +namespace AddGroupResponse { +struct Type +{ +}; -} // namespace PowerProfile -namespace ApplianceControl { +struct DecodableType +{ +}; +} // namespace AddGroupResponse -} // namespace ApplianceControl -namespace Descriptor { +namespace ViewGroup { +struct Type +{ +}; -namespace DeviceType { -enum FieldId +struct DecodableType { - kTypeFieldId = 0, - kRevisionFieldId = 1, }; +} // namespace ViewGroup +namespace ViewGroupResponse { struct Type { -public: - uint32_t type; - uint16_t revision; - - CHIP_ERROR Encode(TLV::TLVWriter & writer, uint64_t tag) const; - CHIP_ERROR Decode(TLV::TLVReader & reader); }; -} // namespace DeviceType +struct DecodableType +{ +}; +} // namespace ViewGroupResponse -} // namespace Descriptor -namespace PollControl { +namespace GetGroupMembership { +struct Type +{ +}; -} // namespace PollControl -namespace Basic { +struct DecodableType +{ +}; +} // namespace GetGroupMembership -} // namespace Basic -namespace OtaSoftwareUpdateProvider { -// Enum for OTAApplyUpdateAction -enum class OTAApplyUpdateAction : uint8_t +namespace GetGroupMembershipResponse { +struct Type { - OTA_APPLY_UPDATE_ACTION_PROCEED = 0x00, - OTA_APPLY_UPDATE_ACTION_AWAIT_NEXT_ACTION = 0x01, - OTA_APPLY_UPDATE_ACTION_DISCONTINUE = 0x02, }; -// Enum for OTADownloadProtocol -enum class OTADownloadProtocol : uint8_t + +struct DecodableType { - OTA_DOWNLOAD_PROTOCOL_BDX_SYNCHRONOUS = 0x00, - OTA_DOWNLOAD_PROTOCOL_BDX_ASYNCHRONOUS = 0x01, - OTA_DOWNLOAD_PROTOCOL_HTTPS = 0x02, - OTA_DOWNLOAD_PROTOCOL_VENDOR_SPECIFIC = 0x03, }; -// Enum for OTAQueryStatus -enum class OTAQueryStatus : uint8_t +} // namespace GetGroupMembershipResponse + +namespace RemoveGroup { +struct Type { - OTA_QUERY_STATUS_UPDATE_AVAILABLE = 0x00, - OTA_QUERY_STATUS_BUSY = 0x01, - OTA_QUERY_STATUS_NOT_AVAILABLE = 0x02, }; -} // namespace OtaSoftwareUpdateProvider -namespace OtaSoftwareUpdateRequestor { -// Enum for OTAAnnouncementReason -enum class OTAAnnouncementReason : uint8_t +struct DecodableType { - OTA_ANNOUNCEMENT_REASON_SIMPLE_ANNOUNCEMENT = 0x00, - OTA_ANNOUNCEMENT_REASON_UPDATE_AVAILABLE = 0x01, - OTA_ANNOUNCEMENT_REASON_URGENT_UPDATE_AVAILABLE = 0x02, }; +} // namespace RemoveGroup -} // namespace OtaSoftwareUpdateRequestor -namespace PowerSource { +namespace RemoveGroupResponse { +struct Type +{ +}; -} // namespace PowerSource -namespace GeneralCommissioning { -// Enum for GeneralCommissioningError -enum class GeneralCommissioningError : uint8_t +struct DecodableType { - GENERAL_COMMISSIONING_ERROR_OK = 0x00, - GENERAL_COMMISSIONING_ERROR_VALUE_OUTSIDE_RANGE = 0x01, - GENERAL_COMMISSIONING_ERROR_INVALID_AUTHENTICATION = 0x02, }; -// Enum for RegulatoryLocationType -enum class RegulatoryLocationType : uint8_t +} // namespace RemoveGroupResponse + +namespace RemoveAllGroups { +struct Type { - REGULATORY_LOCATION_TYPE_INDOOR = 0x00, - REGULATORY_LOCATION_TYPE_OUTDOOR = 0x01, - REGULATORY_LOCATION_TYPE_INDOOR_OUTDOOR = 0x02, }; -namespace BasicCommissioningInfoType { -enum FieldId +struct DecodableType { - kFailSafeExpiryLengthMsFieldId = 0, }; +} // namespace RemoveAllGroups +namespace AddGroupIfIdentifying { struct Type { -public: - uint32_t failSafeExpiryLengthMs; +}; - CHIP_ERROR Encode(TLV::TLVWriter & writer, uint64_t tag) const; - CHIP_ERROR Decode(TLV::TLVReader & reader); +struct DecodableType +{ }; +} // namespace AddGroupIfIdentifying -} // namespace BasicCommissioningInfoType +} // namespace Commands +} // namespace Groups +namespace Scenes { -} // namespace GeneralCommissioning -namespace NetworkCommissioning { -// Enum for NetworkCommissioningError -enum class NetworkCommissioningError : uint8_t +namespace Commands { +namespace AddScene { +struct Type { - NETWORK_COMMISSIONING_ERROR_SUCCESS = 0x00, - NETWORK_COMMISSIONING_ERROR_OUT_OF_RANGE = 0x01, - NETWORK_COMMISSIONING_ERROR_BOUNDS_EXCEEDED = 0x02, - NETWORK_COMMISSIONING_ERROR_NETWORK_ID_NOT_FOUND = 0x03, - NETWORK_COMMISSIONING_ERROR_DUPLICATE_NETWORK_ID = 0x04, - NETWORK_COMMISSIONING_ERROR_NETWORK_NOT_FOUND = 0x05, - NETWORK_COMMISSIONING_ERROR_REGULATORY_ERROR = 0x06, - NETWORK_COMMISSIONING_ERROR_AUTH_FAILURE = 0x07, - NETWORK_COMMISSIONING_ERROR_UNSUPPORTED_SECURITY = 0x08, - NETWORK_COMMISSIONING_ERROR_OTHER_CONNECTION_FAILURE = 0x09, - NETWORK_COMMISSIONING_ERROR_IPV6_FAILED = 0x0A, - NETWORK_COMMISSIONING_ERROR_IP_BIND_FAILED = 0x0B, - NETWORK_COMMISSIONING_ERROR_LABEL9 = 0x0C, - NETWORK_COMMISSIONING_ERROR_LABEL10 = 0x0D, - NETWORK_COMMISSIONING_ERROR_LABEL11 = 0x0E, - NETWORK_COMMISSIONING_ERROR_LABEL12 = 0x0F, - NETWORK_COMMISSIONING_ERROR_LABEL13 = 0x10, - NETWORK_COMMISSIONING_ERROR_LABEL14 = 0x11, - NETWORK_COMMISSIONING_ERROR_LABEL15 = 0x12, - NETWORK_COMMISSIONING_ERROR_UNKNOWN_ERROR = 0x13, }; -namespace ThreadInterfaceScanResult { -enum FieldId +struct DecodableType { - kDiscoveryResponseFieldId = 0, }; +} // namespace AddScene +namespace AddSceneResponse { struct Type { -public: - chip::ByteSpan discoveryResponse; - - CHIP_ERROR Encode(TLV::TLVWriter & writer, uint64_t tag) const; - CHIP_ERROR Decode(TLV::TLVReader & reader); }; -} // namespace ThreadInterfaceScanResult -namespace WiFiInterfaceScanResult { -enum FieldId +struct DecodableType { - kSecurityFieldId = 0, - kSsidFieldId = 1, - kBssidFieldId = 2, - kChannelFieldId = 3, - kFrequencyBandFieldId = 4, }; +} // namespace AddSceneResponse +namespace ViewScene { struct Type { -public: - uint8_t security; - chip::ByteSpan ssid; - chip::ByteSpan bssid; - uint8_t channel; - uint32_t frequencyBand; +}; - CHIP_ERROR Encode(TLV::TLVWriter & writer, uint64_t tag) const; - CHIP_ERROR Decode(TLV::TLVReader & reader); +struct DecodableType +{ }; +} // namespace ViewScene -} // namespace WiFiInterfaceScanResult +namespace ViewSceneResponse { +struct Type +{ +}; -} // namespace NetworkCommissioning -namespace DiagnosticLogs { -// Enum for LogsIntent -enum class LogsIntent : uint8_t +struct DecodableType { - LOGS_INTENT_END_USER_SUPPORT = 0x00, - LOGS_INTENT_NETWORK_DIAG = 0x01, - LOGS_INTENT_CRASH_LOGS = 0x02, }; -// Enum for LogsStatus -enum class LogsStatus : uint8_t +} // namespace ViewSceneResponse + +namespace RemoveScene { +struct Type { - LOGS_STATUS_SUCCESS = 0x00, - LOGS_STATUS_EXHAUSTED = 0x01, - LOGS_STATUS_NO_LOGS = 0x02, - LOGS_STATUS_BUSY = 0x03, - LOGS_STATUS_DENIED = 0x04, }; -// Enum for LogsTransferProtocol -enum class LogsTransferProtocol : uint8_t + +struct DecodableType { - LOGS_TRANSFER_PROTOCOL_RESPONSE_PAYLOAD = 0x00, - LOGS_TRANSFER_PROTOCOL_BDX = 0x01, }; +} // namespace RemoveScene -} // namespace DiagnosticLogs -namespace GeneralDiagnostics { -// Enum for BootReasonType -enum class BootReasonType : uint8_t +namespace RemoveSceneResponse { +struct Type { - BOOT_REASON_TYPE_UNSPECIFIED = 0x00, - BOOT_REASON_TYPE_POWER_ON_REBOOT = 0x01, - BOOT_REASON_TYPE_BROWN_OUT_RESET = 0x02, - BOOT_REASON_TYPE_SOFTWARE_WATCHDOG_RESET = 0x03, - BOOT_REASON_TYPE_HARDWARE_WATCHDOG_RESET = 0x04, - BOOT_REASON_TYPE_SOFTWARE_UPDATE_COMPLETED = 0x05, - BOOT_REASON_TYPE_SOFTWARE_RESET = 0x06, }; -// Enum for HardwareFaultType -enum class HardwareFaultType : uint8_t + +struct DecodableType { - HARDWARE_FAULT_TYPE_UNSPECIFIED = 0x00, - HARDWARE_FAULT_TYPE_RADIO = 0x01, - HARDWARE_FAULT_TYPE_SENSOR = 0x02, - HARDWARE_FAULT_TYPE_RESETTABLE_OVER_TEMP = 0x03, - HARDWARE_FAULT_TYPE_NON_RESETTABLE_OVER_TEMP = 0x04, - HARDWARE_FAULT_TYPE_POWER_SOURCE = 0x05, - HARDWARE_FAULT_TYPE_VISUAL_DISPLAY_FAULT = 0x06, - HARDWARE_FAULT_TYPE_AUDIO_OUTPUT_FAULT = 0x07, - HARDWARE_FAULT_TYPE_USER_INTERFACE_FAULT = 0x08, - HARDWARE_FAULT_TYPE_NON_VOLATILE_MEMORY_ERROR = 0x09, - HARDWARE_FAULT_TYPE_TAMPER_DETECTED = 0x0A, }; -// Enum for InterfaceType -enum class InterfaceType : uint8_t +} // namespace RemoveSceneResponse + +namespace RemoveAllScenes { +struct Type { - INTERFACE_TYPE_UNSPECIFIED = 0x00, - INTERFACE_TYPE_WI_FI = 0x01, - INTERFACE_TYPE_ETHERNET = 0x02, - INTERFACE_TYPE_CELLULAR = 0x03, - INTERFACE_TYPE_THREAD = 0x04, }; -// Enum for NetworkFaultType -enum class NetworkFaultType : uint8_t + +struct DecodableType { - NETWORK_FAULT_TYPE_UNSPECIFIED = 0x00, - NETWORK_FAULT_TYPE_HARDWARE_FAILURE = 0x01, - NETWORK_FAULT_TYPE_NETWORK_JAMMED = 0x02, - NETWORK_FAULT_TYPE_CONNECTION_FAILED = 0x03, }; -// Enum for RadioFaultType -enum class RadioFaultType : uint8_t +} // namespace RemoveAllScenes + +namespace RemoveAllScenesResponse { +struct Type { - RADIO_FAULT_TYPE_UNSPECIFIED = 0x00, - RADIO_FAULT_TYPE_WI_FI_FAULT = 0x01, - RADIO_FAULT_TYPE_CELLULAR_FAULT = 0x02, - RADIO_FAULT_TYPE_THREAD_FAULT = 0x03, - RADIO_FAULT_TYPE_NFC_FAULT = 0x04, - RADIO_FAULT_TYPE_BLE_FAULT = 0x05, - RADIO_FAULT_TYPE_ETHERNET_FAULT = 0x06, }; -namespace NetworkInterfaceType { -enum FieldId +struct DecodableType { - kNameFieldId = 0, - kFabricConnectedFieldId = 1, - kOffPremiseServicesReachableIPv4FieldId = 2, - kOffPremiseServicesReachableIPv6FieldId = 3, - kHardwareAddressFieldId = 4, - kTypeFieldId = 5, }; +} // namespace RemoveAllScenesResponse +namespace StoreScene { struct Type { -public: - chip::ByteSpan name; - bool fabricConnected; - bool offPremiseServicesReachableIPv4; - bool offPremiseServicesReachableIPv6; - chip::ByteSpan hardwareAddress; - InterfaceType type; - - CHIP_ERROR Encode(TLV::TLVWriter & writer, uint64_t tag) const; - CHIP_ERROR Decode(TLV::TLVReader & reader); }; -} // namespace NetworkInterfaceType +struct DecodableType +{ +}; +} // namespace StoreScene -} // namespace GeneralDiagnostics -namespace SoftwareDiagnostics { +namespace StoreSceneResponse { +struct Type +{ +}; -namespace ThreadMetrics { -enum FieldId +struct DecodableType { - kIdFieldId = 0, - kNameFieldId = 1, - kStackFreeCurrentFieldId = 2, - kStackFreeMinimumFieldId = 3, - kStackSizeFieldId = 4, }; +} // namespace StoreSceneResponse +namespace RecallScene { struct Type { -public: - uint64_t id; - chip::ByteSpan name; - uint32_t stackFreeCurrent; - uint32_t stackFreeMinimum; - uint32_t stackSize; +}; - CHIP_ERROR Encode(TLV::TLVWriter & writer, uint64_t tag) const; - CHIP_ERROR Decode(TLV::TLVReader & reader); +struct DecodableType +{ }; +} // namespace RecallScene -} // namespace ThreadMetrics +namespace GetSceneMembership { +struct Type +{ +}; -} // namespace SoftwareDiagnostics -namespace ThreadNetworkDiagnostics { -// Enum for NetworkFault -enum class NetworkFault : uint8_t +struct DecodableType { - NETWORK_FAULT_UNSPECIFIED = 0x00, - NETWORK_FAULT_LINK_DOWN = 0x01, - NETWORK_FAULT_HARDWARE_FAILURE = 0x02, - NETWORK_FAULT_NETWORK_JAMMED = 0x03, }; -// Enum for RoutingRole -enum class RoutingRole : uint8_t +} // namespace GetSceneMembership + +namespace GetSceneMembershipResponse { +struct Type { - ROUTING_ROLE_UNSPECIFIED = 0x00, - ROUTING_ROLE_UNASSIGNED = 0x01, - ROUTING_ROLE_SLEEPY_END_DEVICE = 0x02, - ROUTING_ROLE_END_DEVICE = 0x03, - ROUTING_ROLE_REED = 0x04, - ROUTING_ROLE_ROUTER = 0x05, - ROUTING_ROLE_LEADER = 0x06, }; -namespace NeighborTable { -enum FieldId +struct DecodableType { - kExtAddressFieldId = 0, - kAgeFieldId = 1, - kRloc16FieldId = 2, - kLinkFrameCounterFieldId = 3, - kMleFrameCounterFieldId = 4, - kLqiFieldId = 5, - kAverageRssiFieldId = 6, - kLastRssiFieldId = 7, - kFrameErrorRateFieldId = 8, - kMessageErrorRateFieldId = 9, - kRxOnWhenIdleFieldId = 10, - kFullThreadDeviceFieldId = 11, - kFullNetworkDataFieldId = 12, - kIsChildFieldId = 13, }; +} // namespace GetSceneMembershipResponse +namespace EnhancedAddScene { struct Type { -public: - uint64_t extAddress; - uint32_t age; - uint16_t rloc16; - uint32_t linkFrameCounter; - uint32_t mleFrameCounter; - uint8_t lqi; - int8_t averageRssi; - int8_t lastRssi; - uint8_t frameErrorRate; - uint8_t messageErrorRate; - bool rxOnWhenIdle; - bool fullThreadDevice; - bool fullNetworkData; - bool isChild; - - CHIP_ERROR Encode(TLV::TLVWriter & writer, uint64_t tag) const; - CHIP_ERROR Decode(TLV::TLVReader & reader); }; -} // namespace NeighborTable -namespace OperationalDatasetComponents { -enum FieldId +struct DecodableType { - kActiveTimestampPresentFieldId = 0, - kPendingTimestampPresentFieldId = 1, - kMasterKeyPresentFieldId = 2, - kNetworkNamePresentFieldId = 3, - kExtendedPanIdPresentFieldId = 4, - kMeshLocalPrefixPresentFieldId = 5, - kDelayPresentFieldId = 6, - kPanIdPresentFieldId = 7, - kChannelPresentFieldId = 8, - kPskcPresentFieldId = 9, - kSecurityPolicyPresentFieldId = 10, - kChannelMaskPresentFieldId = 11, }; +} // namespace EnhancedAddScene +namespace EnhancedAddSceneResponse { struct Type { -public: - bool activeTimestampPresent; - bool pendingTimestampPresent; - bool masterKeyPresent; - bool networkNamePresent; - bool extendedPanIdPresent; - bool meshLocalPrefixPresent; - bool delayPresent; - bool panIdPresent; - bool channelPresent; - bool pskcPresent; - bool securityPolicyPresent; - bool channelMaskPresent; - - CHIP_ERROR Encode(TLV::TLVWriter & writer, uint64_t tag) const; - CHIP_ERROR Decode(TLV::TLVReader & reader); }; -} // namespace OperationalDatasetComponents -namespace RouteTable { -enum FieldId +struct DecodableType { - kExtAddressFieldId = 0, - kRloc16FieldId = 1, - kRouterIdFieldId = 2, - kNextHopFieldId = 3, - kPathCostFieldId = 4, - kLQIInFieldId = 5, - kLQIOutFieldId = 6, - kAgeFieldId = 7, - kAllocatedFieldId = 8, - kLinkEstablishedFieldId = 9, }; +} // namespace EnhancedAddSceneResponse +namespace EnhancedViewScene { struct Type { -public: - uint64_t extAddress; - uint16_t rloc16; - uint8_t routerId; - uint8_t nextHop; - uint8_t pathCost; - uint8_t lQIIn; - uint8_t lQIOut; - uint8_t age; - bool allocated; - bool linkEstablished; - - CHIP_ERROR Encode(TLV::TLVWriter & writer, uint64_t tag) const; - CHIP_ERROR Decode(TLV::TLVReader & reader); }; -} // namespace RouteTable -namespace SecurityPolicy { -enum FieldId +struct DecodableType { - kRotationTimeFieldId = 0, - kFlagsFieldId = 1, }; +} // namespace EnhancedViewScene +namespace EnhancedViewSceneResponse { struct Type { -public: - uint16_t rotationTime; - uint16_t flags; +}; - CHIP_ERROR Encode(TLV::TLVWriter & writer, uint64_t tag) const; - CHIP_ERROR Decode(TLV::TLVReader & reader); +struct DecodableType +{ }; +} // namespace EnhancedViewSceneResponse -} // namespace SecurityPolicy +namespace CopyScene { +struct Type +{ +}; -} // namespace ThreadNetworkDiagnostics -namespace WiFiNetworkDiagnostics { -// Enum for SecurityType -enum class SecurityType : uint8_t +struct DecodableType { - SECURITY_TYPE_UNSPECIFIED = 0x00, - SECURITY_TYPE_NONE = 0x01, - SECURITY_TYPE_WEP = 0x02, - SECURITY_TYPE_WPA = 0x03, - SECURITY_TYPE_WPA2 = 0x04, - SECURITY_TYPE_WPA3 = 0x05, }; -// Enum for WiFiVersionType -enum class WiFiVersionType : uint8_t +} // namespace CopyScene + +namespace CopySceneResponse { +struct Type { - WI_FI_VERSION_TYPE_802__11A = 0x00, - WI_FI_VERSION_TYPE_802__11B = 0x01, - WI_FI_VERSION_TYPE_802__11G = 0x02, - WI_FI_VERSION_TYPE_802__11N = 0x03, - WI_FI_VERSION_TYPE_802__11AC = 0x04, - WI_FI_VERSION_TYPE_802__11AX = 0x05, }; -} // namespace WiFiNetworkDiagnostics -namespace EthernetNetworkDiagnostics { -// Enum for PHYRateType -enum class PHYRateType : uint8_t +struct DecodableType { - PHY_RATE_TYPE_10_M = 0x00, - PHY_RATE_TYPE_100_M = 0x01, - PHY_RATE_TYPE_1000_M = 0x02, - PHY_RATE_TYPE_2__5_G = 0x03, - PHY_RATE_TYPE_5_G = 0x04, - PHY_RATE_TYPE_10_G = 0x05, - PHY_RATE_TYPE_40_G = 0x06, - PHY_RATE_TYPE_100_G = 0x07, - PHY_RATE_TYPE_200_G = 0x08, - PHY_RATE_TYPE_400_G = 0x09, }; +} // namespace CopySceneResponse -} // namespace EthernetNetworkDiagnostics -namespace BridgedDeviceBasic { +} // namespace Commands +} // namespace Scenes +namespace OnOff { +// Enum for OnOffDelayedAllOffEffectVariant +enum class OnOffDelayedAllOffEffectVariant : uint8_t +{ + ON_OFF_DELAYED_ALL_OFF_EFFECT_VARIANT_FADE_TO_OFF_IN_0P8_SECONDS = 0x00, + ON_OFF_DELAYED_ALL_OFF_EFFECT_VARIANT_NO_FADE = 0x01, + ON_OFF_DELAYED_ALL_OFF_EFFECT_VARIANT_50_PERCENT_DIM_DOWN_IN_0P8_SECONDS_THEN_FADE_TO_OFF_IN_12_SECONDS = 0x02, +}; +// Enum for OnOffDyingLightEffectVariant +enum class OnOffDyingLightEffectVariant : uint8_t +{ + ON_OFF_DYING_LIGHT_EFFECT_VARIANT_20_PERCENTER_DIM_UP_IN_0P5_SECONDS_THEN_FADE_TO_OFF_IN_1_SECOND = 0x00, +}; +// Enum for OnOffEffectIdentifier +enum class OnOffEffectIdentifier : uint8_t +{ + ON_OFF_EFFECT_IDENTIFIER_DELAYED_ALL_OFF = 0x00, + ON_OFF_EFFECT_IDENTIFIER_DYING_LIGHT = 0x01, +}; -} // namespace BridgedDeviceBasic -namespace Switch { +namespace Commands { +namespace Off { +struct Type +{ +}; -} // namespace Switch -namespace AdministratorCommissioning { -// Enum for StatusCode -enum class StatusCode : uint8_t +struct DecodableType { - STATUS_CODE_SUCCESS = 0x00, - STATUS_CODE_BUSY = 0x01, - STATUS_CODE_GENERAL_ERROR = 0x02, }; +} // namespace Off -} // namespace AdministratorCommissioning -namespace OperationalCredentials { -// Enum for NodeOperationalCertStatus -enum class NodeOperationalCertStatus : uint8_t +namespace SampleMfgSpecificOffWithTransition { +struct Type { - NODE_OPERATIONAL_CERT_STATUS_SUCCESS = 0x00, - NODE_OPERATIONAL_CERT_STATUS_INVALID_PUBLIC_KEY = 0x01, - NODE_OPERATIONAL_CERT_STATUS_INVALID_NODE_OP_ID = 0x02, - NODE_OPERATIONAL_CERT_STATUS_INVALID_NOC = 0x03, - NODE_OPERATIONAL_CERT_STATUS_MISSING_CSR = 0x04, - NODE_OPERATIONAL_CERT_STATUS_TABLE_FULL = 0x05, - NODE_OPERATIONAL_CERT_STATUS_INSUFFICIENT_PRIVILEGE = 0x08, - NODE_OPERATIONAL_CERT_STATUS_FABRIC_CONFLICT = 0x09, - NODE_OPERATIONAL_CERT_STATUS_LABEL_CONFLICT = 0x0A, - NODE_OPERATIONAL_CERT_STATUS_INVALID_FABRIC_INDEX = 0x0B, }; -namespace FabricDescriptor { -enum FieldId +struct DecodableType { - kFabricIndexFieldId = 0, - kRootPublicKeyFieldId = 1, - kVendorIdFieldId = 2, - kFabricIdFieldId = 3, - kNodeIdFieldId = 4, - kLabelFieldId = 5, }; +} // namespace SampleMfgSpecificOffWithTransition +namespace On { struct Type { -public: - uint8_t fabricIndex; - chip::ByteSpan rootPublicKey; - uint16_t vendorId; - uint64_t fabricId; - uint64_t nodeId; - chip::ByteSpan label; - - CHIP_ERROR Encode(TLV::TLVWriter & writer, uint64_t tag) const; - CHIP_ERROR Decode(TLV::TLVReader & reader); }; -} // namespace FabricDescriptor -namespace NOCStruct { -enum FieldId +struct DecodableType { - kFabricIndexFieldId = 0, - kNocFieldId = 1, }; +} // namespace On +namespace SampleMfgSpecificOnWithTransition { struct Type { -public: - uint8_t fabricIndex; - chip::ByteSpan noc; - - CHIP_ERROR Encode(TLV::TLVWriter & writer, uint64_t tag) const; - CHIP_ERROR Decode(TLV::TLVReader & reader); }; -} // namespace NOCStruct +struct DecodableType +{ +}; +} // namespace SampleMfgSpecificOnWithTransition -} // namespace OperationalCredentials -namespace FixedLabel { +namespace SampleMfgSpecificOnWithTransition2 { +struct Type +{ +}; -namespace LabelStruct { -enum FieldId +struct DecodableType { - kLabelFieldId = 0, - kValueFieldId = 1, }; +} // namespace SampleMfgSpecificOnWithTransition2 +namespace Toggle { struct Type { -public: - chip::ByteSpan label; - chip::ByteSpan value; +}; - CHIP_ERROR Encode(TLV::TLVWriter & writer, uint64_t tag) const; - CHIP_ERROR Decode(TLV::TLVReader & reader); +struct DecodableType +{ }; +} // namespace Toggle -} // namespace LabelStruct +namespace SampleMfgSpecificToggleWithTransition { +struct Type +{ +}; -} // namespace FixedLabel -namespace ShadeConfiguration { +struct DecodableType +{ +}; +} // namespace SampleMfgSpecificToggleWithTransition -} // namespace ShadeConfiguration -namespace DoorLock { +namespace SampleMfgSpecificToggleWithTransition2 { +struct Type +{ +}; -} // namespace DoorLock -namespace WindowCovering { -// Enum for WcEndProductType -enum class WcEndProductType : uint8_t +struct DecodableType { - WC_END_PRODUCT_TYPE_ROLLER_SHADE = 0x00, - WC_END_PRODUCT_TYPE_ROMAN_SHADE = 0x01, - WC_END_PRODUCT_TYPE_BALLOON_SHADE = 0x02, - WC_END_PRODUCT_TYPE_WOVEN_WOOD = 0x03, - WC_END_PRODUCT_TYPE_PLEATED_SHADE = 0x04, - WC_END_PRODUCT_TYPE_CELLULAR_SHADE = 0x05, - WC_END_PRODUCT_TYPE_LAYERED_SHADE = 0x06, - WC_END_PRODUCT_TYPE_LAYERED_SHADE2_D = 0x07, - WC_END_PRODUCT_TYPE_SHEER_SHADE = 0x08, - WC_END_PRODUCT_TYPE_TILT_ONLY_INTERIOR_BLIND = 0x09, - WC_END_PRODUCT_TYPE_INTERIOR_BLIND = 0x0A, - WC_END_PRODUCT_TYPE_VERTICAL_BLIND_STRIP_CURTAIN = 0x0B, - WC_END_PRODUCT_TYPE_INTERIOR_VENETIAN_BLIND = 0x0C, - WC_END_PRODUCT_TYPE_EXTERIOR_VENETIAN_BLIND = 0x0D, - WC_END_PRODUCT_TYPE_LATERAL_LEFT_CURTAIN = 0x0E, - WC_END_PRODUCT_TYPE_LATERAL_RIGHT_CURTAIN = 0x0F, - WC_END_PRODUCT_TYPE_CENTRAL_CURTAIN = 0x10, - WC_END_PRODUCT_TYPE_ROLLER_SHUTTER = 0x11, - WC_END_PRODUCT_TYPE_EXTERIOR_VERTICAL_SCREEN = 0x12, - WC_END_PRODUCT_TYPE_AWNING_TERRACE_PATIO = 0x13, - WC_END_PRODUCT_TYPE_AWNING_VERTICAL_SCREEN = 0x14, - WC_END_PRODUCT_TYPE_TILT_ONLY_PERGOLA = 0x15, - WC_END_PRODUCT_TYPE_SWINGING_SHUTTER = 0x16, - WC_END_PRODUCT_TYPE_SLIDING_SHUTTER = 0x17, - WC_END_PRODUCT_TYPE_UNKNOWN = 0xFF, }; -// Enum for WcType -enum class WcType : uint8_t +} // namespace SampleMfgSpecificToggleWithTransition2 + +namespace OffWithEffect { +struct Type { - WC_TYPE_ROLLERSHADE = 0x00, - WC_TYPE_ROLLERSHADE2_MOTOR = 0x01, - WC_TYPE_ROLLERSHADE_EXTERIOR = 0x02, - WC_TYPE_ROLLERSHADE_EXTERIOR2_MOTOR = 0x03, - WC_TYPE_DRAPERY = 0x04, - WC_TYPE_AWNING = 0x05, - WC_TYPE_SHUTTER = 0x06, - WC_TYPE_TILT_BLIND_TILT_ONLY = 0x07, - WC_TYPE_TILT_BLIND_LIFT_AND_TILT = 0x08, - WC_TYPE_PROJECTOR_SCREEN = 0x09, - WC_TYPE_UNKNOWN = 0xFF, }; -} // namespace WindowCovering -namespace BarrierControl { +struct DecodableType +{ +}; +} // namespace OffWithEffect -} // namespace BarrierControl -namespace PumpConfigurationAndControl { -// Enum for PumpControlMode -enum class PumpControlMode : uint8_t +namespace OnWithRecallGlobalScene { +struct Type { - PUMP_CONTROL_MODE_CONSTANT_SPEED = 0x00, - PUMP_CONTROL_MODE_CONSTANT_PRESSURE = 0x01, - PUMP_CONTROL_MODE_PROPORTIONAL_PRESSURE = 0x02, - PUMP_CONTROL_MODE_CONSTANT_FLOW = 0x03, - PUMP_CONTROL_MODE_CONSTANT_TEMPERATURE = 0x05, - PUMP_CONTROL_MODE_AUTOMATIC = 0x07, }; -// Enum for PumpOperationMode -enum class PumpOperationMode : uint8_t + +struct DecodableType { - PUMP_OPERATION_MODE_NORMAL = 0x00, - PUMP_OPERATION_MODE_MINIMUM = 0x01, - PUMP_OPERATION_MODE_MAXIMUM = 0x02, - PUMP_OPERATION_MODE_LOCAL = 0x03, }; +} // namespace OnWithRecallGlobalScene -} // namespace PumpConfigurationAndControl -namespace Thermostat { +namespace OnWithTimedOff { +struct Type +{ +}; -} // namespace Thermostat -namespace FanControl { +struct DecodableType +{ +}; +} // namespace OnWithTimedOff -} // namespace FanControl -namespace DehumidificationControl { +} // namespace Commands +} // namespace OnOff +namespace OnOffSwitchConfiguration { -} // namespace DehumidificationControl -namespace ThermostatUserInterfaceConfiguration { +} // namespace OnOffSwitchConfiguration +namespace LevelControl { -} // namespace ThermostatUserInterfaceConfiguration -namespace ColorControl { +namespace Commands { +namespace MoveToLevel { +struct Type +{ +}; -} // namespace ColorControl -namespace BallastConfiguration { +struct DecodableType +{ +}; +} // namespace MoveToLevel -} // namespace BallastConfiguration -namespace IlluminanceMeasurement { +namespace Move { +struct Type +{ +}; -} // namespace IlluminanceMeasurement -namespace IlluminanceLevelSensing { +struct DecodableType +{ +}; +} // namespace Move -} // namespace IlluminanceLevelSensing -namespace TemperatureMeasurement { +namespace Step { +struct Type +{ +}; -} // namespace TemperatureMeasurement -namespace PressureMeasurement { +struct DecodableType +{ +}; +} // namespace Step -} // namespace PressureMeasurement -namespace FlowMeasurement { +namespace Stop { +struct Type +{ +}; -} // namespace FlowMeasurement -namespace RelativeHumidityMeasurement { +struct DecodableType +{ +}; +} // namespace Stop -} // namespace RelativeHumidityMeasurement -namespace OccupancySensing { +namespace MoveToLevelWithOnOff { +struct Type +{ +}; -} // namespace OccupancySensing +struct DecodableType +{ +}; +} // namespace MoveToLevelWithOnOff + +namespace MoveWithOnOff { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace MoveWithOnOff + +namespace StepWithOnOff { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace StepWithOnOff + +namespace StopWithOnOff { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace StopWithOnOff + +} // namespace Commands +} // namespace LevelControl +namespace Alarms { + +namespace Commands { +namespace ResetAlarm { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ResetAlarm + +namespace Alarm { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace Alarm + +namespace ResetAllAlarms { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ResetAllAlarms + +namespace GetAlarmResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetAlarmResponse + +namespace GetAlarm { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetAlarm + +namespace ResetAlarmLog { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ResetAlarmLog + +} // namespace Commands +} // namespace Alarms +namespace Time { + +} // namespace Time +namespace BinaryInputBasic { + +} // namespace BinaryInputBasic +namespace PowerProfile { + +namespace Commands { +namespace PowerProfileRequest { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace PowerProfileRequest + +namespace PowerProfileNotification { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace PowerProfileNotification + +namespace PowerProfileStateRequest { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace PowerProfileStateRequest + +namespace PowerProfileResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace PowerProfileResponse + +namespace GetPowerProfilePriceResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetPowerProfilePriceResponse + +namespace PowerProfileStateResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace PowerProfileStateResponse + +namespace GetOverallSchedulePriceResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetOverallSchedulePriceResponse + +namespace GetPowerProfilePrice { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetPowerProfilePrice + +namespace EnergyPhasesScheduleNotification { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace EnergyPhasesScheduleNotification + +namespace PowerProfilesStateNotification { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace PowerProfilesStateNotification + +namespace EnergyPhasesScheduleResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace EnergyPhasesScheduleResponse + +namespace GetOverallSchedulePrice { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetOverallSchedulePrice + +namespace PowerProfileScheduleConstraintsRequest { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace PowerProfileScheduleConstraintsRequest + +namespace EnergyPhasesScheduleRequest { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace EnergyPhasesScheduleRequest + +namespace EnergyPhasesScheduleStateRequest { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace EnergyPhasesScheduleStateRequest + +namespace EnergyPhasesScheduleStateResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace EnergyPhasesScheduleStateResponse + +namespace GetPowerProfilePriceExtendedResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetPowerProfilePriceExtendedResponse + +namespace EnergyPhasesScheduleStateNotification { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace EnergyPhasesScheduleStateNotification + +namespace PowerProfileScheduleConstraintsNotification { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace PowerProfileScheduleConstraintsNotification + +namespace PowerProfileScheduleConstraintsResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace PowerProfileScheduleConstraintsResponse + +namespace GetPowerProfilePriceExtended { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetPowerProfilePriceExtended + +} // namespace Commands +} // namespace PowerProfile +namespace ApplianceControl { + +namespace Commands { +namespace ExecutionOfACommand { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ExecutionOfACommand + +namespace SignalStateResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace SignalStateResponse + +namespace SignalState { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace SignalState + +namespace SignalStateNotification { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace SignalStateNotification + +namespace WriteFunctions { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace WriteFunctions + +namespace OverloadPauseResume { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace OverloadPauseResume + +namespace OverloadPause { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace OverloadPause + +namespace OverloadWarning { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace OverloadWarning + +} // namespace Commands +} // namespace ApplianceControl +namespace Descriptor { + +namespace DeviceType { +enum FieldId +{ + kTypeFieldId = 0, + kRevisionFieldId = 1, +}; + +struct Type +{ +public: + uint32_t type; + uint16_t revision; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, uint64_t tag) const; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; + +} // namespace DeviceType + +} // namespace Descriptor +namespace PollControl { + +namespace Commands { +namespace CheckIn { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace CheckIn + +namespace CheckInResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace CheckInResponse + +namespace FastPollStop { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace FastPollStop + +namespace SetLongPollInterval { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace SetLongPollInterval + +namespace SetShortPollInterval { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace SetShortPollInterval + +} // namespace Commands +} // namespace PollControl +namespace Basic { + +namespace Commands { +namespace StartUp { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace StartUp + +namespace MfgSpecificPing { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace MfgSpecificPing + +namespace ShutDown { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ShutDown + +namespace Leave { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace Leave + +} // namespace Commands +} // namespace Basic +namespace OtaSoftwareUpdateProvider { +// Enum for OTAApplyUpdateAction +enum class OTAApplyUpdateAction : uint8_t +{ + OTA_APPLY_UPDATE_ACTION_PROCEED = 0x00, + OTA_APPLY_UPDATE_ACTION_AWAIT_NEXT_ACTION = 0x01, + OTA_APPLY_UPDATE_ACTION_DISCONTINUE = 0x02, +}; +// Enum for OTADownloadProtocol +enum class OTADownloadProtocol : uint8_t +{ + OTA_DOWNLOAD_PROTOCOL_BDX_SYNCHRONOUS = 0x00, + OTA_DOWNLOAD_PROTOCOL_BDX_ASYNCHRONOUS = 0x01, + OTA_DOWNLOAD_PROTOCOL_HTTPS = 0x02, + OTA_DOWNLOAD_PROTOCOL_VENDOR_SPECIFIC = 0x03, +}; +// Enum for OTAQueryStatus +enum class OTAQueryStatus : uint8_t +{ + OTA_QUERY_STATUS_UPDATE_AVAILABLE = 0x00, + OTA_QUERY_STATUS_BUSY = 0x01, + OTA_QUERY_STATUS_NOT_AVAILABLE = 0x02, +}; + +namespace Commands { +namespace QueryImage { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace QueryImage + +namespace ApplyUpdateRequest { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ApplyUpdateRequest + +namespace NotifyUpdateApplied { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace NotifyUpdateApplied + +namespace QueryImageResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace QueryImageResponse + +namespace ApplyUpdateRequestResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ApplyUpdateRequestResponse + +} // namespace Commands +} // namespace OtaSoftwareUpdateProvider +namespace OtaSoftwareUpdateRequestor { +// Enum for OTAAnnouncementReason +enum class OTAAnnouncementReason : uint8_t +{ + OTA_ANNOUNCEMENT_REASON_SIMPLE_ANNOUNCEMENT = 0x00, + OTA_ANNOUNCEMENT_REASON_UPDATE_AVAILABLE = 0x01, + OTA_ANNOUNCEMENT_REASON_URGENT_UPDATE_AVAILABLE = 0x02, +}; + +namespace Commands { +namespace AnnounceOtaProvider { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace AnnounceOtaProvider + +} // namespace Commands +} // namespace OtaSoftwareUpdateRequestor +namespace PowerSource { + +} // namespace PowerSource +namespace GeneralCommissioning { +// Enum for GeneralCommissioningError +enum class GeneralCommissioningError : uint8_t +{ + GENERAL_COMMISSIONING_ERROR_OK = 0x00, + GENERAL_COMMISSIONING_ERROR_VALUE_OUTSIDE_RANGE = 0x01, + GENERAL_COMMISSIONING_ERROR_INVALID_AUTHENTICATION = 0x02, +}; +// Enum for RegulatoryLocationType +enum class RegulatoryLocationType : uint8_t +{ + REGULATORY_LOCATION_TYPE_INDOOR = 0x00, + REGULATORY_LOCATION_TYPE_OUTDOOR = 0x01, + REGULATORY_LOCATION_TYPE_INDOOR_OUTDOOR = 0x02, +}; + +namespace BasicCommissioningInfoType { +enum FieldId +{ + kFailSafeExpiryLengthMsFieldId = 0, +}; + +struct Type +{ +public: + uint32_t failSafeExpiryLengthMs; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, uint64_t tag) const; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; + +} // namespace BasicCommissioningInfoType + +namespace Commands { +namespace ArmFailSafe { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ArmFailSafe + +namespace ArmFailSafeResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ArmFailSafeResponse + +namespace SetRegulatoryConfig { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace SetRegulatoryConfig + +namespace SetRegulatoryConfigResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace SetRegulatoryConfigResponse + +namespace CommissioningComplete { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace CommissioningComplete + +namespace CommissioningCompleteResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace CommissioningCompleteResponse + +} // namespace Commands +} // namespace GeneralCommissioning +namespace NetworkCommissioning { +// Enum for NetworkCommissioningError +enum class NetworkCommissioningError : uint8_t +{ + NETWORK_COMMISSIONING_ERROR_SUCCESS = 0x00, + NETWORK_COMMISSIONING_ERROR_OUT_OF_RANGE = 0x01, + NETWORK_COMMISSIONING_ERROR_BOUNDS_EXCEEDED = 0x02, + NETWORK_COMMISSIONING_ERROR_NETWORK_ID_NOT_FOUND = 0x03, + NETWORK_COMMISSIONING_ERROR_DUPLICATE_NETWORK_ID = 0x04, + NETWORK_COMMISSIONING_ERROR_NETWORK_NOT_FOUND = 0x05, + NETWORK_COMMISSIONING_ERROR_REGULATORY_ERROR = 0x06, + NETWORK_COMMISSIONING_ERROR_AUTH_FAILURE = 0x07, + NETWORK_COMMISSIONING_ERROR_UNSUPPORTED_SECURITY = 0x08, + NETWORK_COMMISSIONING_ERROR_OTHER_CONNECTION_FAILURE = 0x09, + NETWORK_COMMISSIONING_ERROR_IPV6_FAILED = 0x0A, + NETWORK_COMMISSIONING_ERROR_IP_BIND_FAILED = 0x0B, + NETWORK_COMMISSIONING_ERROR_LABEL9 = 0x0C, + NETWORK_COMMISSIONING_ERROR_LABEL10 = 0x0D, + NETWORK_COMMISSIONING_ERROR_LABEL11 = 0x0E, + NETWORK_COMMISSIONING_ERROR_LABEL12 = 0x0F, + NETWORK_COMMISSIONING_ERROR_LABEL13 = 0x10, + NETWORK_COMMISSIONING_ERROR_LABEL14 = 0x11, + NETWORK_COMMISSIONING_ERROR_LABEL15 = 0x12, + NETWORK_COMMISSIONING_ERROR_UNKNOWN_ERROR = 0x13, +}; + +namespace ThreadInterfaceScanResult { +enum FieldId +{ + kDiscoveryResponseFieldId = 0, +}; + +struct Type +{ +public: + chip::ByteSpan discoveryResponse; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, uint64_t tag) const; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; + +} // namespace ThreadInterfaceScanResult +namespace WiFiInterfaceScanResult { +enum FieldId +{ + kSecurityFieldId = 0, + kSsidFieldId = 1, + kBssidFieldId = 2, + kChannelFieldId = 3, + kFrequencyBandFieldId = 4, +}; + +struct Type +{ +public: + uint8_t security; + chip::ByteSpan ssid; + chip::ByteSpan bssid; + uint8_t channel; + uint32_t frequencyBand; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, uint64_t tag) const; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; + +} // namespace WiFiInterfaceScanResult + +namespace Commands { +namespace ScanNetworks { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ScanNetworks + +namespace ScanNetworksResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ScanNetworksResponse + +namespace AddWiFiNetwork { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace AddWiFiNetwork + +namespace AddWiFiNetworkResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace AddWiFiNetworkResponse + +namespace UpdateWiFiNetwork { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace UpdateWiFiNetwork + +namespace UpdateWiFiNetworkResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace UpdateWiFiNetworkResponse + +namespace AddThreadNetwork { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace AddThreadNetwork + +namespace AddThreadNetworkResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace AddThreadNetworkResponse + +namespace UpdateThreadNetwork { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace UpdateThreadNetwork + +namespace UpdateThreadNetworkResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace UpdateThreadNetworkResponse + +namespace RemoveNetwork { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace RemoveNetwork + +namespace RemoveNetworkResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace RemoveNetworkResponse + +namespace EnableNetwork { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace EnableNetwork + +namespace EnableNetworkResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace EnableNetworkResponse + +namespace DisableNetwork { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace DisableNetwork + +namespace DisableNetworkResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace DisableNetworkResponse + +namespace GetLastNetworkCommissioningResult { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetLastNetworkCommissioningResult + +} // namespace Commands +} // namespace NetworkCommissioning +namespace DiagnosticLogs { +// Enum for LogsIntent +enum class LogsIntent : uint8_t +{ + LOGS_INTENT_END_USER_SUPPORT = 0x00, + LOGS_INTENT_NETWORK_DIAG = 0x01, + LOGS_INTENT_CRASH_LOGS = 0x02, +}; +// Enum for LogsStatus +enum class LogsStatus : uint8_t +{ + LOGS_STATUS_SUCCESS = 0x00, + LOGS_STATUS_EXHAUSTED = 0x01, + LOGS_STATUS_NO_LOGS = 0x02, + LOGS_STATUS_BUSY = 0x03, + LOGS_STATUS_DENIED = 0x04, +}; +// Enum for LogsTransferProtocol +enum class LogsTransferProtocol : uint8_t +{ + LOGS_TRANSFER_PROTOCOL_RESPONSE_PAYLOAD = 0x00, + LOGS_TRANSFER_PROTOCOL_BDX = 0x01, +}; + +namespace Commands { +namespace RetrieveLogsRequest { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace RetrieveLogsRequest + +namespace RetrieveLogsResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace RetrieveLogsResponse + +} // namespace Commands +} // namespace DiagnosticLogs +namespace GeneralDiagnostics { +// Enum for BootReasonType +enum class BootReasonType : uint8_t +{ + BOOT_REASON_TYPE_UNSPECIFIED = 0x00, + BOOT_REASON_TYPE_POWER_ON_REBOOT = 0x01, + BOOT_REASON_TYPE_BROWN_OUT_RESET = 0x02, + BOOT_REASON_TYPE_SOFTWARE_WATCHDOG_RESET = 0x03, + BOOT_REASON_TYPE_HARDWARE_WATCHDOG_RESET = 0x04, + BOOT_REASON_TYPE_SOFTWARE_UPDATE_COMPLETED = 0x05, + BOOT_REASON_TYPE_SOFTWARE_RESET = 0x06, +}; +// Enum for HardwareFaultType +enum class HardwareFaultType : uint8_t +{ + HARDWARE_FAULT_TYPE_UNSPECIFIED = 0x00, + HARDWARE_FAULT_TYPE_RADIO = 0x01, + HARDWARE_FAULT_TYPE_SENSOR = 0x02, + HARDWARE_FAULT_TYPE_RESETTABLE_OVER_TEMP = 0x03, + HARDWARE_FAULT_TYPE_NON_RESETTABLE_OVER_TEMP = 0x04, + HARDWARE_FAULT_TYPE_POWER_SOURCE = 0x05, + HARDWARE_FAULT_TYPE_VISUAL_DISPLAY_FAULT = 0x06, + HARDWARE_FAULT_TYPE_AUDIO_OUTPUT_FAULT = 0x07, + HARDWARE_FAULT_TYPE_USER_INTERFACE_FAULT = 0x08, + HARDWARE_FAULT_TYPE_NON_VOLATILE_MEMORY_ERROR = 0x09, + HARDWARE_FAULT_TYPE_TAMPER_DETECTED = 0x0A, +}; +// Enum for InterfaceType +enum class InterfaceType : uint8_t +{ + INTERFACE_TYPE_UNSPECIFIED = 0x00, + INTERFACE_TYPE_WI_FI = 0x01, + INTERFACE_TYPE_ETHERNET = 0x02, + INTERFACE_TYPE_CELLULAR = 0x03, + INTERFACE_TYPE_THREAD = 0x04, +}; +// Enum for NetworkFaultType +enum class NetworkFaultType : uint8_t +{ + NETWORK_FAULT_TYPE_UNSPECIFIED = 0x00, + NETWORK_FAULT_TYPE_HARDWARE_FAILURE = 0x01, + NETWORK_FAULT_TYPE_NETWORK_JAMMED = 0x02, + NETWORK_FAULT_TYPE_CONNECTION_FAILED = 0x03, +}; +// Enum for RadioFaultType +enum class RadioFaultType : uint8_t +{ + RADIO_FAULT_TYPE_UNSPECIFIED = 0x00, + RADIO_FAULT_TYPE_WI_FI_FAULT = 0x01, + RADIO_FAULT_TYPE_CELLULAR_FAULT = 0x02, + RADIO_FAULT_TYPE_THREAD_FAULT = 0x03, + RADIO_FAULT_TYPE_NFC_FAULT = 0x04, + RADIO_FAULT_TYPE_BLE_FAULT = 0x05, + RADIO_FAULT_TYPE_ETHERNET_FAULT = 0x06, +}; + +namespace NetworkInterfaceType { +enum FieldId +{ + kNameFieldId = 0, + kFabricConnectedFieldId = 1, + kOffPremiseServicesReachableIPv4FieldId = 2, + kOffPremiseServicesReachableIPv6FieldId = 3, + kHardwareAddressFieldId = 4, + kTypeFieldId = 5, +}; + +struct Type +{ +public: + chip::ByteSpan name; + bool fabricConnected; + bool offPremiseServicesReachableIPv4; + bool offPremiseServicesReachableIPv6; + chip::ByteSpan hardwareAddress; + InterfaceType type; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, uint64_t tag) const; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; + +} // namespace NetworkInterfaceType + +} // namespace GeneralDiagnostics +namespace SoftwareDiagnostics { + +namespace ThreadMetrics { +enum FieldId +{ + kIdFieldId = 0, + kNameFieldId = 1, + kStackFreeCurrentFieldId = 2, + kStackFreeMinimumFieldId = 3, + kStackSizeFieldId = 4, +}; + +struct Type +{ +public: + uint64_t id; + chip::ByteSpan name; + uint32_t stackFreeCurrent; + uint32_t stackFreeMinimum; + uint32_t stackSize; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, uint64_t tag) const; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; + +} // namespace ThreadMetrics + +namespace Commands { +namespace ResetWatermarks { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ResetWatermarks + +} // namespace Commands +} // namespace SoftwareDiagnostics +namespace ThreadNetworkDiagnostics { +// Enum for NetworkFault +enum class NetworkFault : uint8_t +{ + NETWORK_FAULT_UNSPECIFIED = 0x00, + NETWORK_FAULT_LINK_DOWN = 0x01, + NETWORK_FAULT_HARDWARE_FAILURE = 0x02, + NETWORK_FAULT_NETWORK_JAMMED = 0x03, +}; +// Enum for RoutingRole +enum class RoutingRole : uint8_t +{ + ROUTING_ROLE_UNSPECIFIED = 0x00, + ROUTING_ROLE_UNASSIGNED = 0x01, + ROUTING_ROLE_SLEEPY_END_DEVICE = 0x02, + ROUTING_ROLE_END_DEVICE = 0x03, + ROUTING_ROLE_REED = 0x04, + ROUTING_ROLE_ROUTER = 0x05, + ROUTING_ROLE_LEADER = 0x06, +}; + +namespace NeighborTable { +enum FieldId +{ + kExtAddressFieldId = 0, + kAgeFieldId = 1, + kRloc16FieldId = 2, + kLinkFrameCounterFieldId = 3, + kMleFrameCounterFieldId = 4, + kLqiFieldId = 5, + kAverageRssiFieldId = 6, + kLastRssiFieldId = 7, + kFrameErrorRateFieldId = 8, + kMessageErrorRateFieldId = 9, + kRxOnWhenIdleFieldId = 10, + kFullThreadDeviceFieldId = 11, + kFullNetworkDataFieldId = 12, + kIsChildFieldId = 13, +}; + +struct Type +{ +public: + uint64_t extAddress; + uint32_t age; + uint16_t rloc16; + uint32_t linkFrameCounter; + uint32_t mleFrameCounter; + uint8_t lqi; + int8_t averageRssi; + int8_t lastRssi; + uint8_t frameErrorRate; + uint8_t messageErrorRate; + bool rxOnWhenIdle; + bool fullThreadDevice; + bool fullNetworkData; + bool isChild; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, uint64_t tag) const; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; + +} // namespace NeighborTable +namespace OperationalDatasetComponents { +enum FieldId +{ + kActiveTimestampPresentFieldId = 0, + kPendingTimestampPresentFieldId = 1, + kMasterKeyPresentFieldId = 2, + kNetworkNamePresentFieldId = 3, + kExtendedPanIdPresentFieldId = 4, + kMeshLocalPrefixPresentFieldId = 5, + kDelayPresentFieldId = 6, + kPanIdPresentFieldId = 7, + kChannelPresentFieldId = 8, + kPskcPresentFieldId = 9, + kSecurityPolicyPresentFieldId = 10, + kChannelMaskPresentFieldId = 11, +}; + +struct Type +{ +public: + bool activeTimestampPresent; + bool pendingTimestampPresent; + bool masterKeyPresent; + bool networkNamePresent; + bool extendedPanIdPresent; + bool meshLocalPrefixPresent; + bool delayPresent; + bool panIdPresent; + bool channelPresent; + bool pskcPresent; + bool securityPolicyPresent; + bool channelMaskPresent; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, uint64_t tag) const; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; + +} // namespace OperationalDatasetComponents +namespace RouteTable { +enum FieldId +{ + kExtAddressFieldId = 0, + kRloc16FieldId = 1, + kRouterIdFieldId = 2, + kNextHopFieldId = 3, + kPathCostFieldId = 4, + kLQIInFieldId = 5, + kLQIOutFieldId = 6, + kAgeFieldId = 7, + kAllocatedFieldId = 8, + kLinkEstablishedFieldId = 9, +}; + +struct Type +{ +public: + uint64_t extAddress; + uint16_t rloc16; + uint8_t routerId; + uint8_t nextHop; + uint8_t pathCost; + uint8_t lQIIn; + uint8_t lQIOut; + uint8_t age; + bool allocated; + bool linkEstablished; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, uint64_t tag) const; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; + +} // namespace RouteTable +namespace SecurityPolicy { +enum FieldId +{ + kRotationTimeFieldId = 0, + kFlagsFieldId = 1, +}; + +struct Type +{ +public: + uint16_t rotationTime; + uint16_t flags; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, uint64_t tag) const; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; + +} // namespace SecurityPolicy + +namespace Commands { +namespace ResetCounts { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ResetCounts + +} // namespace Commands +} // namespace ThreadNetworkDiagnostics +namespace WiFiNetworkDiagnostics { +// Enum for SecurityType +enum class SecurityType : uint8_t +{ + SECURITY_TYPE_UNSPECIFIED = 0x00, + SECURITY_TYPE_NONE = 0x01, + SECURITY_TYPE_WEP = 0x02, + SECURITY_TYPE_WPA = 0x03, + SECURITY_TYPE_WPA2 = 0x04, + SECURITY_TYPE_WPA3 = 0x05, +}; +// Enum for WiFiVersionType +enum class WiFiVersionType : uint8_t +{ + WI_FI_VERSION_TYPE_802__11A = 0x00, + WI_FI_VERSION_TYPE_802__11B = 0x01, + WI_FI_VERSION_TYPE_802__11G = 0x02, + WI_FI_VERSION_TYPE_802__11N = 0x03, + WI_FI_VERSION_TYPE_802__11AC = 0x04, + WI_FI_VERSION_TYPE_802__11AX = 0x05, +}; + +namespace Commands { +namespace ResetCounts { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ResetCounts + +} // namespace Commands +} // namespace WiFiNetworkDiagnostics +namespace EthernetNetworkDiagnostics { +// Enum for PHYRateType +enum class PHYRateType : uint8_t +{ + PHY_RATE_TYPE_10_M = 0x00, + PHY_RATE_TYPE_100_M = 0x01, + PHY_RATE_TYPE_1000_M = 0x02, + PHY_RATE_TYPE_2__5_G = 0x03, + PHY_RATE_TYPE_5_G = 0x04, + PHY_RATE_TYPE_10_G = 0x05, + PHY_RATE_TYPE_40_G = 0x06, + PHY_RATE_TYPE_100_G = 0x07, + PHY_RATE_TYPE_200_G = 0x08, + PHY_RATE_TYPE_400_G = 0x09, +}; + +namespace Commands { +namespace ResetCounts { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ResetCounts + +} // namespace Commands +} // namespace EthernetNetworkDiagnostics +namespace BridgedDeviceBasic { + +namespace Commands { +namespace StartUp { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace StartUp + +namespace ShutDown { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ShutDown + +namespace Leave { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace Leave + +namespace ReachableChanged { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ReachableChanged + +} // namespace Commands +} // namespace BridgedDeviceBasic +namespace Switch { + +} // namespace Switch +namespace AdministratorCommissioning { +// Enum for StatusCode +enum class StatusCode : uint8_t +{ + STATUS_CODE_SUCCESS = 0x00, + STATUS_CODE_BUSY = 0x01, + STATUS_CODE_GENERAL_ERROR = 0x02, +}; + +namespace Commands { +namespace OpenCommissioningWindow { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace OpenCommissioningWindow + +namespace OpenBasicCommissioningWindow { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace OpenBasicCommissioningWindow + +namespace RevokeCommissioning { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace RevokeCommissioning + +} // namespace Commands +} // namespace AdministratorCommissioning +namespace OperationalCredentials { +// Enum for NodeOperationalCertStatus +enum class NodeOperationalCertStatus : uint8_t +{ + NODE_OPERATIONAL_CERT_STATUS_SUCCESS = 0x00, + NODE_OPERATIONAL_CERT_STATUS_INVALID_PUBLIC_KEY = 0x01, + NODE_OPERATIONAL_CERT_STATUS_INVALID_NODE_OP_ID = 0x02, + NODE_OPERATIONAL_CERT_STATUS_INVALID_NOC = 0x03, + NODE_OPERATIONAL_CERT_STATUS_MISSING_CSR = 0x04, + NODE_OPERATIONAL_CERT_STATUS_TABLE_FULL = 0x05, + NODE_OPERATIONAL_CERT_STATUS_INSUFFICIENT_PRIVILEGE = 0x08, + NODE_OPERATIONAL_CERT_STATUS_FABRIC_CONFLICT = 0x09, + NODE_OPERATIONAL_CERT_STATUS_LABEL_CONFLICT = 0x0A, + NODE_OPERATIONAL_CERT_STATUS_INVALID_FABRIC_INDEX = 0x0B, +}; + +namespace FabricDescriptor { +enum FieldId +{ + kFabricIndexFieldId = 0, + kRootPublicKeyFieldId = 1, + kVendorIdFieldId = 2, + kFabricIdFieldId = 3, + kNodeIdFieldId = 4, + kLabelFieldId = 5, +}; + +struct Type +{ +public: + uint8_t fabricIndex; + chip::ByteSpan rootPublicKey; + uint16_t vendorId; + uint64_t fabricId; + uint64_t nodeId; + chip::ByteSpan label; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, uint64_t tag) const; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; + +} // namespace FabricDescriptor +namespace NOCStruct { +enum FieldId +{ + kFabricIndexFieldId = 0, + kNocFieldId = 1, +}; + +struct Type +{ +public: + uint8_t fabricIndex; + chip::ByteSpan noc; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, uint64_t tag) const; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; + +} // namespace NOCStruct + +namespace Commands { +namespace AttestationRequest { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace AttestationRequest + +namespace AttestationResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace AttestationResponse + +namespace CertificateChainRequest { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace CertificateChainRequest + +namespace CertificateChainResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace CertificateChainResponse + +namespace OpCSRRequest { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace OpCSRRequest + +namespace OpCSRResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace OpCSRResponse + +namespace AddNOC { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace AddNOC + +namespace UpdateNOC { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace UpdateNOC + +namespace NOCResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace NOCResponse + +namespace UpdateFabricLabel { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace UpdateFabricLabel + +namespace RemoveFabric { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace RemoveFabric + +namespace AddTrustedRootCertificate { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace AddTrustedRootCertificate + +namespace RemoveTrustedRootCertificate { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace RemoveTrustedRootCertificate + +} // namespace Commands +} // namespace OperationalCredentials +namespace FixedLabel { + +namespace LabelStruct { +enum FieldId +{ + kLabelFieldId = 0, + kValueFieldId = 1, +}; + +struct Type +{ +public: + chip::ByteSpan label; + chip::ByteSpan value; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, uint64_t tag) const; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; + +} // namespace LabelStruct + +} // namespace FixedLabel +namespace ShadeConfiguration { + +} // namespace ShadeConfiguration +namespace DoorLock { + +namespace Commands { +namespace LockDoor { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace LockDoor + +namespace LockDoorResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace LockDoorResponse + +namespace UnlockDoor { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace UnlockDoor + +namespace UnlockDoorResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace UnlockDoorResponse + +namespace Toggle { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace Toggle + +namespace ToggleResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ToggleResponse + +namespace UnlockWithTimeout { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace UnlockWithTimeout + +namespace UnlockWithTimeoutResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace UnlockWithTimeoutResponse + +namespace GetLogRecord { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetLogRecord + +namespace GetLogRecordResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetLogRecordResponse + +namespace SetPin { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace SetPin + +namespace SetPinResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace SetPinResponse + +namespace GetPin { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetPin + +namespace GetPinResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetPinResponse + +namespace ClearPin { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ClearPin + +namespace ClearPinResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ClearPinResponse + +namespace ClearAllPins { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ClearAllPins + +namespace ClearAllPinsResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ClearAllPinsResponse + +namespace SetUserStatus { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace SetUserStatus + +namespace SetUserStatusResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace SetUserStatusResponse + +namespace GetUserStatus { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetUserStatus + +namespace GetUserStatusResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetUserStatusResponse + +namespace SetWeekdaySchedule { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace SetWeekdaySchedule + +namespace SetWeekdayScheduleResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace SetWeekdayScheduleResponse + +namespace GetWeekdaySchedule { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetWeekdaySchedule + +namespace GetWeekdayScheduleResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetWeekdayScheduleResponse + +namespace ClearWeekdaySchedule { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ClearWeekdaySchedule + +namespace ClearWeekdayScheduleResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ClearWeekdayScheduleResponse + +namespace SetYeardaySchedule { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace SetYeardaySchedule + +namespace SetYeardayScheduleResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace SetYeardayScheduleResponse + +namespace GetYeardaySchedule { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetYeardaySchedule + +namespace GetYeardayScheduleResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetYeardayScheduleResponse + +namespace ClearYeardaySchedule { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ClearYeardaySchedule + +namespace ClearYeardayScheduleResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ClearYeardayScheduleResponse + +namespace SetHolidaySchedule { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace SetHolidaySchedule + +namespace SetHolidayScheduleResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace SetHolidayScheduleResponse + +namespace GetHolidaySchedule { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetHolidaySchedule + +namespace GetHolidayScheduleResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetHolidayScheduleResponse + +namespace ClearHolidaySchedule { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ClearHolidaySchedule + +namespace ClearHolidayScheduleResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ClearHolidayScheduleResponse + +namespace SetUserType { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace SetUserType + +namespace SetUserTypeResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace SetUserTypeResponse + +namespace GetUserType { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetUserType + +namespace GetUserTypeResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetUserTypeResponse + +namespace SetRfid { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace SetRfid + +namespace SetRfidResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace SetRfidResponse + +namespace GetRfid { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetRfid + +namespace GetRfidResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetRfidResponse + +namespace ClearRfid { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ClearRfid + +namespace ClearRfidResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ClearRfidResponse + +namespace ClearAllRfids { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ClearAllRfids + +namespace ClearAllRfidsResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ClearAllRfidsResponse + +namespace OperationEventNotification { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace OperationEventNotification + +namespace ProgrammingEventNotification { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ProgrammingEventNotification + +} // namespace Commands +} // namespace DoorLock +namespace WindowCovering { +// Enum for WcEndProductType +enum class WcEndProductType : uint8_t +{ + WC_END_PRODUCT_TYPE_ROLLER_SHADE = 0x00, + WC_END_PRODUCT_TYPE_ROMAN_SHADE = 0x01, + WC_END_PRODUCT_TYPE_BALLOON_SHADE = 0x02, + WC_END_PRODUCT_TYPE_WOVEN_WOOD = 0x03, + WC_END_PRODUCT_TYPE_PLEATED_SHADE = 0x04, + WC_END_PRODUCT_TYPE_CELLULAR_SHADE = 0x05, + WC_END_PRODUCT_TYPE_LAYERED_SHADE = 0x06, + WC_END_PRODUCT_TYPE_LAYERED_SHADE2_D = 0x07, + WC_END_PRODUCT_TYPE_SHEER_SHADE = 0x08, + WC_END_PRODUCT_TYPE_TILT_ONLY_INTERIOR_BLIND = 0x09, + WC_END_PRODUCT_TYPE_INTERIOR_BLIND = 0x0A, + WC_END_PRODUCT_TYPE_VERTICAL_BLIND_STRIP_CURTAIN = 0x0B, + WC_END_PRODUCT_TYPE_INTERIOR_VENETIAN_BLIND = 0x0C, + WC_END_PRODUCT_TYPE_EXTERIOR_VENETIAN_BLIND = 0x0D, + WC_END_PRODUCT_TYPE_LATERAL_LEFT_CURTAIN = 0x0E, + WC_END_PRODUCT_TYPE_LATERAL_RIGHT_CURTAIN = 0x0F, + WC_END_PRODUCT_TYPE_CENTRAL_CURTAIN = 0x10, + WC_END_PRODUCT_TYPE_ROLLER_SHUTTER = 0x11, + WC_END_PRODUCT_TYPE_EXTERIOR_VERTICAL_SCREEN = 0x12, + WC_END_PRODUCT_TYPE_AWNING_TERRACE_PATIO = 0x13, + WC_END_PRODUCT_TYPE_AWNING_VERTICAL_SCREEN = 0x14, + WC_END_PRODUCT_TYPE_TILT_ONLY_PERGOLA = 0x15, + WC_END_PRODUCT_TYPE_SWINGING_SHUTTER = 0x16, + WC_END_PRODUCT_TYPE_SLIDING_SHUTTER = 0x17, + WC_END_PRODUCT_TYPE_UNKNOWN = 0xFF, +}; +// Enum for WcType +enum class WcType : uint8_t +{ + WC_TYPE_ROLLERSHADE = 0x00, + WC_TYPE_ROLLERSHADE2_MOTOR = 0x01, + WC_TYPE_ROLLERSHADE_EXTERIOR = 0x02, + WC_TYPE_ROLLERSHADE_EXTERIOR2_MOTOR = 0x03, + WC_TYPE_DRAPERY = 0x04, + WC_TYPE_AWNING = 0x05, + WC_TYPE_SHUTTER = 0x06, + WC_TYPE_TILT_BLIND_TILT_ONLY = 0x07, + WC_TYPE_TILT_BLIND_LIFT_AND_TILT = 0x08, + WC_TYPE_PROJECTOR_SCREEN = 0x09, + WC_TYPE_UNKNOWN = 0xFF, +}; + +namespace Commands { +namespace UpOrOpen { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace UpOrOpen + +namespace DownOrClose { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace DownOrClose + +namespace StopMotion { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace StopMotion + +namespace GoToLiftValue { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GoToLiftValue + +namespace GoToLiftPercentage { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GoToLiftPercentage + +namespace GoToTiltValue { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GoToTiltValue + +namespace GoToTiltPercentage { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GoToTiltPercentage + +} // namespace Commands +} // namespace WindowCovering +namespace BarrierControl { + +namespace Commands { +namespace BarrierControlGoToPercent { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace BarrierControlGoToPercent + +namespace BarrierControlStop { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace BarrierControlStop + +} // namespace Commands +} // namespace BarrierControl +namespace PumpConfigurationAndControl { +// Enum for PumpControlMode +enum class PumpControlMode : uint8_t +{ + PUMP_CONTROL_MODE_CONSTANT_SPEED = 0x00, + PUMP_CONTROL_MODE_CONSTANT_PRESSURE = 0x01, + PUMP_CONTROL_MODE_PROPORTIONAL_PRESSURE = 0x02, + PUMP_CONTROL_MODE_CONSTANT_FLOW = 0x03, + PUMP_CONTROL_MODE_CONSTANT_TEMPERATURE = 0x05, + PUMP_CONTROL_MODE_AUTOMATIC = 0x07, +}; +// Enum for PumpOperationMode +enum class PumpOperationMode : uint8_t +{ + PUMP_OPERATION_MODE_NORMAL = 0x00, + PUMP_OPERATION_MODE_MINIMUM = 0x01, + PUMP_OPERATION_MODE_MAXIMUM = 0x02, + PUMP_OPERATION_MODE_LOCAL = 0x03, +}; + +} // namespace PumpConfigurationAndControl +namespace Thermostat { + +namespace Commands { +namespace SetpointRaiseLower { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace SetpointRaiseLower + +namespace CurrentWeeklySchedule { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace CurrentWeeklySchedule + +namespace SetWeeklySchedule { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace SetWeeklySchedule + +namespace RelayStatusLog { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace RelayStatusLog + +namespace GetWeeklySchedule { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetWeeklySchedule + +namespace ClearWeeklySchedule { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ClearWeeklySchedule + +namespace GetRelayStatusLog { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetRelayStatusLog + +} // namespace Commands +} // namespace Thermostat +namespace FanControl { + +} // namespace FanControl +namespace DehumidificationControl { + +} // namespace DehumidificationControl +namespace ThermostatUserInterfaceConfiguration { + +} // namespace ThermostatUserInterfaceConfiguration +namespace ColorControl { + +namespace Commands { +namespace MoveToHue { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace MoveToHue + +namespace MoveHue { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace MoveHue + +namespace StepHue { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace StepHue + +namespace MoveToSaturation { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace MoveToSaturation + +namespace MoveSaturation { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace MoveSaturation + +namespace StepSaturation { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace StepSaturation + +namespace MoveToHueAndSaturation { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace MoveToHueAndSaturation + +namespace MoveToColor { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace MoveToColor + +namespace MoveColor { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace MoveColor + +namespace StepColor { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace StepColor + +namespace MoveToColorTemperature { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace MoveToColorTemperature + +namespace EnhancedMoveToHue { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace EnhancedMoveToHue + +namespace EnhancedMoveHue { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace EnhancedMoveHue + +namespace EnhancedStepHue { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace EnhancedStepHue + +namespace EnhancedMoveToHueAndSaturation { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace EnhancedMoveToHueAndSaturation + +namespace ColorLoopSet { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ColorLoopSet + +namespace StopMoveStep { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace StopMoveStep + +namespace MoveColorTemperature { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace MoveColorTemperature + +namespace StepColorTemperature { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace StepColorTemperature + +} // namespace Commands +} // namespace ColorControl +namespace BallastConfiguration { + +} // namespace BallastConfiguration +namespace IlluminanceMeasurement { + +} // namespace IlluminanceMeasurement +namespace IlluminanceLevelSensing { + +} // namespace IlluminanceLevelSensing +namespace TemperatureMeasurement { + +} // namespace TemperatureMeasurement +namespace PressureMeasurement { + +} // namespace PressureMeasurement +namespace FlowMeasurement { + +} // namespace FlowMeasurement +namespace RelativeHumidityMeasurement { + +} // namespace RelativeHumidityMeasurement +namespace OccupancySensing { + +} // namespace OccupancySensing namespace CarbonMonoxideConcentrationMeasurement { -} // namespace CarbonMonoxideConcentrationMeasurement -namespace CarbonDioxideConcentrationMeasurement { +} // namespace CarbonMonoxideConcentrationMeasurement +namespace CarbonDioxideConcentrationMeasurement { + +} // namespace CarbonDioxideConcentrationMeasurement +namespace EthyleneConcentrationMeasurement { + +} // namespace EthyleneConcentrationMeasurement +namespace EthyleneOxideConcentrationMeasurement { + +} // namespace EthyleneOxideConcentrationMeasurement +namespace HydrogenConcentrationMeasurement { + +} // namespace HydrogenConcentrationMeasurement +namespace HydrogenSulphideConcentrationMeasurement { + +} // namespace HydrogenSulphideConcentrationMeasurement +namespace NitricOxideConcentrationMeasurement { + +} // namespace NitricOxideConcentrationMeasurement +namespace NitrogenDioxideConcentrationMeasurement { + +} // namespace NitrogenDioxideConcentrationMeasurement +namespace OxygenConcentrationMeasurement { + +} // namespace OxygenConcentrationMeasurement +namespace OzoneConcentrationMeasurement { + +} // namespace OzoneConcentrationMeasurement +namespace SulfurDioxideConcentrationMeasurement { + +} // namespace SulfurDioxideConcentrationMeasurement +namespace DissolvedOxygenConcentrationMeasurement { + +} // namespace DissolvedOxygenConcentrationMeasurement +namespace BromateConcentrationMeasurement { + +} // namespace BromateConcentrationMeasurement +namespace ChloraminesConcentrationMeasurement { + +} // namespace ChloraminesConcentrationMeasurement +namespace ChlorineConcentrationMeasurement { + +} // namespace ChlorineConcentrationMeasurement +namespace FecalColiformAndEColiConcentrationMeasurement { + +} // namespace FecalColiformAndEColiConcentrationMeasurement +namespace FluorideConcentrationMeasurement { + +} // namespace FluorideConcentrationMeasurement +namespace HaloaceticAcidsConcentrationMeasurement { + +} // namespace HaloaceticAcidsConcentrationMeasurement +namespace TotalTrihalomethanesConcentrationMeasurement { + +} // namespace TotalTrihalomethanesConcentrationMeasurement +namespace TotalColiformBacteriaConcentrationMeasurement { + +} // namespace TotalColiformBacteriaConcentrationMeasurement +namespace TurbidityConcentrationMeasurement { + +} // namespace TurbidityConcentrationMeasurement +namespace CopperConcentrationMeasurement { + +} // namespace CopperConcentrationMeasurement +namespace LeadConcentrationMeasurement { + +} // namespace LeadConcentrationMeasurement +namespace ManganeseConcentrationMeasurement { + +} // namespace ManganeseConcentrationMeasurement +namespace SulfateConcentrationMeasurement { + +} // namespace SulfateConcentrationMeasurement +namespace BromodichloromethaneConcentrationMeasurement { + +} // namespace BromodichloromethaneConcentrationMeasurement +namespace BromoformConcentrationMeasurement { + +} // namespace BromoformConcentrationMeasurement +namespace ChlorodibromomethaneConcentrationMeasurement { + +} // namespace ChlorodibromomethaneConcentrationMeasurement +namespace ChloroformConcentrationMeasurement { + +} // namespace ChloroformConcentrationMeasurement +namespace SodiumConcentrationMeasurement { + +} // namespace SodiumConcentrationMeasurement +namespace IasZone { + +namespace Commands { +namespace ZoneEnrollResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ZoneEnrollResponse + +namespace ZoneStatusChangeNotification { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ZoneStatusChangeNotification + +namespace InitiateNormalOperationMode { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace InitiateNormalOperationMode + +namespace ZoneEnrollRequest { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ZoneEnrollRequest + +namespace InitiateTestMode { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace InitiateTestMode + +namespace InitiateNormalOperationModeResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace InitiateNormalOperationModeResponse + +namespace InitiateTestModeResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace InitiateTestModeResponse + +} // namespace Commands +} // namespace IasZone +namespace IasAce { + +namespace Commands { +namespace Arm { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace Arm + +namespace ArmResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ArmResponse + +namespace Bypass { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace Bypass + +namespace GetZoneIdMapResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetZoneIdMapResponse + +namespace Emergency { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace Emergency + +namespace GetZoneInformationResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetZoneInformationResponse + +namespace Fire { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace Fire + +namespace ZoneStatusChanged { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ZoneStatusChanged + +namespace Panic { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace Panic + +namespace PanelStatusChanged { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace PanelStatusChanged + +namespace GetZoneIdMap { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetZoneIdMap + +namespace GetPanelStatusResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetPanelStatusResponse + +namespace GetZoneInformation { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetZoneInformation + +namespace SetBypassedZoneList { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace SetBypassedZoneList + +namespace GetPanelStatus { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetPanelStatus + +namespace BypassResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace BypassResponse + +namespace GetBypassedZoneList { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetBypassedZoneList + +namespace GetZoneStatusResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetZoneStatusResponse + +namespace GetZoneStatus { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetZoneStatus + +} // namespace Commands +} // namespace IasAce +namespace IasWd { + +namespace Commands { +namespace StartWarning { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace StartWarning + +namespace Squawk { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace Squawk + +} // namespace Commands +} // namespace IasWd +namespace WakeOnLan { + +} // namespace WakeOnLan +namespace TvChannel { +// Enum for TvChannelErrorType +enum class TvChannelErrorType : uint8_t +{ + TV_CHANNEL_ERROR_TYPE_MULTIPLE_MATCHES = 0x00, + TV_CHANNEL_ERROR_TYPE_NO_MATCHES = 0x01, +}; +// Enum for TvChannelLineupInfoType +enum class TvChannelLineupInfoType : uint8_t +{ + TV_CHANNEL_LINEUP_INFO_TYPE_MSO = 0x00, +}; + +namespace TvChannelInfo { +enum FieldId +{ + kMajorNumberFieldId = 0, + kMinorNumberFieldId = 1, + kNameFieldId = 2, + kCallSignFieldId = 3, + kAffiliateCallSignFieldId = 4, +}; + +struct Type +{ +public: + uint16_t majorNumber; + uint16_t minorNumber; + chip::ByteSpan name; + chip::ByteSpan callSign; + chip::ByteSpan affiliateCallSign; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, uint64_t tag) const; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; + +} // namespace TvChannelInfo +namespace TvChannelLineupInfo { +enum FieldId +{ + kOperatorNameFieldId = 0, + kLineupNameFieldId = 1, + kPostalCodeFieldId = 2, + kLineupInfoTypeFieldId = 3, +}; + +struct Type +{ +public: + Span operatorName; + Span lineupName; + Span postalCode; + TvChannelLineupInfoType lineupInfoType; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, uint64_t tag) const; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; + +} // namespace TvChannelLineupInfo + +namespace Commands { +namespace ChangeChannel { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ChangeChannel + +namespace ChangeChannelResponse { +struct Type +{ +}; -} // namespace CarbonDioxideConcentrationMeasurement -namespace EthyleneConcentrationMeasurement { +struct DecodableType +{ +}; +} // namespace ChangeChannelResponse -} // namespace EthyleneConcentrationMeasurement -namespace EthyleneOxideConcentrationMeasurement { +namespace ChangeChannelByNumber { +struct Type +{ +}; -} // namespace EthyleneOxideConcentrationMeasurement -namespace HydrogenConcentrationMeasurement { +struct DecodableType +{ +}; +} // namespace ChangeChannelByNumber -} // namespace HydrogenConcentrationMeasurement -namespace HydrogenSulphideConcentrationMeasurement { +namespace SkipChannel { +struct Type +{ +}; -} // namespace HydrogenSulphideConcentrationMeasurement -namespace NitricOxideConcentrationMeasurement { +struct DecodableType +{ +}; +} // namespace SkipChannel -} // namespace NitricOxideConcentrationMeasurement -namespace NitrogenDioxideConcentrationMeasurement { +} // namespace Commands +} // namespace TvChannel +namespace TargetNavigator { +// Enum for NavigateTargetStatus +enum class NavigateTargetStatus : uint8_t +{ + NAVIGATE_TARGET_STATUS_SUCCESS = 0x00, + NAVIGATE_TARGET_STATUS_APP_NOT_AVAILABLE = 0x01, + NAVIGATE_TARGET_STATUS_SYSTEM_BUSY = 0x02, +}; -} // namespace NitrogenDioxideConcentrationMeasurement -namespace OxygenConcentrationMeasurement { +namespace NavigateTargetTargetInfo { +enum FieldId +{ + kIdentifierFieldId = 0, + kNameFieldId = 1, +}; -} // namespace OxygenConcentrationMeasurement -namespace OzoneConcentrationMeasurement { +struct Type +{ +public: + uint8_t identifier; + chip::ByteSpan name; -} // namespace OzoneConcentrationMeasurement -namespace SulfurDioxideConcentrationMeasurement { + CHIP_ERROR Encode(TLV::TLVWriter & writer, uint64_t tag) const; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; -} // namespace SulfurDioxideConcentrationMeasurement -namespace DissolvedOxygenConcentrationMeasurement { +} // namespace NavigateTargetTargetInfo -} // namespace DissolvedOxygenConcentrationMeasurement -namespace BromateConcentrationMeasurement { +namespace Commands { +namespace NavigateTarget { +struct Type +{ +}; -} // namespace BromateConcentrationMeasurement -namespace ChloraminesConcentrationMeasurement { +struct DecodableType +{ +}; +} // namespace NavigateTarget -} // namespace ChloraminesConcentrationMeasurement -namespace ChlorineConcentrationMeasurement { +namespace NavigateTargetResponse { +struct Type +{ +}; -} // namespace ChlorineConcentrationMeasurement -namespace FecalColiformAndEColiConcentrationMeasurement { +struct DecodableType +{ +}; +} // namespace NavigateTargetResponse -} // namespace FecalColiformAndEColiConcentrationMeasurement -namespace FluorideConcentrationMeasurement { +} // namespace Commands +} // namespace TargetNavigator +namespace MediaPlayback { +// Enum for MediaPlaybackState +enum class MediaPlaybackState : uint8_t +{ + MEDIA_PLAYBACK_STATE_PLAYING = 0x00, + MEDIA_PLAYBACK_STATE_PAUSED = 0x01, + MEDIA_PLAYBACK_STATE_NOT_PLAYING = 0x02, + MEDIA_PLAYBACK_STATE_BUFFERING = 0x03, +}; +// Enum for MediaPlaybackStatus +enum class MediaPlaybackStatus : uint8_t +{ + MEDIA_PLAYBACK_STATUS_SUCCESS = 0x00, + MEDIA_PLAYBACK_STATUS_INVALID_STATE_FOR_COMMAND = 0x01, + MEDIA_PLAYBACK_STATUS_NOT_ALLOWED = 0x02, + MEDIA_PLAYBACK_STATUS_NOT_ACTIVE = 0x03, + MEDIA_PLAYBACK_STATUS_SPEED_OUT_OF_RANGE = 0x04, + MEDIA_PLAYBACK_STATUS_SEEK_OUT_OF_RANGE = 0x05, +}; -} // namespace FluorideConcentrationMeasurement -namespace HaloaceticAcidsConcentrationMeasurement { +namespace MediaPlaybackPosition { +enum FieldId +{ + kUpdatedAtFieldId = 0, + kPositionFieldId = 1, +}; -} // namespace HaloaceticAcidsConcentrationMeasurement -namespace TotalTrihalomethanesConcentrationMeasurement { +struct Type +{ +public: + uint64_t updatedAt; + uint64_t position; -} // namespace TotalTrihalomethanesConcentrationMeasurement -namespace TotalColiformBacteriaConcentrationMeasurement { + CHIP_ERROR Encode(TLV::TLVWriter & writer, uint64_t tag) const; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; -} // namespace TotalColiformBacteriaConcentrationMeasurement -namespace TurbidityConcentrationMeasurement { +} // namespace MediaPlaybackPosition -} // namespace TurbidityConcentrationMeasurement -namespace CopperConcentrationMeasurement { +namespace Commands { +namespace MediaPlay { +struct Type +{ +}; -} // namespace CopperConcentrationMeasurement -namespace LeadConcentrationMeasurement { +struct DecodableType +{ +}; +} // namespace MediaPlay -} // namespace LeadConcentrationMeasurement -namespace ManganeseConcentrationMeasurement { +namespace MediaPlayResponse { +struct Type +{ +}; -} // namespace ManganeseConcentrationMeasurement -namespace SulfateConcentrationMeasurement { +struct DecodableType +{ +}; +} // namespace MediaPlayResponse -} // namespace SulfateConcentrationMeasurement -namespace BromodichloromethaneConcentrationMeasurement { +namespace MediaPause { +struct Type +{ +}; -} // namespace BromodichloromethaneConcentrationMeasurement -namespace BromoformConcentrationMeasurement { +struct DecodableType +{ +}; +} // namespace MediaPause -} // namespace BromoformConcentrationMeasurement -namespace ChlorodibromomethaneConcentrationMeasurement { +namespace MediaPauseResponse { +struct Type +{ +}; -} // namespace ChlorodibromomethaneConcentrationMeasurement -namespace ChloroformConcentrationMeasurement { +struct DecodableType +{ +}; +} // namespace MediaPauseResponse -} // namespace ChloroformConcentrationMeasurement -namespace SodiumConcentrationMeasurement { +namespace MediaStop { +struct Type +{ +}; -} // namespace SodiumConcentrationMeasurement -namespace IasZone { +struct DecodableType +{ +}; +} // namespace MediaStop -} // namespace IasZone -namespace IasAce { +namespace MediaStopResponse { +struct Type +{ +}; -} // namespace IasAce -namespace IasWd { +struct DecodableType +{ +}; +} // namespace MediaStopResponse -} // namespace IasWd -namespace WakeOnLan { +namespace MediaStartOver { +struct Type +{ +}; -} // namespace WakeOnLan -namespace TvChannel { -// Enum for TvChannelErrorType -enum class TvChannelErrorType : uint8_t +struct DecodableType +{ +}; +} // namespace MediaStartOver + +namespace MediaStartOverResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace MediaStartOverResponse + +namespace MediaPrevious { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace MediaPrevious + +namespace MediaPreviousResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace MediaPreviousResponse + +namespace MediaNext { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace MediaNext + +namespace MediaNextResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace MediaNextResponse + +namespace MediaRewind { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace MediaRewind + +namespace MediaRewindResponse { +struct Type +{ +}; + +struct DecodableType { - TV_CHANNEL_ERROR_TYPE_MULTIPLE_MATCHES = 0x00, - TV_CHANNEL_ERROR_TYPE_NO_MATCHES = 0x01, }; -// Enum for TvChannelLineupInfoType -enum class TvChannelLineupInfoType : uint8_t +} // namespace MediaRewindResponse + +namespace MediaFastForward { +struct Type { - TV_CHANNEL_LINEUP_INFO_TYPE_MSO = 0x00, }; -namespace TvChannelInfo { -enum FieldId +struct DecodableType { - kMajorNumberFieldId = 0, - kMinorNumberFieldId = 1, - kNameFieldId = 2, - kCallSignFieldId = 3, - kAffiliateCallSignFieldId = 4, }; +} // namespace MediaFastForward +namespace MediaFastForwardResponse { struct Type { -public: - uint16_t majorNumber; - uint16_t minorNumber; - chip::ByteSpan name; - chip::ByteSpan callSign; - chip::ByteSpan affiliateCallSign; - - CHIP_ERROR Encode(TLV::TLVWriter & writer, uint64_t tag) const; - CHIP_ERROR Decode(TLV::TLVReader & reader); }; -} // namespace TvChannelInfo -namespace TvChannelLineupInfo { -enum FieldId +struct DecodableType { - kOperatorNameFieldId = 0, - kLineupNameFieldId = 1, - kPostalCodeFieldId = 2, - kLineupInfoTypeFieldId = 3, }; +} // namespace MediaFastForwardResponse +namespace MediaSkipForward { struct Type { -public: - Span operatorName; - Span lineupName; - Span postalCode; - TvChannelLineupInfoType lineupInfoType; - - CHIP_ERROR Encode(TLV::TLVWriter & writer, uint64_t tag) const; - CHIP_ERROR Decode(TLV::TLVReader & reader); }; -} // namespace TvChannelLineupInfo +struct DecodableType +{ +}; +} // namespace MediaSkipForward -} // namespace TvChannel -namespace TargetNavigator { -// Enum for NavigateTargetStatus -enum class NavigateTargetStatus : uint8_t +namespace MediaSkipForwardResponse { +struct Type { - NAVIGATE_TARGET_STATUS_SUCCESS = 0x00, - NAVIGATE_TARGET_STATUS_APP_NOT_AVAILABLE = 0x01, - NAVIGATE_TARGET_STATUS_SYSTEM_BUSY = 0x02, }; -namespace NavigateTargetTargetInfo { -enum FieldId +struct DecodableType { - kIdentifierFieldId = 0, - kNameFieldId = 1, }; +} // namespace MediaSkipForwardResponse +namespace MediaSkipBackward { struct Type { -public: - uint8_t identifier; - chip::ByteSpan name; +}; - CHIP_ERROR Encode(TLV::TLVWriter & writer, uint64_t tag) const; - CHIP_ERROR Decode(TLV::TLVReader & reader); +struct DecodableType +{ }; +} // namespace MediaSkipBackward -} // namespace NavigateTargetTargetInfo +namespace MediaSkipBackwardResponse { +struct Type +{ +}; -} // namespace TargetNavigator -namespace MediaPlayback { -// Enum for MediaPlaybackState -enum class MediaPlaybackState : uint8_t +struct DecodableType { - MEDIA_PLAYBACK_STATE_PLAYING = 0x00, - MEDIA_PLAYBACK_STATE_PAUSED = 0x01, - MEDIA_PLAYBACK_STATE_NOT_PLAYING = 0x02, - MEDIA_PLAYBACK_STATE_BUFFERING = 0x03, }; -// Enum for MediaPlaybackStatus -enum class MediaPlaybackStatus : uint8_t +} // namespace MediaSkipBackwardResponse + +namespace MediaSeek { +struct Type { - MEDIA_PLAYBACK_STATUS_SUCCESS = 0x00, - MEDIA_PLAYBACK_STATUS_INVALID_STATE_FOR_COMMAND = 0x01, - MEDIA_PLAYBACK_STATUS_NOT_ALLOWED = 0x02, - MEDIA_PLAYBACK_STATUS_NOT_ACTIVE = 0x03, - MEDIA_PLAYBACK_STATUS_SPEED_OUT_OF_RANGE = 0x04, - MEDIA_PLAYBACK_STATUS_SEEK_OUT_OF_RANGE = 0x05, }; -namespace MediaPlaybackPosition { -enum FieldId +struct DecodableType { - kUpdatedAtFieldId = 0, - kPositionFieldId = 1, }; +} // namespace MediaSeek +namespace MediaSeekResponse { struct Type { -public: - uint64_t updatedAt; - uint64_t position; - - CHIP_ERROR Encode(TLV::TLVWriter & writer, uint64_t tag) const; - CHIP_ERROR Decode(TLV::TLVReader & reader); }; -} // namespace MediaPlaybackPosition +struct DecodableType +{ +}; +} // namespace MediaSeekResponse +} // namespace Commands } // namespace MediaPlayback namespace MediaInput { // Enum for MediaInputType @@ -1075,9 +4101,63 @@ struct Type } // namespace MediaInputInfo +namespace Commands { +namespace SelectInput { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace SelectInput + +namespace ShowInputStatus { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ShowInputStatus + +namespace HideInputStatus { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace HideInputStatus + +namespace RenameInput { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace RenameInput + +} // namespace Commands } // namespace MediaInput namespace LowPower { +namespace Commands { +namespace Sleep { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace Sleep + +} // namespace Commands } // namespace LowPower namespace KeypadInput { // Enum for KeypadInputCecKeyCode @@ -1178,6 +4258,28 @@ enum class KeypadInputStatus : uint8_t KEYPAD_INPUT_STATUS_INVALID_KEY_IN_CURRENT_STATE = 0x02, }; +namespace Commands { +namespace SendKey { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace SendKey + +namespace SendKeyResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace SendKeyResponse + +} // namespace Commands } // namespace KeypadInput namespace ContentLauncher { // Enum for ContentLaunchMetricType @@ -1330,6 +4432,48 @@ struct Type } // namespace ContentLaunchStyleInformation +namespace Commands { +namespace LaunchContent { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace LaunchContent + +namespace LaunchContentResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace LaunchContentResponse + +namespace LaunchURL { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace LaunchURL + +namespace LaunchURLResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace LaunchURLResponse + +} // namespace Commands } // namespace ContentLauncher namespace AudioOutput { // Enum for AudioOutputType @@ -1364,6 +4508,28 @@ struct Type } // namespace AudioOutputInfo +namespace Commands { +namespace SelectOutput { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace SelectOutput + +namespace RenameOutput { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace RenameOutput + +} // namespace Commands } // namespace AudioOutput namespace ApplicationLauncher { // Enum for ApplicationLauncherStatus @@ -1393,6 +4559,28 @@ struct Type } // namespace ApplicationLauncherApp +namespace Commands { +namespace LaunchApp { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace LaunchApp + +namespace LaunchAppResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace LaunchAppResponse + +} // namespace Commands } // namespace ApplicationLauncher namespace ApplicationBasic { // Enum for ApplicationBasicStatus @@ -1404,9 +4592,53 @@ enum class ApplicationBasicStatus : uint8_t APPLICATION_BASIC_STATUS_ACTIVE_VISIBLE_NOT_FOCUS = 0x03, }; +namespace Commands { +namespace ChangeStatus { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace ChangeStatus + +} // namespace Commands } // namespace ApplicationBasic namespace AccountLogin { +namespace Commands { +namespace GetSetupPIN { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetSetupPIN + +namespace GetSetupPINResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetSetupPINResponse + +namespace Login { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace Login + +} // namespace Commands } // namespace AccountLogin namespace TestCluster { // Enum for SimpleEnum @@ -1547,6 +4779,78 @@ struct Type } // namespace TestListStructOctet +namespace Commands { +namespace Test { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace Test + +namespace TestSpecificResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace TestSpecificResponse + +namespace TestNotHandled { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace TestNotHandled + +namespace TestAddArgumentsResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace TestAddArgumentsResponse + +namespace TestSpecific { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace TestSpecific + +namespace TestUnknownCommand { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace TestUnknownCommand + +namespace TestAddArguments { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace TestAddArguments + +} // namespace Commands } // namespace TestCluster namespace Messaging { // Enum for EventId @@ -1663,6 +4967,78 @@ enum class MessagingControlTransmission : uint8_t MESSAGING_CONTROL_TRANSMISSION_RESERVED = 0x03, }; +namespace Commands { +namespace DisplayMessage { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace DisplayMessage + +namespace GetLastMessage { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetLastMessage + +namespace CancelMessage { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace CancelMessage + +namespace MessageConfirmation { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace MessageConfirmation + +namespace DisplayProtectedMessage { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace DisplayProtectedMessage + +namespace GetMessageCancellation { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetMessageCancellation + +namespace CancelAllMessages { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace CancelAllMessages + +} // namespace Commands } // namespace Messaging namespace ApplianceIdentification { @@ -1672,15 +5048,183 @@ namespace MeterIdentification { } // namespace MeterIdentification namespace ApplianceEventsAndAlert { +namespace Commands { +namespace GetAlerts { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetAlerts + +namespace GetAlertsResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetAlertsResponse + +namespace AlertsNotification { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace AlertsNotification + +namespace EventsNotification { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace EventsNotification + +} // namespace Commands } // namespace ApplianceEventsAndAlert namespace ApplianceStatistics { +namespace Commands { +namespace LogNotification { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace LogNotification + +namespace LogRequest { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace LogRequest + +namespace LogResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace LogResponse + +namespace LogQueueRequest { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace LogQueueRequest + +namespace LogQueueResponse { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace LogQueueResponse + +namespace StatisticsAvailable { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace StatisticsAvailable + +} // namespace Commands } // namespace ApplianceStatistics namespace ElectricalMeasurement { +namespace Commands { +namespace GetProfileInfoResponseCommand { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetProfileInfoResponseCommand + +namespace GetProfileInfoCommand { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetProfileInfoCommand + +namespace GetMeasurementProfileResponseCommand { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetMeasurementProfileResponseCommand + +namespace GetMeasurementProfileCommand { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace GetMeasurementProfileCommand + +} // namespace Commands } // namespace ElectricalMeasurement namespace Binding { +namespace Commands { +namespace Bind { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace Bind + +namespace Unbind { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace Unbind + +} // namespace Commands } // namespace Binding namespace GroupKeyManagement { // Enum for GroupKeySecurityPolicy @@ -1738,9 +5282,33 @@ struct Type } // namespace GroupKeyManagement namespace SampleMfgSpecificCluster { +namespace Commands { +namespace CommandOne { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace CommandOne + +} // namespace Commands } // namespace SampleMfgSpecificCluster namespace SampleMfgSpecificCluster2 { +namespace Commands { +namespace CommandTwo { +struct Type +{ +}; + +struct DecodableType +{ +}; +} // namespace CommandTwo + +} // namespace Commands } // namespace SampleMfgSpecificCluster2 } // namespace Clusters diff --git a/zzz_generated/bridge-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/bridge-app/zap-generated/IMClusterCommandHandler.cpp index 4b0af6524a33f4..41804a72435544 100644 --- a/zzz_generated/bridge-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/bridge-app/zap-generated/IMClusterCommandHandler.cpp @@ -23,6 +23,7 @@ #include "app/util/util.h" #include #include +#include #include #include @@ -35,15 +36,16 @@ namespace chip { namespace app { namespace { -void ReportCommandUnsupported(Command * aCommandObj, EndpointId aEndpointId, ClusterId aClusterId, CommandId aCommandId) +void ReportCommandUnsupported(Command * aCommandObj, const ConcreteCommandPath & aCommandPath) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - aClusterId, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + aCommandPath.mClusterId, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; aCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kNotFound, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandId), - ChipLogValueMEI(aClusterId)); + ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, + ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); } } // anonymous namespace @@ -53,7 +55,7 @@ namespace Clusters { namespace AdministratorCommissioning { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -66,9 +68,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::OpenBasicCommissioningWindow::Id: { + Commands::OpenBasicCommissioningWindow::DecodableType commandData; expectArgumentCount = 1; uint16_t CommissioningTimeout; bool argExists[1]; @@ -122,12 +125,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfAdministratorCommissioningClusterOpenBasicCommissioningWindowCallback(aEndpointId, apCommandObj, - CommissioningTimeout); + wasHandled = emberAfAdministratorCommissioningClusterOpenBasicCommissioningWindowCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CommissioningTimeout, commandData); } break; } case Commands::OpenCommissioningWindow::Id: { + Commands::OpenCommissioningWindow::DecodableType commandData; expectArgumentCount = 6; uint16_t CommissioningTimeout; chip::ByteSpan PAKEVerifier; @@ -202,18 +206,21 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 6 == validArgumentCount) { wasHandled = emberAfAdministratorCommissioningClusterOpenCommissioningWindowCallback( - aEndpointId, apCommandObj, CommissioningTimeout, PAKEVerifier, Discriminator, Iterations, Salt, PasscodeID); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CommissioningTimeout, PAKEVerifier, Discriminator, + Iterations, Salt, PasscodeID, commandData); } break; } case Commands::RevokeCommissioning::Id: { + Commands::RevokeCommissioning::DecodableType commandData; - wasHandled = emberAfAdministratorCommissioningClusterRevokeCommissioningCallback(aEndpointId, apCommandObj); + wasHandled = emberAfAdministratorCommissioningClusterRevokeCommissioningCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, AdministratorCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -221,9 +228,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - AdministratorCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + AdministratorCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -241,7 +249,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace DiagnosticLogs { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -254,9 +262,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::RetrieveLogsRequest::Id: { + Commands::RetrieveLogsRequest::DecodableType commandData; expectArgumentCount = 3; uint8_t intent; uint8_t requestedProtocol; @@ -318,14 +327,15 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfDiagnosticLogsClusterRetrieveLogsRequestCallback(aEndpointId, apCommandObj, intent, - requestedProtocol, transferFileDesignator); + wasHandled = emberAfDiagnosticLogsClusterRetrieveLogsRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, intent, requestedProtocol, transferFileDesignator, + commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, DiagnosticLogs::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -333,9 +343,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - DiagnosticLogs::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + DiagnosticLogs::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -353,7 +363,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace GeneralCommissioning { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -366,9 +376,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ArmFailSafe::Id: { + Commands::ArmFailSafe::DecodableType commandData; expectArgumentCount = 3; uint16_t expiryLengthSeconds; uint64_t breadcrumb; @@ -430,17 +441,20 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfGeneralCommissioningClusterArmFailSafeCallback(aEndpointId, apCommandObj, expiryLengthSeconds, - breadcrumb, timeoutMs); + wasHandled = emberAfGeneralCommissioningClusterArmFailSafeCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, expiryLengthSeconds, breadcrumb, timeoutMs, commandData); } break; } case Commands::CommissioningComplete::Id: { + Commands::CommissioningComplete::DecodableType commandData; - wasHandled = emberAfGeneralCommissioningClusterCommissioningCompleteCallback(aEndpointId, apCommandObj); + wasHandled = emberAfGeneralCommissioningClusterCommissioningCompleteCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, commandData); break; } case Commands::SetRegulatoryConfig::Id: { + Commands::SetRegulatoryConfig::DecodableType commandData; expectArgumentCount = 4; uint8_t location; const uint8_t * countryCode; @@ -508,13 +522,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { wasHandled = emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback( - aEndpointId, apCommandObj, location, const_cast(countryCode), breadcrumb, timeoutMs); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, location, const_cast(countryCode), breadcrumb, + timeoutMs, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, GeneralCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -522,9 +537,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - GeneralCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + GeneralCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -542,7 +558,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace LevelControl { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -555,9 +571,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::Move::Id: { + Commands::Move::DecodableType commandData; expectArgumentCount = 4; uint8_t moveMode; uint8_t rate; @@ -623,12 +640,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = - emberAfLevelControlClusterMoveCallback(aEndpointId, apCommandObj, moveMode, rate, optionMask, optionOverride); + wasHandled = emberAfLevelControlClusterMoveCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, moveMode, + rate, optionMask, optionOverride, commandData); } break; } case Commands::MoveToLevel::Id: { + Commands::MoveToLevel::DecodableType commandData; expectArgumentCount = 4; uint8_t level; uint16_t transitionTime; @@ -694,12 +712,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfLevelControlClusterMoveToLevelCallback(aEndpointId, apCommandObj, level, transitionTime, - optionMask, optionOverride); + wasHandled = + emberAfLevelControlClusterMoveToLevelCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, level, + transitionTime, optionMask, optionOverride, commandData); } break; } case Commands::MoveToLevelWithOnOff::Id: { + Commands::MoveToLevelWithOnOff::DecodableType commandData; expectArgumentCount = 2; uint8_t level; uint16_t transitionTime; @@ -757,12 +777,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = - emberAfLevelControlClusterMoveToLevelWithOnOffCallback(aEndpointId, apCommandObj, level, transitionTime); + wasHandled = emberAfLevelControlClusterMoveToLevelWithOnOffCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, level, transitionTime, commandData); } break; } case Commands::MoveWithOnOff::Id: { + Commands::MoveWithOnOff::DecodableType commandData; expectArgumentCount = 2; uint8_t moveMode; uint8_t rate; @@ -820,11 +841,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfLevelControlClusterMoveWithOnOffCallback(aEndpointId, apCommandObj, moveMode, rate); + wasHandled = emberAfLevelControlClusterMoveWithOnOffCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + moveMode, rate, commandData); } break; } case Commands::Step::Id: { + Commands::Step::DecodableType commandData; expectArgumentCount = 5; uint8_t stepMode; uint8_t stepSize; @@ -894,12 +917,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfLevelControlClusterStepCallback(aEndpointId, apCommandObj, stepMode, stepSize, transitionTime, - optionMask, optionOverride); + wasHandled = + emberAfLevelControlClusterStepCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, stepMode, stepSize, + transitionTime, optionMask, optionOverride, commandData); } break; } case Commands::StepWithOnOff::Id: { + Commands::StepWithOnOff::DecodableType commandData; expectArgumentCount = 3; uint8_t stepMode; uint8_t stepSize; @@ -961,12 +986,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = - emberAfLevelControlClusterStepWithOnOffCallback(aEndpointId, apCommandObj, stepMode, stepSize, transitionTime); + wasHandled = emberAfLevelControlClusterStepWithOnOffCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + stepMode, stepSize, transitionTime, commandData); } break; } case Commands::Stop::Id: { + Commands::Stop::DecodableType commandData; expectArgumentCount = 2; uint8_t optionMask; uint8_t optionOverride; @@ -1024,18 +1050,21 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfLevelControlClusterStopCallback(aEndpointId, apCommandObj, optionMask, optionOverride); + wasHandled = emberAfLevelControlClusterStopCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + optionMask, optionOverride, commandData); } break; } case Commands::StopWithOnOff::Id: { + Commands::StopWithOnOff::DecodableType commandData; - wasHandled = emberAfLevelControlClusterStopWithOnOffCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfLevelControlClusterStopWithOnOffCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, LevelControl::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -1043,9 +1072,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - LevelControl::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + LevelControl::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -1063,7 +1092,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace NetworkCommissioning { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -1076,9 +1105,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::AddThreadNetwork::Id: { + Commands::AddThreadNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan operationalDataset; uint64_t breadcrumb; @@ -1140,12 +1170,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterAddThreadNetworkCallback(aEndpointId, apCommandObj, - operationalDataset, breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterAddThreadNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, operationalDataset, breadcrumb, timeoutMs, commandData); } break; } case Commands::AddWiFiNetwork::Id: { + Commands::AddWiFiNetwork::DecodableType commandData; expectArgumentCount = 4; chip::ByteSpan ssid; chip::ByteSpan credentials; @@ -1211,12 +1242,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterAddWiFiNetworkCallback(aEndpointId, apCommandObj, ssid, credentials, - breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterAddWiFiNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, ssid, credentials, breadcrumb, timeoutMs, commandData); } break; } case Commands::DisableNetwork::Id: { + Commands::DisableNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan networkID; uint64_t breadcrumb; @@ -1278,12 +1310,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterDisableNetworkCallback(aEndpointId, apCommandObj, networkID, - breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterDisableNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, networkID, breadcrumb, timeoutMs, commandData); } break; } case Commands::EnableNetwork::Id: { + Commands::EnableNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan networkID; uint64_t breadcrumb; @@ -1345,12 +1378,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterEnableNetworkCallback(aEndpointId, apCommandObj, networkID, - breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterEnableNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, networkID, breadcrumb, timeoutMs, commandData); } break; } case Commands::GetLastNetworkCommissioningResult::Id: { + Commands::GetLastNetworkCommissioningResult::DecodableType commandData; expectArgumentCount = 1; uint32_t timeoutMs; bool argExists[1]; @@ -1404,12 +1438,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback(aEndpointId, apCommandObj, - timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, timeoutMs, commandData); } break; } case Commands::RemoveNetwork::Id: { + Commands::RemoveNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan NetworkID; uint64_t Breadcrumb; @@ -1471,12 +1506,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterRemoveNetworkCallback(aEndpointId, apCommandObj, NetworkID, - Breadcrumb, TimeoutMs); + wasHandled = emberAfNetworkCommissioningClusterRemoveNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, NetworkID, Breadcrumb, TimeoutMs, commandData); } break; } case Commands::ScanNetworks::Id: { + Commands::ScanNetworks::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan ssid; uint64_t breadcrumb; @@ -1538,12 +1574,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = - emberAfNetworkCommissioningClusterScanNetworksCallback(aEndpointId, apCommandObj, ssid, breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterScanNetworksCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, ssid, breadcrumb, timeoutMs, commandData); } break; } case Commands::UpdateThreadNetwork::Id: { + Commands::UpdateThreadNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan operationalDataset; uint64_t breadcrumb; @@ -1606,11 +1643,12 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { wasHandled = emberAfNetworkCommissioningClusterUpdateThreadNetworkCallback( - aEndpointId, apCommandObj, operationalDataset, breadcrumb, timeoutMs); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, operationalDataset, breadcrumb, timeoutMs, commandData); } break; } case Commands::UpdateWiFiNetwork::Id: { + Commands::UpdateWiFiNetwork::DecodableType commandData; expectArgumentCount = 4; chip::ByteSpan ssid; chip::ByteSpan credentials; @@ -1676,14 +1714,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback(aEndpointId, apCommandObj, ssid, - credentials, breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, ssid, credentials, breadcrumb, timeoutMs, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, NetworkCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -1691,9 +1729,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - NetworkCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + NetworkCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -1711,7 +1750,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace OnOff { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -1724,26 +1763,29 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::Off::Id: { + Commands::Off::DecodableType commandData; - wasHandled = emberAfOnOffClusterOffCallback(aEndpointId, apCommandObj); + wasHandled = emberAfOnOffClusterOffCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::On::Id: { + Commands::On::DecodableType commandData; - wasHandled = emberAfOnOffClusterOnCallback(aEndpointId, apCommandObj); + wasHandled = emberAfOnOffClusterOnCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::Toggle::Id: { + Commands::Toggle::DecodableType commandData; - wasHandled = emberAfOnOffClusterToggleCallback(aEndpointId, apCommandObj); + wasHandled = emberAfOnOffClusterToggleCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, OnOff::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -1751,9 +1793,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - OnOff::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + OnOff::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -1771,7 +1813,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace OperationalCredentials { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -1784,9 +1826,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::AddNOC::Id: { + Commands::AddNOC::DecodableType commandData; expectArgumentCount = 5; chip::ByteSpan NOCValue; chip::ByteSpan ICACValue; @@ -1856,12 +1899,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterAddNOCCallback(aEndpointId, apCommandObj, NOCValue, ICACValue, - IPKValue, CaseAdminNode, AdminVendorId); + wasHandled = emberAfOperationalCredentialsClusterAddNOCCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, NOCValue, ICACValue, IPKValue, CaseAdminNode, + AdminVendorId, commandData); } break; } case Commands::AddTrustedRootCertificate::Id: { + Commands::AddTrustedRootCertificate::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan RootCertificate; bool argExists[1]; @@ -1915,12 +1960,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback(aEndpointId, apCommandObj, - RootCertificate); + wasHandled = emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, RootCertificate, commandData); } break; } case Commands::AttestationRequest::Id: { + Commands::AttestationRequest::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan AttestationNonce; bool argExists[1]; @@ -1974,12 +2020,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = - emberAfOperationalCredentialsClusterAttestationRequestCallback(aEndpointId, apCommandObj, AttestationNonce); + wasHandled = emberAfOperationalCredentialsClusterAttestationRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, AttestationNonce, commandData); } break; } case Commands::CertificateChainRequest::Id: { + Commands::CertificateChainRequest::DecodableType commandData; expectArgumentCount = 1; uint8_t CertificateType; bool argExists[1]; @@ -2033,12 +2080,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = - emberAfOperationalCredentialsClusterCertificateChainRequestCallback(aEndpointId, apCommandObj, CertificateType); + wasHandled = emberAfOperationalCredentialsClusterCertificateChainRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CertificateType, commandData); } break; } case Commands::OpCSRRequest::Id: { + Commands::OpCSRRequest::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan CSRNonce; bool argExists[1]; @@ -2092,11 +2140,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterOpCSRRequestCallback(aEndpointId, apCommandObj, CSRNonce); + wasHandled = emberAfOperationalCredentialsClusterOpCSRRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CSRNonce, commandData); } break; } case Commands::RemoveFabric::Id: { + Commands::RemoveFabric::DecodableType commandData; expectArgumentCount = 1; uint8_t FabricIndex; bool argExists[1]; @@ -2150,11 +2200,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterRemoveFabricCallback(aEndpointId, apCommandObj, FabricIndex); + wasHandled = emberAfOperationalCredentialsClusterRemoveFabricCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, FabricIndex, commandData); } break; } case Commands::RemoveTrustedRootCertificate::Id: { + Commands::RemoveTrustedRootCertificate::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan TrustedRootIdentifier; bool argExists[1]; @@ -2208,12 +2260,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterRemoveTrustedRootCertificateCallback(aEndpointId, apCommandObj, - TrustedRootIdentifier); + wasHandled = emberAfOperationalCredentialsClusterRemoveTrustedRootCertificateCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, TrustedRootIdentifier, commandData); } break; } case Commands::UpdateFabricLabel::Id: { + Commands::UpdateFabricLabel::DecodableType commandData; expectArgumentCount = 1; const uint8_t * Label; bool argExists[1]; @@ -2268,12 +2321,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterUpdateFabricLabelCallback(aEndpointId, apCommandObj, - const_cast(Label)); + wasHandled = emberAfOperationalCredentialsClusterUpdateFabricLabelCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, const_cast(Label), commandData); } break; } case Commands::UpdateNOC::Id: { + Commands::UpdateNOC::DecodableType commandData; expectArgumentCount = 2; chip::ByteSpan NOCValue; chip::ByteSpan ICACValue; @@ -2331,13 +2385,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterUpdateNOCCallback(aEndpointId, apCommandObj, NOCValue, ICACValue); + wasHandled = emberAfOperationalCredentialsClusterUpdateNOCCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, NOCValue, ICACValue, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, OperationalCredentials::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -2345,9 +2400,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - OperationalCredentials::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + OperationalCredentials::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -2371,30 +2427,31 @@ void DispatchSingleClusterCommand(ClusterId aClusterId, CommandId aCommandId, En 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); TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); switch (aClusterId) { case Clusters::AdministratorCommissioning::Id: - Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::DiagnosticLogs::Id: - Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::GeneralCommissioning::Id: - Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::LevelControl::Id: - Clusters::LevelControl::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::LevelControl::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::NetworkCommissioning::Id: - Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::OnOff::Id: - Clusters::OnOff::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::OnOff::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::OperationalCredentials::Id: - Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, commandPath, aReader); break; default: // Unrecognized cluster ID, error status will apply. @@ -2417,6 +2474,7 @@ void DispatchSingleClusterResponseCommand(ClusterId aClusterId, CommandId aComma 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); TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); switch (aClusterId) diff --git a/zzz_generated/controller-clusters/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/controller-clusters/zap-generated/IMClusterCommandHandler.cpp index 83a6fb8209c0e1..ec6f1b165f05a7 100644 --- a/zzz_generated/controller-clusters/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/controller-clusters/zap-generated/IMClusterCommandHandler.cpp @@ -23,6 +23,7 @@ #include "app/util/util.h" #include #include +#include #include #include @@ -35,15 +36,16 @@ namespace chip { namespace app { namespace { -void ReportCommandUnsupported(Command * aCommandObj, EndpointId aEndpointId, ClusterId aClusterId, CommandId aCommandId) +void ReportCommandUnsupported(Command * aCommandObj, const ConcreteCommandPath & aCommandPath) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - aClusterId, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + aCommandPath.mClusterId, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; aCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kNotFound, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandId), - ChipLogValueMEI(aClusterId)); + ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, + ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); } } // anonymous namespace @@ -53,7 +55,7 @@ namespace Clusters { namespace AccountLogin { -void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -66,7 +68,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::GetSetupPINResponse::Id: { expectArgumentCount = 1; @@ -123,14 +125,14 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfAccountLoginClusterGetSetupPINResponseCallback(aEndpointId, apCommandObj, + wasHandled = emberAfAccountLoginClusterGetSetupPINResponseCallback(aCommandPath.mEndpointId, apCommandObj, const_cast(setupPIN)); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, AccountLogin::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -138,9 +140,9 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - AccountLogin::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + AccountLogin::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -158,7 +160,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E namespace ApplicationLauncher { -void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -171,7 +173,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::LaunchAppResponse::Id: { expectArgumentCount = 2; @@ -232,14 +234,14 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfApplicationLauncherClusterLaunchAppResponseCallback(aEndpointId, apCommandObj, status, - const_cast(data)); + wasHandled = emberAfApplicationLauncherClusterLaunchAppResponseCallback(aCommandPath.mEndpointId, apCommandObj, + status, const_cast(data)); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, ApplicationLauncher::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -247,9 +249,10 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - ApplicationLauncher::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + ApplicationLauncher::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -267,7 +270,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E namespace ContentLauncher { -void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -280,7 +283,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::LaunchContentResponse::Id: { expectArgumentCount = 2; @@ -342,7 +345,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { wasHandled = emberAfContentLauncherClusterLaunchContentResponseCallback( - aEndpointId, apCommandObj, const_cast(data), contentLaunchStatus); + aCommandPath.mEndpointId, apCommandObj, const_cast(data), contentLaunchStatus); } break; } @@ -406,13 +409,13 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { wasHandled = emberAfContentLauncherClusterLaunchURLResponseCallback( - aEndpointId, apCommandObj, const_cast(data), contentLaunchStatus); + aCommandPath.mEndpointId, apCommandObj, const_cast(data), contentLaunchStatus); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, ContentLauncher::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -420,9 +423,10 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - ContentLauncher::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + ContentLauncher::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -440,7 +444,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E namespace DoorLock { -void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -453,7 +457,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ClearAllPinsResponse::Id: { expectArgumentCount = 1; @@ -509,7 +513,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterClearAllPinsResponseCallback(aEndpointId, apCommandObj, status); + wasHandled = emberAfDoorLockClusterClearAllPinsResponseCallback(aCommandPath.mEndpointId, apCommandObj, status); } break; } @@ -567,7 +571,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterClearAllRfidsResponseCallback(aEndpointId, apCommandObj, status); + wasHandled = emberAfDoorLockClusterClearAllRfidsResponseCallback(aCommandPath.mEndpointId, apCommandObj, status); } break; } @@ -625,7 +629,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterClearHolidayScheduleResponseCallback(aEndpointId, apCommandObj, status); + wasHandled = + emberAfDoorLockClusterClearHolidayScheduleResponseCallback(aCommandPath.mEndpointId, apCommandObj, status); } break; } @@ -683,7 +688,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterClearPinResponseCallback(aEndpointId, apCommandObj, status); + wasHandled = emberAfDoorLockClusterClearPinResponseCallback(aCommandPath.mEndpointId, apCommandObj, status); } break; } @@ -741,7 +746,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterClearRfidResponseCallback(aEndpointId, apCommandObj, status); + wasHandled = emberAfDoorLockClusterClearRfidResponseCallback(aCommandPath.mEndpointId, apCommandObj, status); } break; } @@ -799,7 +804,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterClearWeekdayScheduleResponseCallback(aEndpointId, apCommandObj, status); + wasHandled = + emberAfDoorLockClusterClearWeekdayScheduleResponseCallback(aCommandPath.mEndpointId, apCommandObj, status); } break; } @@ -857,7 +863,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterClearYeardayScheduleResponseCallback(aEndpointId, apCommandObj, status); + wasHandled = + emberAfDoorLockClusterClearYeardayScheduleResponseCallback(aCommandPath.mEndpointId, apCommandObj, status); } break; } @@ -931,8 +938,9 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterGetHolidayScheduleResponseCallback( - aEndpointId, apCommandObj, scheduleId, status, localStartTime, localEndTime, operatingModeDuringHoliday); + wasHandled = emberAfDoorLockClusterGetHolidayScheduleResponseCallback(aCommandPath.mEndpointId, apCommandObj, + scheduleId, status, localStartTime, + localEndTime, operatingModeDuringHoliday); } break; } @@ -1015,9 +1023,9 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 7 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterGetLogRecordResponseCallback(aEndpointId, apCommandObj, logEntryId, timestamp, - eventType, source, eventIdOrAlarmCode, userId, - const_cast(pin)); + wasHandled = emberAfDoorLockClusterGetLogRecordResponseCallback(aCommandPath.mEndpointId, apCommandObj, logEntryId, + timestamp, eventType, source, eventIdOrAlarmCode, + userId, const_cast(pin)); } break; } @@ -1088,8 +1096,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterGetPinResponseCallback(aEndpointId, apCommandObj, userId, userStatus, userType, - const_cast(pin)); + wasHandled = emberAfDoorLockClusterGetPinResponseCallback(aCommandPath.mEndpointId, apCommandObj, userId, + userStatus, userType, const_cast(pin)); } break; } @@ -1160,8 +1168,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterGetRfidResponseCallback(aEndpointId, apCommandObj, userId, userStatus, userType, - const_cast(rfid)); + wasHandled = emberAfDoorLockClusterGetRfidResponseCallback(aCommandPath.mEndpointId, apCommandObj, userId, + userStatus, userType, const_cast(rfid)); } break; } @@ -1223,7 +1231,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterGetUserTypeResponseCallback(aEndpointId, apCommandObj, userId, userType); + wasHandled = + emberAfDoorLockClusterGetUserTypeResponseCallback(aCommandPath.mEndpointId, apCommandObj, userId, userType); } break; } @@ -1309,8 +1318,9 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 8 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterGetWeekdayScheduleResponseCallback( - aEndpointId, apCommandObj, scheduleId, userId, status, daysMask, startHour, startMinute, endHour, endMinute); + wasHandled = emberAfDoorLockClusterGetWeekdayScheduleResponseCallback(aCommandPath.mEndpointId, apCommandObj, + scheduleId, userId, status, daysMask, + startHour, startMinute, endHour, endMinute); } break; } @@ -1384,8 +1394,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterGetYeardayScheduleResponseCallback(aEndpointId, apCommandObj, scheduleId, userId, - status, localStartTime, localEndTime); + wasHandled = emberAfDoorLockClusterGetYeardayScheduleResponseCallback( + aCommandPath.mEndpointId, apCommandObj, scheduleId, userId, status, localStartTime, localEndTime); } break; } @@ -1443,7 +1453,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterLockDoorResponseCallback(aEndpointId, apCommandObj, status); + wasHandled = emberAfDoorLockClusterLockDoorResponseCallback(aCommandPath.mEndpointId, apCommandObj, status); } break; } @@ -1501,7 +1511,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterSetHolidayScheduleResponseCallback(aEndpointId, apCommandObj, status); + wasHandled = + emberAfDoorLockClusterSetHolidayScheduleResponseCallback(aCommandPath.mEndpointId, apCommandObj, status); } break; } @@ -1559,7 +1570,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterSetPinResponseCallback(aEndpointId, apCommandObj, status); + wasHandled = emberAfDoorLockClusterSetPinResponseCallback(aCommandPath.mEndpointId, apCommandObj, status); } break; } @@ -1617,7 +1628,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterSetRfidResponseCallback(aEndpointId, apCommandObj, status); + wasHandled = emberAfDoorLockClusterSetRfidResponseCallback(aCommandPath.mEndpointId, apCommandObj, status); } break; } @@ -1675,7 +1686,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterSetUserTypeResponseCallback(aEndpointId, apCommandObj, status); + wasHandled = emberAfDoorLockClusterSetUserTypeResponseCallback(aCommandPath.mEndpointId, apCommandObj, status); } break; } @@ -1733,7 +1744,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterSetWeekdayScheduleResponseCallback(aEndpointId, apCommandObj, status); + wasHandled = + emberAfDoorLockClusterSetWeekdayScheduleResponseCallback(aCommandPath.mEndpointId, apCommandObj, status); } break; } @@ -1791,7 +1803,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterSetYeardayScheduleResponseCallback(aEndpointId, apCommandObj, status); + wasHandled = + emberAfDoorLockClusterSetYeardayScheduleResponseCallback(aCommandPath.mEndpointId, apCommandObj, status); } break; } @@ -1849,7 +1862,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterUnlockDoorResponseCallback(aEndpointId, apCommandObj, status); + wasHandled = emberAfDoorLockClusterUnlockDoorResponseCallback(aCommandPath.mEndpointId, apCommandObj, status); } break; } @@ -1907,13 +1920,14 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterUnlockWithTimeoutResponseCallback(aEndpointId, apCommandObj, status); + wasHandled = + emberAfDoorLockClusterUnlockWithTimeoutResponseCallback(aCommandPath.mEndpointId, apCommandObj, status); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, DoorLock::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -1921,9 +1935,9 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - DoorLock::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + DoorLock::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -1941,7 +1955,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E namespace GeneralCommissioning { -void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -1954,7 +1968,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ArmFailSafeResponse::Id: { expectArgumentCount = 2; @@ -2015,8 +2029,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfGeneralCommissioningClusterArmFailSafeResponseCallback(aEndpointId, apCommandObj, errorCode, - const_cast(debugText)); + wasHandled = emberAfGeneralCommissioningClusterArmFailSafeResponseCallback( + aCommandPath.mEndpointId, apCommandObj, errorCode, const_cast(debugText)); } break; } @@ -2080,7 +2094,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { wasHandled = emberAfGeneralCommissioningClusterCommissioningCompleteResponseCallback( - aEndpointId, apCommandObj, errorCode, const_cast(debugText)); + aCommandPath.mEndpointId, apCommandObj, errorCode, const_cast(debugText)); } break; } @@ -2144,13 +2158,13 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { wasHandled = emberAfGeneralCommissioningClusterSetRegulatoryConfigResponseCallback( - aEndpointId, apCommandObj, errorCode, const_cast(debugText)); + aCommandPath.mEndpointId, apCommandObj, errorCode, const_cast(debugText)); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, GeneralCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -2158,9 +2172,10 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - GeneralCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + GeneralCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -2178,7 +2193,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E namespace Groups { -void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -2191,7 +2206,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::AddGroupResponse::Id: { expectArgumentCount = 2; @@ -2251,7 +2266,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfGroupsClusterAddGroupResponseCallback(aEndpointId, apCommandObj, status, groupId); + wasHandled = emberAfGroupsClusterAddGroupResponseCallback(aCommandPath.mEndpointId, apCommandObj, status, groupId); } break; } @@ -2318,8 +2333,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfGroupsClusterGetGroupMembershipResponseCallback(aEndpointId, apCommandObj, capacity, groupCount, - groupList); + wasHandled = emberAfGroupsClusterGetGroupMembershipResponseCallback(aCommandPath.mEndpointId, apCommandObj, + capacity, groupCount, groupList); } break; } @@ -2381,7 +2396,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfGroupsClusterRemoveGroupResponseCallback(aEndpointId, apCommandObj, status, groupId); + wasHandled = + emberAfGroupsClusterRemoveGroupResponseCallback(aCommandPath.mEndpointId, apCommandObj, status, groupId); } break; } @@ -2448,14 +2464,14 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfGroupsClusterViewGroupResponseCallback(aEndpointId, apCommandObj, status, groupId, + wasHandled = emberAfGroupsClusterViewGroupResponseCallback(aCommandPath.mEndpointId, apCommandObj, status, groupId, const_cast(groupName)); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, Groups::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -2463,9 +2479,9 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - Groups::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + Groups::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -2483,7 +2499,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E namespace Identify { -void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -2496,7 +2512,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::IdentifyQueryResponse::Id: { expectArgumentCount = 1; @@ -2552,13 +2568,13 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfIdentifyClusterIdentifyQueryResponseCallback(aEndpointId, apCommandObj, timeout); + wasHandled = emberAfIdentifyClusterIdentifyQueryResponseCallback(aCommandPath.mEndpointId, apCommandObj, timeout); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, Identify::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -2566,9 +2582,9 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - Identify::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + Identify::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -2586,7 +2602,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E namespace KeypadInput { -void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -2599,7 +2615,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::SendKeyResponse::Id: { expectArgumentCount = 1; @@ -2655,13 +2671,13 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfKeypadInputClusterSendKeyResponseCallback(aEndpointId, apCommandObj, status); + wasHandled = emberAfKeypadInputClusterSendKeyResponseCallback(aCommandPath.mEndpointId, apCommandObj, status); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, KeypadInput::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -2669,9 +2685,9 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - KeypadInput::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + KeypadInput::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -2689,7 +2705,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E namespace MediaPlayback { -void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -2702,7 +2718,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::MediaFastForwardResponse::Id: { expectArgumentCount = 1; @@ -2758,8 +2774,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = - emberAfMediaPlaybackClusterMediaFastForwardResponseCallback(aEndpointId, apCommandObj, mediaPlaybackStatus); + wasHandled = emberAfMediaPlaybackClusterMediaFastForwardResponseCallback(aCommandPath.mEndpointId, apCommandObj, + mediaPlaybackStatus); } break; } @@ -2817,7 +2833,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfMediaPlaybackClusterMediaNextResponseCallback(aEndpointId, apCommandObj, mediaPlaybackStatus); + wasHandled = emberAfMediaPlaybackClusterMediaNextResponseCallback(aCommandPath.mEndpointId, apCommandObj, + mediaPlaybackStatus); } break; } @@ -2875,7 +2892,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfMediaPlaybackClusterMediaPauseResponseCallback(aEndpointId, apCommandObj, mediaPlaybackStatus); + wasHandled = emberAfMediaPlaybackClusterMediaPauseResponseCallback(aCommandPath.mEndpointId, apCommandObj, + mediaPlaybackStatus); } break; } @@ -2933,7 +2951,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfMediaPlaybackClusterMediaPlayResponseCallback(aEndpointId, apCommandObj, mediaPlaybackStatus); + wasHandled = emberAfMediaPlaybackClusterMediaPlayResponseCallback(aCommandPath.mEndpointId, apCommandObj, + mediaPlaybackStatus); } break; } @@ -2991,8 +3010,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = - emberAfMediaPlaybackClusterMediaPreviousResponseCallback(aEndpointId, apCommandObj, mediaPlaybackStatus); + wasHandled = emberAfMediaPlaybackClusterMediaPreviousResponseCallback(aCommandPath.mEndpointId, apCommandObj, + mediaPlaybackStatus); } break; } @@ -3050,7 +3069,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfMediaPlaybackClusterMediaRewindResponseCallback(aEndpointId, apCommandObj, mediaPlaybackStatus); + wasHandled = emberAfMediaPlaybackClusterMediaRewindResponseCallback(aCommandPath.mEndpointId, apCommandObj, + mediaPlaybackStatus); } break; } @@ -3108,7 +3128,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfMediaPlaybackClusterMediaSeekResponseCallback(aEndpointId, apCommandObj, mediaPlaybackStatus); + wasHandled = emberAfMediaPlaybackClusterMediaSeekResponseCallback(aCommandPath.mEndpointId, apCommandObj, + mediaPlaybackStatus); } break; } @@ -3166,8 +3187,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = - emberAfMediaPlaybackClusterMediaSkipBackwardResponseCallback(aEndpointId, apCommandObj, mediaPlaybackStatus); + wasHandled = emberAfMediaPlaybackClusterMediaSkipBackwardResponseCallback(aCommandPath.mEndpointId, apCommandObj, + mediaPlaybackStatus); } break; } @@ -3225,8 +3246,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = - emberAfMediaPlaybackClusterMediaSkipForwardResponseCallback(aEndpointId, apCommandObj, mediaPlaybackStatus); + wasHandled = emberAfMediaPlaybackClusterMediaSkipForwardResponseCallback(aCommandPath.mEndpointId, apCommandObj, + mediaPlaybackStatus); } break; } @@ -3284,8 +3305,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = - emberAfMediaPlaybackClusterMediaStartOverResponseCallback(aEndpointId, apCommandObj, mediaPlaybackStatus); + wasHandled = emberAfMediaPlaybackClusterMediaStartOverResponseCallback(aCommandPath.mEndpointId, apCommandObj, + mediaPlaybackStatus); } break; } @@ -3343,13 +3364,14 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfMediaPlaybackClusterMediaStopResponseCallback(aEndpointId, apCommandObj, mediaPlaybackStatus); + wasHandled = emberAfMediaPlaybackClusterMediaStopResponseCallback(aCommandPath.mEndpointId, apCommandObj, + mediaPlaybackStatus); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, MediaPlayback::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -3357,9 +3379,9 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - MediaPlayback::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + MediaPlayback::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -3377,7 +3399,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E namespace NetworkCommissioning { -void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -3390,7 +3412,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::AddThreadNetworkResponse::Id: { expectArgumentCount = 2; @@ -3452,7 +3474,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { wasHandled = emberAfNetworkCommissioningClusterAddThreadNetworkResponseCallback( - aEndpointId, apCommandObj, errorCode, const_cast(debugText)); + aCommandPath.mEndpointId, apCommandObj, errorCode, const_cast(debugText)); } break; } @@ -3515,8 +3537,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterAddWiFiNetworkResponseCallback(aEndpointId, apCommandObj, errorCode, - const_cast(debugText)); + wasHandled = emberAfNetworkCommissioningClusterAddWiFiNetworkResponseCallback( + aCommandPath.mEndpointId, apCommandObj, errorCode, const_cast(debugText)); } break; } @@ -3579,8 +3601,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterDisableNetworkResponseCallback(aEndpointId, apCommandObj, errorCode, - const_cast(debugText)); + wasHandled = emberAfNetworkCommissioningClusterDisableNetworkResponseCallback( + aCommandPath.mEndpointId, apCommandObj, errorCode, const_cast(debugText)); } break; } @@ -3643,8 +3665,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterEnableNetworkResponseCallback(aEndpointId, apCommandObj, errorCode, - const_cast(debugText)); + wasHandled = emberAfNetworkCommissioningClusterEnableNetworkResponseCallback( + aCommandPath.mEndpointId, apCommandObj, errorCode, const_cast(debugText)); } break; } @@ -3707,8 +3729,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterRemoveNetworkResponseCallback(aEndpointId, apCommandObj, errorCode, - const_cast(debugText)); + wasHandled = emberAfNetworkCommissioningClusterRemoveNetworkResponseCallback( + aCommandPath.mEndpointId, apCommandObj, errorCode, const_cast(debugText)); } break; } @@ -3782,7 +3804,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { wasHandled = emberAfNetworkCommissioningClusterScanNetworksResponseCallback( - aEndpointId, apCommandObj, errorCode, const_cast(debugText), wifiScanResults, threadScanResults); + aCommandPath.mEndpointId, apCommandObj, errorCode, const_cast(debugText), wifiScanResults, + threadScanResults); } break; } @@ -3846,7 +3869,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { wasHandled = emberAfNetworkCommissioningClusterUpdateThreadNetworkResponseCallback( - aEndpointId, apCommandObj, errorCode, const_cast(debugText)); + aCommandPath.mEndpointId, apCommandObj, errorCode, const_cast(debugText)); } break; } @@ -3910,13 +3933,13 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { wasHandled = emberAfNetworkCommissioningClusterUpdateWiFiNetworkResponseCallback( - aEndpointId, apCommandObj, errorCode, const_cast(debugText)); + aCommandPath.mEndpointId, apCommandObj, errorCode, const_cast(debugText)); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, NetworkCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -3924,9 +3947,10 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - NetworkCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + NetworkCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -3944,7 +3968,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E namespace OtaSoftwareUpdateProvider { -void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -3957,7 +3981,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ApplyUpdateRequestResponse::Id: { expectArgumentCount = 2; @@ -4017,8 +4041,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestResponseCallback(aEndpointId, apCommandObj, - action, delayedActionTime); + wasHandled = emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestResponseCallback( + aCommandPath.mEndpointId, apCommandObj, action, delayedActionTime); } break; } @@ -4107,14 +4131,15 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 8 == validArgumentCount) { wasHandled = emberAfOtaSoftwareUpdateProviderClusterQueryImageResponseCallback( - aEndpointId, apCommandObj, status, delayedActionTime, const_cast(imageURI), softwareVersion, - const_cast(softwareVersionString), updateToken, userConsentNeeded, metadataForRequestor); + aCommandPath.mEndpointId, apCommandObj, status, delayedActionTime, const_cast(imageURI), + softwareVersion, const_cast(softwareVersionString), updateToken, userConsentNeeded, + metadataForRequestor); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, OtaSoftwareUpdateProvider::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -4122,9 +4147,10 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - OtaSoftwareUpdateProvider::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + OtaSoftwareUpdateProvider::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -4142,7 +4168,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E namespace OperationalCredentials { -void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -4155,7 +4181,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::AttestationResponse::Id: { expectArgumentCount = 2; @@ -4215,7 +4241,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterAttestationResponseCallback(aEndpointId, apCommandObj, + wasHandled = emberAfOperationalCredentialsClusterAttestationResponseCallback(aCommandPath.mEndpointId, apCommandObj, AttestationElements, Signature); } break; @@ -4274,8 +4300,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = - emberAfOperationalCredentialsClusterCertificateChainResponseCallback(aEndpointId, apCommandObj, Certificate); + wasHandled = emberAfOperationalCredentialsClusterCertificateChainResponseCallback(aCommandPath.mEndpointId, + apCommandObj, Certificate); } break; } @@ -4341,8 +4367,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterNOCResponseCallback(aEndpointId, apCommandObj, StatusCode, - FabricIndex, DebugText); + wasHandled = emberAfOperationalCredentialsClusterNOCResponseCallback(aCommandPath.mEndpointId, apCommandObj, + StatusCode, FabricIndex, DebugText); } break; } @@ -4404,14 +4430,14 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterOpCSRResponseCallback(aEndpointId, apCommandObj, NOCSRElements, - AttestationSignature); + wasHandled = emberAfOperationalCredentialsClusterOpCSRResponseCallback(aCommandPath.mEndpointId, apCommandObj, + NOCSRElements, AttestationSignature); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, OperationalCredentials::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -4419,9 +4445,10 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - OperationalCredentials::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + OperationalCredentials::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -4439,7 +4466,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E namespace Scenes { -void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -4452,7 +4479,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::AddSceneResponse::Id: { expectArgumentCount = 3; @@ -4516,7 +4543,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfScenesClusterAddSceneResponseCallback(aEndpointId, apCommandObj, status, groupId, sceneId); + wasHandled = + emberAfScenesClusterAddSceneResponseCallback(aCommandPath.mEndpointId, apCommandObj, status, groupId, sceneId); } break; } @@ -4591,8 +4619,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfScenesClusterGetSceneMembershipResponseCallback(aEndpointId, apCommandObj, status, capacity, - groupId, sceneCount, sceneList); + wasHandled = emberAfScenesClusterGetSceneMembershipResponseCallback(aCommandPath.mEndpointId, apCommandObj, status, + capacity, groupId, sceneCount, sceneList); } break; } @@ -4654,7 +4682,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfScenesClusterRemoveAllScenesResponseCallback(aEndpointId, apCommandObj, status, groupId); + wasHandled = + emberAfScenesClusterRemoveAllScenesResponseCallback(aCommandPath.mEndpointId, apCommandObj, status, groupId); } break; } @@ -4720,7 +4749,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfScenesClusterRemoveSceneResponseCallback(aEndpointId, apCommandObj, status, groupId, sceneId); + wasHandled = emberAfScenesClusterRemoveSceneResponseCallback(aCommandPath.mEndpointId, apCommandObj, status, + groupId, sceneId); } break; } @@ -4786,7 +4816,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfScenesClusterStoreSceneResponseCallback(aEndpointId, apCommandObj, status, groupId, sceneId); + wasHandled = emberAfScenesClusterStoreSceneResponseCallback(aCommandPath.mEndpointId, apCommandObj, status, groupId, + sceneId); } break; } @@ -4866,15 +4897,15 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 6 == validArgumentCount) { - wasHandled = emberAfScenesClusterViewSceneResponseCallback(aEndpointId, apCommandObj, status, groupId, sceneId, - transitionTime, const_cast(sceneName), - extensionFieldSets); + wasHandled = emberAfScenesClusterViewSceneResponseCallback(aCommandPath.mEndpointId, apCommandObj, status, groupId, + sceneId, transitionTime, + const_cast(sceneName), extensionFieldSets); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, Scenes::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -4882,9 +4913,9 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - Scenes::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + Scenes::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -4902,7 +4933,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E namespace TvChannel { -void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -4915,7 +4946,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ChangeChannelResponse::Id: { expectArgumentCount = 2; @@ -4976,14 +5007,14 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = - emberAfTvChannelClusterChangeChannelResponseCallback(aEndpointId, apCommandObj, ChannelMatch, ErrorType); + wasHandled = emberAfTvChannelClusterChangeChannelResponseCallback(aCommandPath.mEndpointId, apCommandObj, + ChannelMatch, ErrorType); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, TvChannel::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -4991,9 +5022,9 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - TvChannel::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + TvChannel::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -5011,7 +5042,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E namespace TargetNavigator { -void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -5024,7 +5055,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::NavigateTargetResponse::Id: { expectArgumentCount = 2; @@ -5085,14 +5116,14 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfTargetNavigatorClusterNavigateTargetResponseCallback(aEndpointId, apCommandObj, status, - const_cast(data)); + wasHandled = emberAfTargetNavigatorClusterNavigateTargetResponseCallback(aCommandPath.mEndpointId, apCommandObj, + status, const_cast(data)); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, TargetNavigator::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -5100,9 +5131,10 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - TargetNavigator::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + TargetNavigator::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -5120,7 +5152,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E namespace TestCluster { -void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -5133,7 +5165,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::TestAddArgumentsResponse::Id: { expectArgumentCount = 1; @@ -5189,7 +5221,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfTestClusterClusterTestAddArgumentsResponseCallback(aEndpointId, apCommandObj, returnValue); + wasHandled = + emberAfTestClusterClusterTestAddArgumentsResponseCallback(aCommandPath.mEndpointId, apCommandObj, returnValue); } break; } @@ -5247,13 +5280,14 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfTestClusterClusterTestSpecificResponseCallback(aEndpointId, apCommandObj, returnValue); + wasHandled = + emberAfTestClusterClusterTestSpecificResponseCallback(aCommandPath.mEndpointId, apCommandObj, returnValue); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, TestCluster::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -5261,9 +5295,9 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - TestCluster::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + TestCluster::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -5287,6 +5321,7 @@ void DispatchSingleClusterCommand(ClusterId aClusterId, CommandId aCommandId, En 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); TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); switch (aClusterId) @@ -5312,57 +5347,58 @@ void DispatchSingleClusterResponseCommand(ClusterId aClusterId, CommandId aComma 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); TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); switch (aClusterId) { case Clusters::AccountLogin::Id: - Clusters::AccountLogin::DispatchClientCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::AccountLogin::DispatchClientCommand(apCommandObj, commandPath, aReader); break; case Clusters::ApplicationLauncher::Id: - Clusters::ApplicationLauncher::DispatchClientCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::ApplicationLauncher::DispatchClientCommand(apCommandObj, commandPath, aReader); break; case Clusters::ContentLauncher::Id: - Clusters::ContentLauncher::DispatchClientCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::ContentLauncher::DispatchClientCommand(apCommandObj, commandPath, aReader); break; case Clusters::DoorLock::Id: - Clusters::DoorLock::DispatchClientCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::DoorLock::DispatchClientCommand(apCommandObj, commandPath, aReader); break; case Clusters::GeneralCommissioning::Id: - Clusters::GeneralCommissioning::DispatchClientCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::GeneralCommissioning::DispatchClientCommand(apCommandObj, commandPath, aReader); break; case Clusters::Groups::Id: - Clusters::Groups::DispatchClientCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::Groups::DispatchClientCommand(apCommandObj, commandPath, aReader); break; case Clusters::Identify::Id: - Clusters::Identify::DispatchClientCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::Identify::DispatchClientCommand(apCommandObj, commandPath, aReader); break; case Clusters::KeypadInput::Id: - Clusters::KeypadInput::DispatchClientCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::KeypadInput::DispatchClientCommand(apCommandObj, commandPath, aReader); break; case Clusters::MediaPlayback::Id: - Clusters::MediaPlayback::DispatchClientCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::MediaPlayback::DispatchClientCommand(apCommandObj, commandPath, aReader); break; case Clusters::NetworkCommissioning::Id: - Clusters::NetworkCommissioning::DispatchClientCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::NetworkCommissioning::DispatchClientCommand(apCommandObj, commandPath, aReader); break; case Clusters::OtaSoftwareUpdateProvider::Id: - Clusters::OtaSoftwareUpdateProvider::DispatchClientCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::OtaSoftwareUpdateProvider::DispatchClientCommand(apCommandObj, commandPath, aReader); break; case Clusters::OperationalCredentials::Id: - Clusters::OperationalCredentials::DispatchClientCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::OperationalCredentials::DispatchClientCommand(apCommandObj, commandPath, aReader); break; case Clusters::Scenes::Id: - Clusters::Scenes::DispatchClientCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::Scenes::DispatchClientCommand(apCommandObj, commandPath, aReader); break; case Clusters::TvChannel::Id: - Clusters::TvChannel::DispatchClientCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::TvChannel::DispatchClientCommand(apCommandObj, commandPath, aReader); break; case Clusters::TargetNavigator::Id: - Clusters::TargetNavigator::DispatchClientCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::TargetNavigator::DispatchClientCommand(apCommandObj, commandPath, aReader); break; case Clusters::TestCluster::Id: - Clusters::TestCluster::DispatchClientCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::TestCluster::DispatchClientCommand(apCommandObj, commandPath, aReader); break; default: // Unrecognized cluster ID, error status will apply. diff --git a/zzz_generated/lighting-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/lighting-app/zap-generated/IMClusterCommandHandler.cpp index 6a15f05bdc8a3f..9d22387db2358a 100644 --- a/zzz_generated/lighting-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/lighting-app/zap-generated/IMClusterCommandHandler.cpp @@ -23,6 +23,7 @@ #include "app/util/util.h" #include #include +#include #include #include @@ -35,15 +36,16 @@ namespace chip { namespace app { namespace { -void ReportCommandUnsupported(Command * aCommandObj, EndpointId aEndpointId, ClusterId aClusterId, CommandId aCommandId) +void ReportCommandUnsupported(Command * aCommandObj, const ConcreteCommandPath & aCommandPath) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - aClusterId, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + aCommandPath.mClusterId, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; aCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kNotFound, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandId), - ChipLogValueMEI(aClusterId)); + ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, + ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); } } // anonymous namespace @@ -53,7 +55,7 @@ namespace Clusters { namespace AdministratorCommissioning { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -66,9 +68,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::OpenBasicCommissioningWindow::Id: { + Commands::OpenBasicCommissioningWindow::DecodableType commandData; expectArgumentCount = 1; uint16_t CommissioningTimeout; bool argExists[1]; @@ -122,12 +125,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfAdministratorCommissioningClusterOpenBasicCommissioningWindowCallback(aEndpointId, apCommandObj, - CommissioningTimeout); + wasHandled = emberAfAdministratorCommissioningClusterOpenBasicCommissioningWindowCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CommissioningTimeout, commandData); } break; } case Commands::OpenCommissioningWindow::Id: { + Commands::OpenCommissioningWindow::DecodableType commandData; expectArgumentCount = 6; uint16_t CommissioningTimeout; chip::ByteSpan PAKEVerifier; @@ -202,18 +206,21 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 6 == validArgumentCount) { wasHandled = emberAfAdministratorCommissioningClusterOpenCommissioningWindowCallback( - aEndpointId, apCommandObj, CommissioningTimeout, PAKEVerifier, Discriminator, Iterations, Salt, PasscodeID); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CommissioningTimeout, PAKEVerifier, Discriminator, + Iterations, Salt, PasscodeID, commandData); } break; } case Commands::RevokeCommissioning::Id: { + Commands::RevokeCommissioning::DecodableType commandData; - wasHandled = emberAfAdministratorCommissioningClusterRevokeCommissioningCallback(aEndpointId, apCommandObj); + wasHandled = emberAfAdministratorCommissioningClusterRevokeCommissioningCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, AdministratorCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -221,9 +228,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - AdministratorCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + AdministratorCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -241,7 +249,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace ColorControl { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -254,9 +262,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ColorLoopSet::Id: { + Commands::ColorLoopSet::DecodableType commandData; expectArgumentCount = 7; uint8_t updateFlags; uint8_t action; @@ -334,12 +343,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 7 == validArgumentCount) { - wasHandled = emberAfColorControlClusterColorLoopSetCallback( - aEndpointId, apCommandObj, updateFlags, action, direction, time, startHue, optionsMask, optionsOverride); + wasHandled = emberAfColorControlClusterColorLoopSetCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + updateFlags, action, direction, time, startHue, + optionsMask, optionsOverride, commandData); } break; } case Commands::EnhancedMoveHue::Id: { + Commands::EnhancedMoveHue::DecodableType commandData; expectArgumentCount = 4; uint8_t moveMode; uint16_t rate; @@ -405,12 +416,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfColorControlClusterEnhancedMoveHueCallback(aEndpointId, apCommandObj, moveMode, rate, - optionsMask, optionsOverride); + wasHandled = + emberAfColorControlClusterEnhancedMoveHueCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + moveMode, rate, optionsMask, optionsOverride, commandData); } break; } case Commands::EnhancedMoveToHue::Id: { + Commands::EnhancedMoveToHue::DecodableType commandData; expectArgumentCount = 5; uint16_t enhancedHue; uint8_t direction; @@ -480,12 +493,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfColorControlClusterEnhancedMoveToHueCallback(aEndpointId, apCommandObj, enhancedHue, direction, - transitionTime, optionsMask, optionsOverride); + wasHandled = emberAfColorControlClusterEnhancedMoveToHueCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, enhancedHue, direction, transitionTime, optionsMask, + optionsOverride, commandData); } break; } case Commands::EnhancedMoveToHueAndSaturation::Id: { + Commands::EnhancedMoveToHueAndSaturation::DecodableType commandData; expectArgumentCount = 5; uint16_t enhancedHue; uint8_t saturation; @@ -556,11 +571,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { wasHandled = emberAfColorControlClusterEnhancedMoveToHueAndSaturationCallback( - aEndpointId, apCommandObj, enhancedHue, saturation, transitionTime, optionsMask, optionsOverride); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, enhancedHue, saturation, transitionTime, optionsMask, + optionsOverride, commandData); } break; } case Commands::EnhancedStepHue::Id: { + Commands::EnhancedStepHue::DecodableType commandData; expectArgumentCount = 5; uint8_t stepMode; uint16_t stepSize; @@ -630,12 +647,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfColorControlClusterEnhancedStepHueCallback(aEndpointId, apCommandObj, stepMode, stepSize, - transitionTime, optionsMask, optionsOverride); + wasHandled = emberAfColorControlClusterEnhancedStepHueCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + stepMode, stepSize, transitionTime, optionsMask, + optionsOverride, commandData); } break; } case Commands::MoveColor::Id: { + Commands::MoveColor::DecodableType commandData; expectArgumentCount = 4; int16_t rateX; int16_t rateY; @@ -701,12 +720,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfColorControlClusterMoveColorCallback(aEndpointId, apCommandObj, rateX, rateY, optionsMask, - optionsOverride); + wasHandled = emberAfColorControlClusterMoveColorCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + rateX, rateY, optionsMask, optionsOverride, commandData); } break; } case Commands::MoveColorTemperature::Id: { + Commands::MoveColorTemperature::DecodableType commandData; expectArgumentCount = 6; uint8_t moveMode; uint16_t rate; @@ -781,12 +801,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 6 == validArgumentCount) { wasHandled = emberAfColorControlClusterMoveColorTemperatureCallback( - aEndpointId, apCommandObj, moveMode, rate, colorTemperatureMinimum, colorTemperatureMaximum, optionsMask, - optionsOverride); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, moveMode, rate, colorTemperatureMinimum, + colorTemperatureMaximum, optionsMask, optionsOverride, commandData); } break; } case Commands::MoveHue::Id: { + Commands::MoveHue::DecodableType commandData; expectArgumentCount = 4; uint8_t moveMode; uint8_t rate; @@ -852,12 +873,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfColorControlClusterMoveHueCallback(aEndpointId, apCommandObj, moveMode, rate, optionsMask, - optionsOverride); + wasHandled = emberAfColorControlClusterMoveHueCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + moveMode, rate, optionsMask, optionsOverride, commandData); } break; } case Commands::MoveSaturation::Id: { + Commands::MoveSaturation::DecodableType commandData; expectArgumentCount = 4; uint8_t moveMode; uint8_t rate; @@ -923,12 +945,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfColorControlClusterMoveSaturationCallback(aEndpointId, apCommandObj, moveMode, rate, - optionsMask, optionsOverride); + wasHandled = + emberAfColorControlClusterMoveSaturationCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, moveMode, + rate, optionsMask, optionsOverride, commandData); } break; } case Commands::MoveToColor::Id: { + Commands::MoveToColor::DecodableType commandData; expectArgumentCount = 5; uint16_t colorX; uint16_t colorY; @@ -998,12 +1022,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfColorControlClusterMoveToColorCallback(aEndpointId, apCommandObj, colorX, colorY, - transitionTime, optionsMask, optionsOverride); + wasHandled = emberAfColorControlClusterMoveToColorCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + colorX, colorY, transitionTime, optionsMask, + optionsOverride, commandData); } break; } case Commands::MoveToColorTemperature::Id: { + Commands::MoveToColorTemperature::DecodableType commandData; expectArgumentCount = 4; uint16_t colorTemperature; uint16_t transitionTime; @@ -1069,12 +1095,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfColorControlClusterMoveToColorTemperatureCallback(aEndpointId, apCommandObj, colorTemperature, - transitionTime, optionsMask, optionsOverride); + wasHandled = emberAfColorControlClusterMoveToColorTemperatureCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, colorTemperature, transitionTime, optionsMask, + optionsOverride, commandData); } break; } case Commands::MoveToHue::Id: { + Commands::MoveToHue::DecodableType commandData; expectArgumentCount = 5; uint8_t hue; uint8_t direction; @@ -1144,12 +1172,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfColorControlClusterMoveToHueCallback(aEndpointId, apCommandObj, hue, direction, transitionTime, - optionsMask, optionsOverride); + wasHandled = emberAfColorControlClusterMoveToHueCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, hue, + direction, transitionTime, optionsMask, optionsOverride, + commandData); } break; } case Commands::MoveToHueAndSaturation::Id: { + Commands::MoveToHueAndSaturation::DecodableType commandData; expectArgumentCount = 5; uint8_t hue; uint8_t saturation; @@ -1219,12 +1249,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfColorControlClusterMoveToHueAndSaturationCallback(aEndpointId, apCommandObj, hue, saturation, - transitionTime, optionsMask, optionsOverride); + wasHandled = emberAfColorControlClusterMoveToHueAndSaturationCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, hue, saturation, transitionTime, optionsMask, + optionsOverride, commandData); } break; } case Commands::MoveToSaturation::Id: { + Commands::MoveToSaturation::DecodableType commandData; expectArgumentCount = 4; uint8_t saturation; uint16_t transitionTime; @@ -1290,12 +1322,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfColorControlClusterMoveToSaturationCallback(aEndpointId, apCommandObj, saturation, - transitionTime, optionsMask, optionsOverride); + wasHandled = emberAfColorControlClusterMoveToSaturationCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, saturation, transitionTime, optionsMask, optionsOverride, + commandData); } break; } case Commands::StepColor::Id: { + Commands::StepColor::DecodableType commandData; expectArgumentCount = 5; int16_t stepX; int16_t stepY; @@ -1365,12 +1399,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfColorControlClusterStepColorCallback(aEndpointId, apCommandObj, stepX, stepY, transitionTime, - optionsMask, optionsOverride); + wasHandled = + emberAfColorControlClusterStepColorCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, stepX, stepY, + transitionTime, optionsMask, optionsOverride, commandData); } break; } case Commands::StepColorTemperature::Id: { + Commands::StepColorTemperature::DecodableType commandData; expectArgumentCount = 7; uint8_t stepMode; uint16_t stepSize; @@ -1449,12 +1485,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 7 == validArgumentCount) { wasHandled = emberAfColorControlClusterStepColorTemperatureCallback( - aEndpointId, apCommandObj, stepMode, stepSize, transitionTime, colorTemperatureMinimum, colorTemperatureMaximum, - optionsMask, optionsOverride); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, stepMode, stepSize, transitionTime, + colorTemperatureMinimum, colorTemperatureMaximum, optionsMask, optionsOverride, commandData); } break; } case Commands::StepHue::Id: { + Commands::StepHue::DecodableType commandData; expectArgumentCount = 5; uint8_t stepMode; uint8_t stepSize; @@ -1524,12 +1561,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfColorControlClusterStepHueCallback(aEndpointId, apCommandObj, stepMode, stepSize, - transitionTime, optionsMask, optionsOverride); + wasHandled = + emberAfColorControlClusterStepHueCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, stepMode, + stepSize, transitionTime, optionsMask, optionsOverride, commandData); } break; } case Commands::StepSaturation::Id: { + Commands::StepSaturation::DecodableType commandData; expectArgumentCount = 5; uint8_t stepMode; uint8_t stepSize; @@ -1599,12 +1638,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfColorControlClusterStepSaturationCallback(aEndpointId, apCommandObj, stepMode, stepSize, - transitionTime, optionsMask, optionsOverride); + wasHandled = emberAfColorControlClusterStepSaturationCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + stepMode, stepSize, transitionTime, optionsMask, + optionsOverride, commandData); } break; } case Commands::StopMoveStep::Id: { + Commands::StopMoveStep::DecodableType commandData; expectArgumentCount = 2; uint8_t optionsMask; uint8_t optionsOverride; @@ -1662,14 +1703,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = - emberAfColorControlClusterStopMoveStepCallback(aEndpointId, apCommandObj, optionsMask, optionsOverride); + wasHandled = emberAfColorControlClusterStopMoveStepCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + optionsMask, optionsOverride, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, ColorControl::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -1677,9 +1718,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - ColorControl::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + ColorControl::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -1697,7 +1738,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace DiagnosticLogs { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -1710,9 +1751,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::RetrieveLogsRequest::Id: { + Commands::RetrieveLogsRequest::DecodableType commandData; expectArgumentCount = 3; uint8_t intent; uint8_t requestedProtocol; @@ -1774,14 +1816,15 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfDiagnosticLogsClusterRetrieveLogsRequestCallback(aEndpointId, apCommandObj, intent, - requestedProtocol, transferFileDesignator); + wasHandled = emberAfDiagnosticLogsClusterRetrieveLogsRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, intent, requestedProtocol, transferFileDesignator, + commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, DiagnosticLogs::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -1789,9 +1832,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - DiagnosticLogs::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + DiagnosticLogs::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -1809,7 +1852,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace EthernetNetworkDiagnostics { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -1822,16 +1865,18 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ResetCounts::Id: { + Commands::ResetCounts::DecodableType commandData; - wasHandled = emberAfEthernetNetworkDiagnosticsClusterResetCountsCallback(aEndpointId, apCommandObj); + wasHandled = emberAfEthernetNetworkDiagnosticsClusterResetCountsCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, EthernetNetworkDiagnostics::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -1839,9 +1884,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - EthernetNetworkDiagnostics::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + EthernetNetworkDiagnostics::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -1859,7 +1905,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace GeneralCommissioning { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -1872,9 +1918,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ArmFailSafe::Id: { + Commands::ArmFailSafe::DecodableType commandData; expectArgumentCount = 3; uint16_t expiryLengthSeconds; uint64_t breadcrumb; @@ -1936,17 +1983,20 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfGeneralCommissioningClusterArmFailSafeCallback(aEndpointId, apCommandObj, expiryLengthSeconds, - breadcrumb, timeoutMs); + wasHandled = emberAfGeneralCommissioningClusterArmFailSafeCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, expiryLengthSeconds, breadcrumb, timeoutMs, commandData); } break; } case Commands::CommissioningComplete::Id: { + Commands::CommissioningComplete::DecodableType commandData; - wasHandled = emberAfGeneralCommissioningClusterCommissioningCompleteCallback(aEndpointId, apCommandObj); + wasHandled = emberAfGeneralCommissioningClusterCommissioningCompleteCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, commandData); break; } case Commands::SetRegulatoryConfig::Id: { + Commands::SetRegulatoryConfig::DecodableType commandData; expectArgumentCount = 4; uint8_t location; const uint8_t * countryCode; @@ -2014,13 +2064,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { wasHandled = emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback( - aEndpointId, apCommandObj, location, const_cast(countryCode), breadcrumb, timeoutMs); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, location, const_cast(countryCode), breadcrumb, + timeoutMs, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, GeneralCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -2028,9 +2079,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - GeneralCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + GeneralCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -2048,7 +2100,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace LevelControl { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -2061,9 +2113,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::Move::Id: { + Commands::Move::DecodableType commandData; expectArgumentCount = 4; uint8_t moveMode; uint8_t rate; @@ -2129,12 +2182,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = - emberAfLevelControlClusterMoveCallback(aEndpointId, apCommandObj, moveMode, rate, optionMask, optionOverride); + wasHandled = emberAfLevelControlClusterMoveCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, moveMode, + rate, optionMask, optionOverride, commandData); } break; } case Commands::MoveToLevel::Id: { + Commands::MoveToLevel::DecodableType commandData; expectArgumentCount = 4; uint8_t level; uint16_t transitionTime; @@ -2200,12 +2254,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfLevelControlClusterMoveToLevelCallback(aEndpointId, apCommandObj, level, transitionTime, - optionMask, optionOverride); + wasHandled = + emberAfLevelControlClusterMoveToLevelCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, level, + transitionTime, optionMask, optionOverride, commandData); } break; } case Commands::MoveToLevelWithOnOff::Id: { + Commands::MoveToLevelWithOnOff::DecodableType commandData; expectArgumentCount = 2; uint8_t level; uint16_t transitionTime; @@ -2263,12 +2319,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = - emberAfLevelControlClusterMoveToLevelWithOnOffCallback(aEndpointId, apCommandObj, level, transitionTime); + wasHandled = emberAfLevelControlClusterMoveToLevelWithOnOffCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, level, transitionTime, commandData); } break; } case Commands::MoveWithOnOff::Id: { + Commands::MoveWithOnOff::DecodableType commandData; expectArgumentCount = 2; uint8_t moveMode; uint8_t rate; @@ -2326,11 +2383,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfLevelControlClusterMoveWithOnOffCallback(aEndpointId, apCommandObj, moveMode, rate); + wasHandled = emberAfLevelControlClusterMoveWithOnOffCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + moveMode, rate, commandData); } break; } case Commands::Step::Id: { + Commands::Step::DecodableType commandData; expectArgumentCount = 5; uint8_t stepMode; uint8_t stepSize; @@ -2400,12 +2459,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfLevelControlClusterStepCallback(aEndpointId, apCommandObj, stepMode, stepSize, transitionTime, - optionMask, optionOverride); + wasHandled = + emberAfLevelControlClusterStepCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, stepMode, stepSize, + transitionTime, optionMask, optionOverride, commandData); } break; } case Commands::StepWithOnOff::Id: { + Commands::StepWithOnOff::DecodableType commandData; expectArgumentCount = 3; uint8_t stepMode; uint8_t stepSize; @@ -2467,12 +2528,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = - emberAfLevelControlClusterStepWithOnOffCallback(aEndpointId, apCommandObj, stepMode, stepSize, transitionTime); + wasHandled = emberAfLevelControlClusterStepWithOnOffCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + stepMode, stepSize, transitionTime, commandData); } break; } case Commands::Stop::Id: { + Commands::Stop::DecodableType commandData; expectArgumentCount = 2; uint8_t optionMask; uint8_t optionOverride; @@ -2530,18 +2592,21 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfLevelControlClusterStopCallback(aEndpointId, apCommandObj, optionMask, optionOverride); + wasHandled = emberAfLevelControlClusterStopCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + optionMask, optionOverride, commandData); } break; } case Commands::StopWithOnOff::Id: { + Commands::StopWithOnOff::DecodableType commandData; - wasHandled = emberAfLevelControlClusterStopWithOnOffCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfLevelControlClusterStopWithOnOffCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, LevelControl::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -2549,9 +2614,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - LevelControl::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + LevelControl::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -2569,7 +2634,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace NetworkCommissioning { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -2582,9 +2647,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::AddThreadNetwork::Id: { + Commands::AddThreadNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan operationalDataset; uint64_t breadcrumb; @@ -2646,12 +2712,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterAddThreadNetworkCallback(aEndpointId, apCommandObj, - operationalDataset, breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterAddThreadNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, operationalDataset, breadcrumb, timeoutMs, commandData); } break; } case Commands::AddWiFiNetwork::Id: { + Commands::AddWiFiNetwork::DecodableType commandData; expectArgumentCount = 4; chip::ByteSpan ssid; chip::ByteSpan credentials; @@ -2717,12 +2784,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterAddWiFiNetworkCallback(aEndpointId, apCommandObj, ssid, credentials, - breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterAddWiFiNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, ssid, credentials, breadcrumb, timeoutMs, commandData); } break; } case Commands::DisableNetwork::Id: { + Commands::DisableNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan networkID; uint64_t breadcrumb; @@ -2784,12 +2852,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterDisableNetworkCallback(aEndpointId, apCommandObj, networkID, - breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterDisableNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, networkID, breadcrumb, timeoutMs, commandData); } break; } case Commands::EnableNetwork::Id: { + Commands::EnableNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan networkID; uint64_t breadcrumb; @@ -2851,12 +2920,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterEnableNetworkCallback(aEndpointId, apCommandObj, networkID, - breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterEnableNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, networkID, breadcrumb, timeoutMs, commandData); } break; } case Commands::GetLastNetworkCommissioningResult::Id: { + Commands::GetLastNetworkCommissioningResult::DecodableType commandData; expectArgumentCount = 1; uint32_t timeoutMs; bool argExists[1]; @@ -2910,12 +2980,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback(aEndpointId, apCommandObj, - timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, timeoutMs, commandData); } break; } case Commands::RemoveNetwork::Id: { + Commands::RemoveNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan NetworkID; uint64_t Breadcrumb; @@ -2977,12 +3048,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterRemoveNetworkCallback(aEndpointId, apCommandObj, NetworkID, - Breadcrumb, TimeoutMs); + wasHandled = emberAfNetworkCommissioningClusterRemoveNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, NetworkID, Breadcrumb, TimeoutMs, commandData); } break; } case Commands::ScanNetworks::Id: { + Commands::ScanNetworks::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan ssid; uint64_t breadcrumb; @@ -3044,12 +3116,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = - emberAfNetworkCommissioningClusterScanNetworksCallback(aEndpointId, apCommandObj, ssid, breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterScanNetworksCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, ssid, breadcrumb, timeoutMs, commandData); } break; } case Commands::UpdateThreadNetwork::Id: { + Commands::UpdateThreadNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan operationalDataset; uint64_t breadcrumb; @@ -3112,11 +3185,12 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { wasHandled = emberAfNetworkCommissioningClusterUpdateThreadNetworkCallback( - aEndpointId, apCommandObj, operationalDataset, breadcrumb, timeoutMs); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, operationalDataset, breadcrumb, timeoutMs, commandData); } break; } case Commands::UpdateWiFiNetwork::Id: { + Commands::UpdateWiFiNetwork::DecodableType commandData; expectArgumentCount = 4; chip::ByteSpan ssid; chip::ByteSpan credentials; @@ -3182,14 +3256,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback(aEndpointId, apCommandObj, ssid, - credentials, breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, ssid, credentials, breadcrumb, timeoutMs, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, NetworkCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -3197,9 +3271,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - NetworkCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + NetworkCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -3217,7 +3292,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace OnOff { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -3230,26 +3305,29 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::Off::Id: { + Commands::Off::DecodableType commandData; - wasHandled = emberAfOnOffClusterOffCallback(aEndpointId, apCommandObj); + wasHandled = emberAfOnOffClusterOffCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::On::Id: { + Commands::On::DecodableType commandData; - wasHandled = emberAfOnOffClusterOnCallback(aEndpointId, apCommandObj); + wasHandled = emberAfOnOffClusterOnCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::Toggle::Id: { + Commands::Toggle::DecodableType commandData; - wasHandled = emberAfOnOffClusterToggleCallback(aEndpointId, apCommandObj); + wasHandled = emberAfOnOffClusterToggleCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, OnOff::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -3257,9 +3335,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - OnOff::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + OnOff::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -3277,7 +3355,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace OperationalCredentials { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -3290,9 +3368,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::AddNOC::Id: { + Commands::AddNOC::DecodableType commandData; expectArgumentCount = 5; chip::ByteSpan NOCValue; chip::ByteSpan ICACValue; @@ -3362,12 +3441,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterAddNOCCallback(aEndpointId, apCommandObj, NOCValue, ICACValue, - IPKValue, CaseAdminNode, AdminVendorId); + wasHandled = emberAfOperationalCredentialsClusterAddNOCCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, NOCValue, ICACValue, IPKValue, CaseAdminNode, + AdminVendorId, commandData); } break; } case Commands::AddTrustedRootCertificate::Id: { + Commands::AddTrustedRootCertificate::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan RootCertificate; bool argExists[1]; @@ -3421,12 +3502,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback(aEndpointId, apCommandObj, - RootCertificate); + wasHandled = emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, RootCertificate, commandData); } break; } case Commands::AttestationRequest::Id: { + Commands::AttestationRequest::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan AttestationNonce; bool argExists[1]; @@ -3480,12 +3562,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = - emberAfOperationalCredentialsClusterAttestationRequestCallback(aEndpointId, apCommandObj, AttestationNonce); + wasHandled = emberAfOperationalCredentialsClusterAttestationRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, AttestationNonce, commandData); } break; } case Commands::CertificateChainRequest::Id: { + Commands::CertificateChainRequest::DecodableType commandData; expectArgumentCount = 1; uint8_t CertificateType; bool argExists[1]; @@ -3539,12 +3622,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = - emberAfOperationalCredentialsClusterCertificateChainRequestCallback(aEndpointId, apCommandObj, CertificateType); + wasHandled = emberAfOperationalCredentialsClusterCertificateChainRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CertificateType, commandData); } break; } case Commands::OpCSRRequest::Id: { + Commands::OpCSRRequest::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan CSRNonce; bool argExists[1]; @@ -3598,11 +3682,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterOpCSRRequestCallback(aEndpointId, apCommandObj, CSRNonce); + wasHandled = emberAfOperationalCredentialsClusterOpCSRRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CSRNonce, commandData); } break; } case Commands::RemoveFabric::Id: { + Commands::RemoveFabric::DecodableType commandData; expectArgumentCount = 1; uint8_t FabricIndex; bool argExists[1]; @@ -3656,11 +3742,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterRemoveFabricCallback(aEndpointId, apCommandObj, FabricIndex); + wasHandled = emberAfOperationalCredentialsClusterRemoveFabricCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, FabricIndex, commandData); } break; } case Commands::RemoveTrustedRootCertificate::Id: { + Commands::RemoveTrustedRootCertificate::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan TrustedRootIdentifier; bool argExists[1]; @@ -3714,12 +3802,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterRemoveTrustedRootCertificateCallback(aEndpointId, apCommandObj, - TrustedRootIdentifier); + wasHandled = emberAfOperationalCredentialsClusterRemoveTrustedRootCertificateCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, TrustedRootIdentifier, commandData); } break; } case Commands::UpdateFabricLabel::Id: { + Commands::UpdateFabricLabel::DecodableType commandData; expectArgumentCount = 1; const uint8_t * Label; bool argExists[1]; @@ -3774,12 +3863,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterUpdateFabricLabelCallback(aEndpointId, apCommandObj, - const_cast(Label)); + wasHandled = emberAfOperationalCredentialsClusterUpdateFabricLabelCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, const_cast(Label), commandData); } break; } case Commands::UpdateNOC::Id: { + Commands::UpdateNOC::DecodableType commandData; expectArgumentCount = 2; chip::ByteSpan NOCValue; chip::ByteSpan ICACValue; @@ -3837,13 +3927,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterUpdateNOCCallback(aEndpointId, apCommandObj, NOCValue, ICACValue); + wasHandled = emberAfOperationalCredentialsClusterUpdateNOCCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, NOCValue, ICACValue, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, OperationalCredentials::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -3851,9 +3942,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - OperationalCredentials::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + OperationalCredentials::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -3871,7 +3963,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace SoftwareDiagnostics { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -3884,16 +3976,18 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ResetWatermarks::Id: { + Commands::ResetWatermarks::DecodableType commandData; - wasHandled = emberAfSoftwareDiagnosticsClusterResetWatermarksCallback(aEndpointId, apCommandObj); + wasHandled = emberAfSoftwareDiagnosticsClusterResetWatermarksCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, SoftwareDiagnostics::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -3901,9 +3995,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - SoftwareDiagnostics::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + SoftwareDiagnostics::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -3921,7 +4016,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace ThreadNetworkDiagnostics { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -3934,16 +4029,18 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ResetCounts::Id: { + Commands::ResetCounts::DecodableType commandData; - wasHandled = emberAfThreadNetworkDiagnosticsClusterResetCountsCallback(aEndpointId, apCommandObj); + wasHandled = emberAfThreadNetworkDiagnosticsClusterResetCountsCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, ThreadNetworkDiagnostics::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -3951,9 +4048,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - ThreadNetworkDiagnostics::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + ThreadNetworkDiagnostics::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -3971,7 +4069,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace WiFiNetworkDiagnostics { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -3984,16 +4082,18 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ResetCounts::Id: { + Commands::ResetCounts::DecodableType commandData; - wasHandled = emberAfWiFiNetworkDiagnosticsClusterResetCountsCallback(aEndpointId, apCommandObj); + wasHandled = emberAfWiFiNetworkDiagnosticsClusterResetCountsCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, WiFiNetworkDiagnostics::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -4001,9 +4101,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - WiFiNetworkDiagnostics::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + WiFiNetworkDiagnostics::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -4027,45 +4128,46 @@ void DispatchSingleClusterCommand(ClusterId aClusterId, CommandId aCommandId, En 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); TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); switch (aClusterId) { case Clusters::AdministratorCommissioning::Id: - Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::ColorControl::Id: - Clusters::ColorControl::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::ColorControl::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::DiagnosticLogs::Id: - Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::EthernetNetworkDiagnostics::Id: - Clusters::EthernetNetworkDiagnostics::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::EthernetNetworkDiagnostics::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::GeneralCommissioning::Id: - Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::LevelControl::Id: - Clusters::LevelControl::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::LevelControl::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::NetworkCommissioning::Id: - Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::OnOff::Id: - Clusters::OnOff::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::OnOff::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::OperationalCredentials::Id: - Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::SoftwareDiagnostics::Id: - Clusters::SoftwareDiagnostics::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::SoftwareDiagnostics::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::ThreadNetworkDiagnostics::Id: - Clusters::ThreadNetworkDiagnostics::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::ThreadNetworkDiagnostics::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::WiFiNetworkDiagnostics::Id: - Clusters::WiFiNetworkDiagnostics::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::WiFiNetworkDiagnostics::DispatchServerCommand(apCommandObj, commandPath, aReader); break; default: // Unrecognized cluster ID, error status will apply. @@ -4088,6 +4190,7 @@ void DispatchSingleClusterResponseCommand(ClusterId aClusterId, CommandId aComma 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); TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); switch (aClusterId) diff --git a/zzz_generated/lock-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/lock-app/zap-generated/IMClusterCommandHandler.cpp index d1f7ee59af1472..a178a5001e5bb8 100644 --- a/zzz_generated/lock-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/lock-app/zap-generated/IMClusterCommandHandler.cpp @@ -23,6 +23,7 @@ #include "app/util/util.h" #include #include +#include #include #include @@ -35,15 +36,16 @@ namespace chip { namespace app { namespace { -void ReportCommandUnsupported(Command * aCommandObj, EndpointId aEndpointId, ClusterId aClusterId, CommandId aCommandId) +void ReportCommandUnsupported(Command * aCommandObj, const ConcreteCommandPath & aCommandPath) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - aClusterId, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + aCommandPath.mClusterId, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; aCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kNotFound, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandId), - ChipLogValueMEI(aClusterId)); + ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, + ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); } } // anonymous namespace @@ -53,7 +55,7 @@ namespace Clusters { namespace AdministratorCommissioning { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -66,9 +68,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::OpenBasicCommissioningWindow::Id: { + Commands::OpenBasicCommissioningWindow::DecodableType commandData; expectArgumentCount = 1; uint16_t CommissioningTimeout; bool argExists[1]; @@ -122,12 +125,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfAdministratorCommissioningClusterOpenBasicCommissioningWindowCallback(aEndpointId, apCommandObj, - CommissioningTimeout); + wasHandled = emberAfAdministratorCommissioningClusterOpenBasicCommissioningWindowCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CommissioningTimeout, commandData); } break; } case Commands::OpenCommissioningWindow::Id: { + Commands::OpenCommissioningWindow::DecodableType commandData; expectArgumentCount = 6; uint16_t CommissioningTimeout; chip::ByteSpan PAKEVerifier; @@ -202,18 +206,21 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 6 == validArgumentCount) { wasHandled = emberAfAdministratorCommissioningClusterOpenCommissioningWindowCallback( - aEndpointId, apCommandObj, CommissioningTimeout, PAKEVerifier, Discriminator, Iterations, Salt, PasscodeID); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CommissioningTimeout, PAKEVerifier, Discriminator, + Iterations, Salt, PasscodeID, commandData); } break; } case Commands::RevokeCommissioning::Id: { + Commands::RevokeCommissioning::DecodableType commandData; - wasHandled = emberAfAdministratorCommissioningClusterRevokeCommissioningCallback(aEndpointId, apCommandObj); + wasHandled = emberAfAdministratorCommissioningClusterRevokeCommissioningCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, AdministratorCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -221,9 +228,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - AdministratorCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + AdministratorCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -241,7 +249,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace DiagnosticLogs { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -254,9 +262,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::RetrieveLogsRequest::Id: { + Commands::RetrieveLogsRequest::DecodableType commandData; expectArgumentCount = 3; uint8_t intent; uint8_t requestedProtocol; @@ -318,14 +327,15 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfDiagnosticLogsClusterRetrieveLogsRequestCallback(aEndpointId, apCommandObj, intent, - requestedProtocol, transferFileDesignator); + wasHandled = emberAfDiagnosticLogsClusterRetrieveLogsRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, intent, requestedProtocol, transferFileDesignator, + commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, DiagnosticLogs::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -333,9 +343,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - DiagnosticLogs::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + DiagnosticLogs::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -353,7 +363,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace GeneralCommissioning { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -366,9 +376,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ArmFailSafe::Id: { + Commands::ArmFailSafe::DecodableType commandData; expectArgumentCount = 3; uint16_t expiryLengthSeconds; uint64_t breadcrumb; @@ -430,17 +441,20 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfGeneralCommissioningClusterArmFailSafeCallback(aEndpointId, apCommandObj, expiryLengthSeconds, - breadcrumb, timeoutMs); + wasHandled = emberAfGeneralCommissioningClusterArmFailSafeCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, expiryLengthSeconds, breadcrumb, timeoutMs, commandData); } break; } case Commands::CommissioningComplete::Id: { + Commands::CommissioningComplete::DecodableType commandData; - wasHandled = emberAfGeneralCommissioningClusterCommissioningCompleteCallback(aEndpointId, apCommandObj); + wasHandled = emberAfGeneralCommissioningClusterCommissioningCompleteCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, commandData); break; } case Commands::SetRegulatoryConfig::Id: { + Commands::SetRegulatoryConfig::DecodableType commandData; expectArgumentCount = 4; uint8_t location; const uint8_t * countryCode; @@ -508,13 +522,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { wasHandled = emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback( - aEndpointId, apCommandObj, location, const_cast(countryCode), breadcrumb, timeoutMs); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, location, const_cast(countryCode), breadcrumb, + timeoutMs, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, GeneralCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -522,9 +537,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - GeneralCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + GeneralCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -542,7 +558,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace NetworkCommissioning { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -555,9 +571,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::AddThreadNetwork::Id: { + Commands::AddThreadNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan operationalDataset; uint64_t breadcrumb; @@ -619,12 +636,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterAddThreadNetworkCallback(aEndpointId, apCommandObj, - operationalDataset, breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterAddThreadNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, operationalDataset, breadcrumb, timeoutMs, commandData); } break; } case Commands::AddWiFiNetwork::Id: { + Commands::AddWiFiNetwork::DecodableType commandData; expectArgumentCount = 4; chip::ByteSpan ssid; chip::ByteSpan credentials; @@ -690,12 +708,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterAddWiFiNetworkCallback(aEndpointId, apCommandObj, ssid, credentials, - breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterAddWiFiNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, ssid, credentials, breadcrumb, timeoutMs, commandData); } break; } case Commands::DisableNetwork::Id: { + Commands::DisableNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan networkID; uint64_t breadcrumb; @@ -757,12 +776,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterDisableNetworkCallback(aEndpointId, apCommandObj, networkID, - breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterDisableNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, networkID, breadcrumb, timeoutMs, commandData); } break; } case Commands::EnableNetwork::Id: { + Commands::EnableNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan networkID; uint64_t breadcrumb; @@ -824,12 +844,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterEnableNetworkCallback(aEndpointId, apCommandObj, networkID, - breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterEnableNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, networkID, breadcrumb, timeoutMs, commandData); } break; } case Commands::GetLastNetworkCommissioningResult::Id: { + Commands::GetLastNetworkCommissioningResult::DecodableType commandData; expectArgumentCount = 1; uint32_t timeoutMs; bool argExists[1]; @@ -883,12 +904,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback(aEndpointId, apCommandObj, - timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, timeoutMs, commandData); } break; } case Commands::RemoveNetwork::Id: { + Commands::RemoveNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan NetworkID; uint64_t Breadcrumb; @@ -950,12 +972,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterRemoveNetworkCallback(aEndpointId, apCommandObj, NetworkID, - Breadcrumb, TimeoutMs); + wasHandled = emberAfNetworkCommissioningClusterRemoveNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, NetworkID, Breadcrumb, TimeoutMs, commandData); } break; } case Commands::ScanNetworks::Id: { + Commands::ScanNetworks::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan ssid; uint64_t breadcrumb; @@ -1017,12 +1040,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = - emberAfNetworkCommissioningClusterScanNetworksCallback(aEndpointId, apCommandObj, ssid, breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterScanNetworksCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, ssid, breadcrumb, timeoutMs, commandData); } break; } case Commands::UpdateThreadNetwork::Id: { + Commands::UpdateThreadNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan operationalDataset; uint64_t breadcrumb; @@ -1085,11 +1109,12 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { wasHandled = emberAfNetworkCommissioningClusterUpdateThreadNetworkCallback( - aEndpointId, apCommandObj, operationalDataset, breadcrumb, timeoutMs); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, operationalDataset, breadcrumb, timeoutMs, commandData); } break; } case Commands::UpdateWiFiNetwork::Id: { + Commands::UpdateWiFiNetwork::DecodableType commandData; expectArgumentCount = 4; chip::ByteSpan ssid; chip::ByteSpan credentials; @@ -1155,14 +1180,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback(aEndpointId, apCommandObj, ssid, - credentials, breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, ssid, credentials, breadcrumb, timeoutMs, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, NetworkCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -1170,9 +1195,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - NetworkCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + NetworkCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -1190,7 +1216,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace OnOff { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -1203,26 +1229,29 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::Off::Id: { + Commands::Off::DecodableType commandData; - wasHandled = emberAfOnOffClusterOffCallback(aEndpointId, apCommandObj); + wasHandled = emberAfOnOffClusterOffCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::On::Id: { + Commands::On::DecodableType commandData; - wasHandled = emberAfOnOffClusterOnCallback(aEndpointId, apCommandObj); + wasHandled = emberAfOnOffClusterOnCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::Toggle::Id: { + Commands::Toggle::DecodableType commandData; - wasHandled = emberAfOnOffClusterToggleCallback(aEndpointId, apCommandObj); + wasHandled = emberAfOnOffClusterToggleCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, OnOff::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -1230,9 +1259,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - OnOff::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + OnOff::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -1250,7 +1279,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace OperationalCredentials { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -1263,9 +1292,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::AddNOC::Id: { + Commands::AddNOC::DecodableType commandData; expectArgumentCount = 5; chip::ByteSpan NOCValue; chip::ByteSpan ICACValue; @@ -1335,12 +1365,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterAddNOCCallback(aEndpointId, apCommandObj, NOCValue, ICACValue, - IPKValue, CaseAdminNode, AdminVendorId); + wasHandled = emberAfOperationalCredentialsClusterAddNOCCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, NOCValue, ICACValue, IPKValue, CaseAdminNode, + AdminVendorId, commandData); } break; } case Commands::AddTrustedRootCertificate::Id: { + Commands::AddTrustedRootCertificate::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan RootCertificate; bool argExists[1]; @@ -1394,12 +1426,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback(aEndpointId, apCommandObj, - RootCertificate); + wasHandled = emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, RootCertificate, commandData); } break; } case Commands::AttestationRequest::Id: { + Commands::AttestationRequest::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan AttestationNonce; bool argExists[1]; @@ -1453,12 +1486,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = - emberAfOperationalCredentialsClusterAttestationRequestCallback(aEndpointId, apCommandObj, AttestationNonce); + wasHandled = emberAfOperationalCredentialsClusterAttestationRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, AttestationNonce, commandData); } break; } case Commands::CertificateChainRequest::Id: { + Commands::CertificateChainRequest::DecodableType commandData; expectArgumentCount = 1; uint8_t CertificateType; bool argExists[1]; @@ -1512,12 +1546,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = - emberAfOperationalCredentialsClusterCertificateChainRequestCallback(aEndpointId, apCommandObj, CertificateType); + wasHandled = emberAfOperationalCredentialsClusterCertificateChainRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CertificateType, commandData); } break; } case Commands::OpCSRRequest::Id: { + Commands::OpCSRRequest::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan CSRNonce; bool argExists[1]; @@ -1571,11 +1606,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterOpCSRRequestCallback(aEndpointId, apCommandObj, CSRNonce); + wasHandled = emberAfOperationalCredentialsClusterOpCSRRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CSRNonce, commandData); } break; } case Commands::RemoveFabric::Id: { + Commands::RemoveFabric::DecodableType commandData; expectArgumentCount = 1; uint8_t FabricIndex; bool argExists[1]; @@ -1629,11 +1666,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterRemoveFabricCallback(aEndpointId, apCommandObj, FabricIndex); + wasHandled = emberAfOperationalCredentialsClusterRemoveFabricCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, FabricIndex, commandData); } break; } case Commands::RemoveTrustedRootCertificate::Id: { + Commands::RemoveTrustedRootCertificate::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan TrustedRootIdentifier; bool argExists[1]; @@ -1687,12 +1726,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterRemoveTrustedRootCertificateCallback(aEndpointId, apCommandObj, - TrustedRootIdentifier); + wasHandled = emberAfOperationalCredentialsClusterRemoveTrustedRootCertificateCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, TrustedRootIdentifier, commandData); } break; } case Commands::UpdateFabricLabel::Id: { + Commands::UpdateFabricLabel::DecodableType commandData; expectArgumentCount = 1; const uint8_t * Label; bool argExists[1]; @@ -1747,12 +1787,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterUpdateFabricLabelCallback(aEndpointId, apCommandObj, - const_cast(Label)); + wasHandled = emberAfOperationalCredentialsClusterUpdateFabricLabelCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, const_cast(Label), commandData); } break; } case Commands::UpdateNOC::Id: { + Commands::UpdateNOC::DecodableType commandData; expectArgumentCount = 2; chip::ByteSpan NOCValue; chip::ByteSpan ICACValue; @@ -1810,13 +1851,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterUpdateNOCCallback(aEndpointId, apCommandObj, NOCValue, ICACValue); + wasHandled = emberAfOperationalCredentialsClusterUpdateNOCCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, NOCValue, ICACValue, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, OperationalCredentials::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -1824,9 +1866,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - OperationalCredentials::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + OperationalCredentials::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -1850,27 +1893,28 @@ void DispatchSingleClusterCommand(ClusterId aClusterId, CommandId aCommandId, En 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); TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); switch (aClusterId) { case Clusters::AdministratorCommissioning::Id: - Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::DiagnosticLogs::Id: - Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::GeneralCommissioning::Id: - Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::NetworkCommissioning::Id: - Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::OnOff::Id: - Clusters::OnOff::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::OnOff::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::OperationalCredentials::Id: - Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, commandPath, aReader); break; default: // Unrecognized cluster ID, error status will apply. @@ -1893,6 +1937,7 @@ void DispatchSingleClusterResponseCommand(ClusterId aClusterId, CommandId aComma 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); TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); switch (aClusterId) diff --git a/zzz_generated/ota-provider-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/ota-provider-app/zap-generated/IMClusterCommandHandler.cpp index 1cf66c0f03eb99..d012b6d72ce647 100644 --- a/zzz_generated/ota-provider-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/ota-provider-app/zap-generated/IMClusterCommandHandler.cpp @@ -23,6 +23,7 @@ #include "app/util/util.h" #include #include +#include #include #include @@ -35,15 +36,16 @@ namespace chip { namespace app { namespace { -void ReportCommandUnsupported(Command * aCommandObj, EndpointId aEndpointId, ClusterId aClusterId, CommandId aCommandId) +void ReportCommandUnsupported(Command * aCommandObj, const ConcreteCommandPath & aCommandPath) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - aClusterId, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + aCommandPath.mClusterId, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; aCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kNotFound, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandId), - ChipLogValueMEI(aClusterId)); + ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, + ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); } } // anonymous namespace @@ -53,7 +55,7 @@ namespace Clusters { namespace OtaSoftwareUpdateProvider { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -66,9 +68,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ApplyUpdateRequest::Id: { + Commands::ApplyUpdateRequest::DecodableType commandData; expectArgumentCount = 2; chip::ByteSpan updateToken; uint32_t newVersion; @@ -126,12 +129,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestCallback(aEndpointId, apCommandObj, - updateToken, newVersion); + wasHandled = emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, updateToken, newVersion, commandData); } break; } case Commands::NotifyUpdateApplied::Id: { + Commands::NotifyUpdateApplied::DecodableType commandData; expectArgumentCount = 2; chip::ByteSpan updateToken; uint32_t softwareVersion; @@ -189,12 +193,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedCallback(aEndpointId, apCommandObj, - updateToken, softwareVersion); + wasHandled = emberAfOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, updateToken, softwareVersion, commandData); } break; } case Commands::QueryImage::Id: { + Commands::QueryImage::DecodableType commandData; expectArgumentCount = 8; uint16_t vendorId; uint16_t productId; @@ -278,14 +283,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 8 == validArgumentCount) { wasHandled = emberAfOtaSoftwareUpdateProviderClusterQueryImageCallback( - aEndpointId, apCommandObj, vendorId, productId, hardwareVersion, softwareVersion, protocolsSupported, - const_cast(location), requestorCanConsent, metadataForProvider); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, vendorId, productId, hardwareVersion, softwareVersion, + protocolsSupported, const_cast(location), requestorCanConsent, metadataForProvider, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, OtaSoftwareUpdateProvider::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -293,9 +298,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - OtaSoftwareUpdateProvider::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + OtaSoftwareUpdateProvider::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -313,7 +319,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace OperationalCredentials { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -326,9 +332,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::AddNOC::Id: { + Commands::AddNOC::DecodableType commandData; expectArgumentCount = 5; chip::ByteSpan NOCValue; chip::ByteSpan ICACValue; @@ -398,12 +405,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterAddNOCCallback(aEndpointId, apCommandObj, NOCValue, ICACValue, - IPKValue, CaseAdminNode, AdminVendorId); + wasHandled = emberAfOperationalCredentialsClusterAddNOCCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, NOCValue, ICACValue, IPKValue, CaseAdminNode, + AdminVendorId, commandData); } break; } case Commands::AddTrustedRootCertificate::Id: { + Commands::AddTrustedRootCertificate::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan RootCertificate; bool argExists[1]; @@ -457,12 +466,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback(aEndpointId, apCommandObj, - RootCertificate); + wasHandled = emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, RootCertificate, commandData); } break; } case Commands::AttestationRequest::Id: { + Commands::AttestationRequest::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan AttestationNonce; bool argExists[1]; @@ -516,12 +526,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = - emberAfOperationalCredentialsClusterAttestationRequestCallback(aEndpointId, apCommandObj, AttestationNonce); + wasHandled = emberAfOperationalCredentialsClusterAttestationRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, AttestationNonce, commandData); } break; } case Commands::CertificateChainRequest::Id: { + Commands::CertificateChainRequest::DecodableType commandData; expectArgumentCount = 1; uint8_t CertificateType; bool argExists[1]; @@ -575,12 +586,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = - emberAfOperationalCredentialsClusterCertificateChainRequestCallback(aEndpointId, apCommandObj, CertificateType); + wasHandled = emberAfOperationalCredentialsClusterCertificateChainRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CertificateType, commandData); } break; } case Commands::OpCSRRequest::Id: { + Commands::OpCSRRequest::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan CSRNonce; bool argExists[1]; @@ -634,11 +646,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterOpCSRRequestCallback(aEndpointId, apCommandObj, CSRNonce); + wasHandled = emberAfOperationalCredentialsClusterOpCSRRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CSRNonce, commandData); } break; } case Commands::RemoveFabric::Id: { + Commands::RemoveFabric::DecodableType commandData; expectArgumentCount = 1; uint8_t FabricIndex; bool argExists[1]; @@ -692,11 +706,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterRemoveFabricCallback(aEndpointId, apCommandObj, FabricIndex); + wasHandled = emberAfOperationalCredentialsClusterRemoveFabricCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, FabricIndex, commandData); } break; } case Commands::UpdateFabricLabel::Id: { + Commands::UpdateFabricLabel::DecodableType commandData; expectArgumentCount = 1; const uint8_t * Label; bool argExists[1]; @@ -751,14 +767,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterUpdateFabricLabelCallback(aEndpointId, apCommandObj, - const_cast(Label)); + wasHandled = emberAfOperationalCredentialsClusterUpdateFabricLabelCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, const_cast(Label), commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, OperationalCredentials::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -766,9 +782,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - OperationalCredentials::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + OperationalCredentials::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -792,15 +809,16 @@ void DispatchSingleClusterCommand(ClusterId aClusterId, CommandId aCommandId, En 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); TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); switch (aClusterId) { case Clusters::OtaSoftwareUpdateProvider::Id: - Clusters::OtaSoftwareUpdateProvider::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::OtaSoftwareUpdateProvider::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::OperationalCredentials::Id: - Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, commandPath, aReader); break; default: // Unrecognized cluster ID, error status will apply. @@ -823,6 +841,7 @@ void DispatchSingleClusterResponseCommand(ClusterId aClusterId, CommandId aComma 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); TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); switch (aClusterId) diff --git a/zzz_generated/ota-requestor-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/ota-requestor-app/zap-generated/IMClusterCommandHandler.cpp index 41a808c8b86353..779d10e19ee525 100644 --- a/zzz_generated/ota-requestor-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/ota-requestor-app/zap-generated/IMClusterCommandHandler.cpp @@ -23,6 +23,7 @@ #include "app/util/util.h" #include #include +#include #include #include @@ -35,15 +36,16 @@ namespace chip { namespace app { namespace { -void ReportCommandUnsupported(Command * aCommandObj, EndpointId aEndpointId, ClusterId aClusterId, CommandId aCommandId) +void ReportCommandUnsupported(Command * aCommandObj, const ConcreteCommandPath & aCommandPath) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - aClusterId, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + aCommandPath.mClusterId, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; aCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kNotFound, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandId), - ChipLogValueMEI(aClusterId)); + ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, + ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); } } // anonymous namespace @@ -53,7 +55,7 @@ namespace Clusters { namespace OtaSoftwareUpdateProvider { -void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -66,7 +68,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ApplyUpdateRequestResponse::Id: { expectArgumentCount = 2; @@ -126,8 +128,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestResponseCallback(aEndpointId, apCommandObj, - action, delayedActionTime); + wasHandled = emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestResponseCallback( + aCommandPath.mEndpointId, apCommandObj, action, delayedActionTime); } break; } @@ -216,14 +218,15 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 8 == validArgumentCount) { wasHandled = emberAfOtaSoftwareUpdateProviderClusterQueryImageResponseCallback( - aEndpointId, apCommandObj, status, delayedActionTime, const_cast(imageURI), softwareVersion, - const_cast(softwareVersionString), updateToken, userConsentNeeded, metadataForRequestor); + aCommandPath.mEndpointId, apCommandObj, status, delayedActionTime, const_cast(imageURI), + softwareVersion, const_cast(softwareVersionString), updateToken, userConsentNeeded, + metadataForRequestor); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, OtaSoftwareUpdateProvider::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -231,9 +234,10 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - OtaSoftwareUpdateProvider::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + OtaSoftwareUpdateProvider::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -257,6 +261,7 @@ void DispatchSingleClusterCommand(ClusterId aClusterId, CommandId aCommandId, En 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); TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); switch (aClusterId) @@ -282,12 +287,13 @@ void DispatchSingleClusterResponseCommand(ClusterId aClusterId, CommandId aComma 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); TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); switch (aClusterId) { case Clusters::OtaSoftwareUpdateProvider::Id: - Clusters::OtaSoftwareUpdateProvider::DispatchClientCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::OtaSoftwareUpdateProvider::DispatchClientCommand(apCommandObj, commandPath, aReader); break; default: // Unrecognized cluster ID, error status will apply. diff --git a/zzz_generated/pump-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/pump-app/zap-generated/IMClusterCommandHandler.cpp index a8fcbbec904d92..cb2b8695a56215 100644 --- a/zzz_generated/pump-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/pump-app/zap-generated/IMClusterCommandHandler.cpp @@ -23,6 +23,7 @@ #include "app/util/util.h" #include #include +#include #include #include @@ -35,15 +36,16 @@ namespace chip { namespace app { namespace { -void ReportCommandUnsupported(Command * aCommandObj, EndpointId aEndpointId, ClusterId aClusterId, CommandId aCommandId) +void ReportCommandUnsupported(Command * aCommandObj, const ConcreteCommandPath & aCommandPath) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - aClusterId, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + aCommandPath.mClusterId, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; aCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kNotFound, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandId), - ChipLogValueMEI(aClusterId)); + ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, + ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); } } // anonymous namespace @@ -53,7 +55,7 @@ namespace Clusters { namespace AdministratorCommissioning { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -66,9 +68,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::OpenBasicCommissioningWindow::Id: { + Commands::OpenBasicCommissioningWindow::DecodableType commandData; expectArgumentCount = 1; uint16_t CommissioningTimeout; bool argExists[1]; @@ -122,12 +125,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfAdministratorCommissioningClusterOpenBasicCommissioningWindowCallback(aEndpointId, apCommandObj, - CommissioningTimeout); + wasHandled = emberAfAdministratorCommissioningClusterOpenBasicCommissioningWindowCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CommissioningTimeout, commandData); } break; } case Commands::OpenCommissioningWindow::Id: { + Commands::OpenCommissioningWindow::DecodableType commandData; expectArgumentCount = 6; uint16_t CommissioningTimeout; chip::ByteSpan PAKEVerifier; @@ -202,18 +206,21 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 6 == validArgumentCount) { wasHandled = emberAfAdministratorCommissioningClusterOpenCommissioningWindowCallback( - aEndpointId, apCommandObj, CommissioningTimeout, PAKEVerifier, Discriminator, Iterations, Salt, PasscodeID); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CommissioningTimeout, PAKEVerifier, Discriminator, + Iterations, Salt, PasscodeID, commandData); } break; } case Commands::RevokeCommissioning::Id: { + Commands::RevokeCommissioning::DecodableType commandData; - wasHandled = emberAfAdministratorCommissioningClusterRevokeCommissioningCallback(aEndpointId, apCommandObj); + wasHandled = emberAfAdministratorCommissioningClusterRevokeCommissioningCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, AdministratorCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -221,9 +228,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - AdministratorCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + AdministratorCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -241,16 +249,16 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace Basic { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { - ReportCommandUnsupported(apCommandObj, aEndpointId, Basic::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); } } // namespace Basic namespace DiagnosticLogs { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -263,9 +271,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::RetrieveLogsRequest::Id: { + Commands::RetrieveLogsRequest::DecodableType commandData; expectArgumentCount = 3; uint8_t intent; uint8_t requestedProtocol; @@ -327,14 +336,15 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfDiagnosticLogsClusterRetrieveLogsRequestCallback(aEndpointId, apCommandObj, intent, - requestedProtocol, transferFileDesignator); + wasHandled = emberAfDiagnosticLogsClusterRetrieveLogsRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, intent, requestedProtocol, transferFileDesignator, + commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, DiagnosticLogs::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -342,9 +352,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - DiagnosticLogs::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + DiagnosticLogs::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -362,7 +372,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace GeneralCommissioning { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -375,9 +385,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ArmFailSafe::Id: { + Commands::ArmFailSafe::DecodableType commandData; expectArgumentCount = 3; uint16_t expiryLengthSeconds; uint64_t breadcrumb; @@ -439,17 +450,20 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfGeneralCommissioningClusterArmFailSafeCallback(aEndpointId, apCommandObj, expiryLengthSeconds, - breadcrumb, timeoutMs); + wasHandled = emberAfGeneralCommissioningClusterArmFailSafeCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, expiryLengthSeconds, breadcrumb, timeoutMs, commandData); } break; } case Commands::CommissioningComplete::Id: { + Commands::CommissioningComplete::DecodableType commandData; - wasHandled = emberAfGeneralCommissioningClusterCommissioningCompleteCallback(aEndpointId, apCommandObj); + wasHandled = emberAfGeneralCommissioningClusterCommissioningCompleteCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, commandData); break; } case Commands::SetRegulatoryConfig::Id: { + Commands::SetRegulatoryConfig::DecodableType commandData; expectArgumentCount = 4; uint8_t location; const uint8_t * countryCode; @@ -517,13 +531,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { wasHandled = emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback( - aEndpointId, apCommandObj, location, const_cast(countryCode), breadcrumb, timeoutMs); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, location, const_cast(countryCode), breadcrumb, + timeoutMs, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, GeneralCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -531,9 +546,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - GeneralCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + GeneralCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -551,7 +567,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace LevelControl { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -564,9 +580,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::Move::Id: { + Commands::Move::DecodableType commandData; expectArgumentCount = 4; uint8_t moveMode; uint8_t rate; @@ -632,12 +649,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = - emberAfLevelControlClusterMoveCallback(aEndpointId, apCommandObj, moveMode, rate, optionMask, optionOverride); + wasHandled = emberAfLevelControlClusterMoveCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, moveMode, + rate, optionMask, optionOverride, commandData); } break; } case Commands::MoveToLevel::Id: { + Commands::MoveToLevel::DecodableType commandData; expectArgumentCount = 4; uint8_t level; uint16_t transitionTime; @@ -703,12 +721,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfLevelControlClusterMoveToLevelCallback(aEndpointId, apCommandObj, level, transitionTime, - optionMask, optionOverride); + wasHandled = + emberAfLevelControlClusterMoveToLevelCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, level, + transitionTime, optionMask, optionOverride, commandData); } break; } case Commands::MoveToLevelWithOnOff::Id: { + Commands::MoveToLevelWithOnOff::DecodableType commandData; expectArgumentCount = 2; uint8_t level; uint16_t transitionTime; @@ -766,12 +786,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = - emberAfLevelControlClusterMoveToLevelWithOnOffCallback(aEndpointId, apCommandObj, level, transitionTime); + wasHandled = emberAfLevelControlClusterMoveToLevelWithOnOffCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, level, transitionTime, commandData); } break; } case Commands::MoveWithOnOff::Id: { + Commands::MoveWithOnOff::DecodableType commandData; expectArgumentCount = 2; uint8_t moveMode; uint8_t rate; @@ -829,11 +850,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfLevelControlClusterMoveWithOnOffCallback(aEndpointId, apCommandObj, moveMode, rate); + wasHandled = emberAfLevelControlClusterMoveWithOnOffCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + moveMode, rate, commandData); } break; } case Commands::Step::Id: { + Commands::Step::DecodableType commandData; expectArgumentCount = 5; uint8_t stepMode; uint8_t stepSize; @@ -903,12 +926,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfLevelControlClusterStepCallback(aEndpointId, apCommandObj, stepMode, stepSize, transitionTime, - optionMask, optionOverride); + wasHandled = + emberAfLevelControlClusterStepCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, stepMode, stepSize, + transitionTime, optionMask, optionOverride, commandData); } break; } case Commands::StepWithOnOff::Id: { + Commands::StepWithOnOff::DecodableType commandData; expectArgumentCount = 3; uint8_t stepMode; uint8_t stepSize; @@ -970,12 +995,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = - emberAfLevelControlClusterStepWithOnOffCallback(aEndpointId, apCommandObj, stepMode, stepSize, transitionTime); + wasHandled = emberAfLevelControlClusterStepWithOnOffCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + stepMode, stepSize, transitionTime, commandData); } break; } case Commands::Stop::Id: { + Commands::Stop::DecodableType commandData; expectArgumentCount = 2; uint8_t optionMask; uint8_t optionOverride; @@ -1033,18 +1059,21 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfLevelControlClusterStopCallback(aEndpointId, apCommandObj, optionMask, optionOverride); + wasHandled = emberAfLevelControlClusterStopCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + optionMask, optionOverride, commandData); } break; } case Commands::StopWithOnOff::Id: { + Commands::StopWithOnOff::DecodableType commandData; - wasHandled = emberAfLevelControlClusterStopWithOnOffCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfLevelControlClusterStopWithOnOffCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, LevelControl::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -1052,9 +1081,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - LevelControl::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + LevelControl::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -1072,7 +1101,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace NetworkCommissioning { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -1085,9 +1114,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::AddThreadNetwork::Id: { + Commands::AddThreadNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan operationalDataset; uint64_t breadcrumb; @@ -1149,12 +1179,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterAddThreadNetworkCallback(aEndpointId, apCommandObj, - operationalDataset, breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterAddThreadNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, operationalDataset, breadcrumb, timeoutMs, commandData); } break; } case Commands::AddWiFiNetwork::Id: { + Commands::AddWiFiNetwork::DecodableType commandData; expectArgumentCount = 4; chip::ByteSpan ssid; chip::ByteSpan credentials; @@ -1220,12 +1251,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterAddWiFiNetworkCallback(aEndpointId, apCommandObj, ssid, credentials, - breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterAddWiFiNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, ssid, credentials, breadcrumb, timeoutMs, commandData); } break; } case Commands::DisableNetwork::Id: { + Commands::DisableNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan networkID; uint64_t breadcrumb; @@ -1287,12 +1319,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterDisableNetworkCallback(aEndpointId, apCommandObj, networkID, - breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterDisableNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, networkID, breadcrumb, timeoutMs, commandData); } break; } case Commands::EnableNetwork::Id: { + Commands::EnableNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan networkID; uint64_t breadcrumb; @@ -1354,12 +1387,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterEnableNetworkCallback(aEndpointId, apCommandObj, networkID, - breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterEnableNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, networkID, breadcrumb, timeoutMs, commandData); } break; } case Commands::RemoveNetwork::Id: { + Commands::RemoveNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan NetworkID; uint64_t Breadcrumb; @@ -1421,12 +1455,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterRemoveNetworkCallback(aEndpointId, apCommandObj, NetworkID, - Breadcrumb, TimeoutMs); + wasHandled = emberAfNetworkCommissioningClusterRemoveNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, NetworkID, Breadcrumb, TimeoutMs, commandData); } break; } case Commands::ScanNetworks::Id: { + Commands::ScanNetworks::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan ssid; uint64_t breadcrumb; @@ -1488,12 +1523,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = - emberAfNetworkCommissioningClusterScanNetworksCallback(aEndpointId, apCommandObj, ssid, breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterScanNetworksCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, ssid, breadcrumb, timeoutMs, commandData); } break; } case Commands::UpdateThreadNetwork::Id: { + Commands::UpdateThreadNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan operationalDataset; uint64_t breadcrumb; @@ -1556,11 +1592,12 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { wasHandled = emberAfNetworkCommissioningClusterUpdateThreadNetworkCallback( - aEndpointId, apCommandObj, operationalDataset, breadcrumb, timeoutMs); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, operationalDataset, breadcrumb, timeoutMs, commandData); } break; } case Commands::UpdateWiFiNetwork::Id: { + Commands::UpdateWiFiNetwork::DecodableType commandData; expectArgumentCount = 4; chip::ByteSpan ssid; chip::ByteSpan credentials; @@ -1626,14 +1663,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback(aEndpointId, apCommandObj, ssid, - credentials, breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, ssid, credentials, breadcrumb, timeoutMs, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, NetworkCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -1641,9 +1678,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - NetworkCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + NetworkCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -1661,7 +1699,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace OnOff { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -1674,26 +1712,29 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::Off::Id: { + Commands::Off::DecodableType commandData; - wasHandled = emberAfOnOffClusterOffCallback(aEndpointId, apCommandObj); + wasHandled = emberAfOnOffClusterOffCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::On::Id: { + Commands::On::DecodableType commandData; - wasHandled = emberAfOnOffClusterOnCallback(aEndpointId, apCommandObj); + wasHandled = emberAfOnOffClusterOnCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::Toggle::Id: { + Commands::Toggle::DecodableType commandData; - wasHandled = emberAfOnOffClusterToggleCallback(aEndpointId, apCommandObj); + wasHandled = emberAfOnOffClusterToggleCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, OnOff::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -1701,9 +1742,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - OnOff::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + OnOff::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -1721,7 +1762,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace OperationalCredentials { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -1734,9 +1775,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::AddNOC::Id: { + Commands::AddNOC::DecodableType commandData; expectArgumentCount = 5; chip::ByteSpan NOCValue; chip::ByteSpan ICACValue; @@ -1806,12 +1848,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterAddNOCCallback(aEndpointId, apCommandObj, NOCValue, ICACValue, - IPKValue, CaseAdminNode, AdminVendorId); + wasHandled = emberAfOperationalCredentialsClusterAddNOCCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, NOCValue, ICACValue, IPKValue, CaseAdminNode, + AdminVendorId, commandData); } break; } case Commands::AddTrustedRootCertificate::Id: { + Commands::AddTrustedRootCertificate::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan RootCertificate; bool argExists[1]; @@ -1865,12 +1909,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback(aEndpointId, apCommandObj, - RootCertificate); + wasHandled = emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, RootCertificate, commandData); } break; } case Commands::AttestationRequest::Id: { + Commands::AttestationRequest::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan AttestationNonce; bool argExists[1]; @@ -1924,12 +1969,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = - emberAfOperationalCredentialsClusterAttestationRequestCallback(aEndpointId, apCommandObj, AttestationNonce); + wasHandled = emberAfOperationalCredentialsClusterAttestationRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, AttestationNonce, commandData); } break; } case Commands::CertificateChainRequest::Id: { + Commands::CertificateChainRequest::DecodableType commandData; expectArgumentCount = 1; uint8_t CertificateType; bool argExists[1]; @@ -1983,12 +2029,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = - emberAfOperationalCredentialsClusterCertificateChainRequestCallback(aEndpointId, apCommandObj, CertificateType); + wasHandled = emberAfOperationalCredentialsClusterCertificateChainRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CertificateType, commandData); } break; } case Commands::OpCSRRequest::Id: { + Commands::OpCSRRequest::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan CSRNonce; bool argExists[1]; @@ -2042,11 +2089,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterOpCSRRequestCallback(aEndpointId, apCommandObj, CSRNonce); + wasHandled = emberAfOperationalCredentialsClusterOpCSRRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CSRNonce, commandData); } break; } case Commands::RemoveFabric::Id: { + Commands::RemoveFabric::DecodableType commandData; expectArgumentCount = 1; uint8_t FabricIndex; bool argExists[1]; @@ -2100,11 +2149,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterRemoveFabricCallback(aEndpointId, apCommandObj, FabricIndex); + wasHandled = emberAfOperationalCredentialsClusterRemoveFabricCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, FabricIndex, commandData); } break; } case Commands::RemoveTrustedRootCertificate::Id: { + Commands::RemoveTrustedRootCertificate::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan TrustedRootIdentifier; bool argExists[1]; @@ -2158,12 +2209,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterRemoveTrustedRootCertificateCallback(aEndpointId, apCommandObj, - TrustedRootIdentifier); + wasHandled = emberAfOperationalCredentialsClusterRemoveTrustedRootCertificateCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, TrustedRootIdentifier, commandData); } break; } case Commands::UpdateFabricLabel::Id: { + Commands::UpdateFabricLabel::DecodableType commandData; expectArgumentCount = 1; const uint8_t * Label; bool argExists[1]; @@ -2218,12 +2270,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterUpdateFabricLabelCallback(aEndpointId, apCommandObj, - const_cast(Label)); + wasHandled = emberAfOperationalCredentialsClusterUpdateFabricLabelCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, const_cast(Label), commandData); } break; } case Commands::UpdateNOC::Id: { + Commands::UpdateNOC::DecodableType commandData; expectArgumentCount = 2; chip::ByteSpan NOCValue; chip::ByteSpan ICACValue; @@ -2281,13 +2334,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterUpdateNOCCallback(aEndpointId, apCommandObj, NOCValue, ICACValue); + wasHandled = emberAfOperationalCredentialsClusterUpdateNOCCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, NOCValue, ICACValue, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, OperationalCredentials::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -2295,9 +2349,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - OperationalCredentials::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + OperationalCredentials::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -2321,33 +2376,34 @@ void DispatchSingleClusterCommand(ClusterId aClusterId, CommandId aCommandId, En 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); TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); switch (aClusterId) { case Clusters::AdministratorCommissioning::Id: - Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::Basic::Id: - Clusters::Basic::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::Basic::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::DiagnosticLogs::Id: - Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::GeneralCommissioning::Id: - Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::LevelControl::Id: - Clusters::LevelControl::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::LevelControl::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::NetworkCommissioning::Id: - Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::OnOff::Id: - Clusters::OnOff::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::OnOff::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::OperationalCredentials::Id: - Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, commandPath, aReader); break; default: // Unrecognized cluster ID, error status will apply. @@ -2370,6 +2426,7 @@ void DispatchSingleClusterResponseCommand(ClusterId aClusterId, CommandId aComma 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); TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); switch (aClusterId) diff --git a/zzz_generated/pump-controller-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/pump-controller-app/zap-generated/IMClusterCommandHandler.cpp index f2c0f561703d04..dc7b184a1ea48a 100644 --- a/zzz_generated/pump-controller-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/pump-controller-app/zap-generated/IMClusterCommandHandler.cpp @@ -23,6 +23,7 @@ #include "app/util/util.h" #include #include +#include #include #include @@ -35,15 +36,16 @@ namespace chip { namespace app { namespace { -void ReportCommandUnsupported(Command * aCommandObj, EndpointId aEndpointId, ClusterId aClusterId, CommandId aCommandId) +void ReportCommandUnsupported(Command * aCommandObj, const ConcreteCommandPath & aCommandPath) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - aClusterId, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + aCommandPath.mClusterId, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; aCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kNotFound, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandId), - ChipLogValueMEI(aClusterId)); + ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, + ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); } } // anonymous namespace @@ -53,7 +55,7 @@ namespace Clusters { namespace AdministratorCommissioning { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -66,9 +68,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::OpenBasicCommissioningWindow::Id: { + Commands::OpenBasicCommissioningWindow::DecodableType commandData; expectArgumentCount = 1; uint16_t CommissioningTimeout; bool argExists[1]; @@ -122,12 +125,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfAdministratorCommissioningClusterOpenBasicCommissioningWindowCallback(aEndpointId, apCommandObj, - CommissioningTimeout); + wasHandled = emberAfAdministratorCommissioningClusterOpenBasicCommissioningWindowCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CommissioningTimeout, commandData); } break; } case Commands::OpenCommissioningWindow::Id: { + Commands::OpenCommissioningWindow::DecodableType commandData; expectArgumentCount = 6; uint16_t CommissioningTimeout; chip::ByteSpan PAKEVerifier; @@ -202,18 +206,21 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 6 == validArgumentCount) { wasHandled = emberAfAdministratorCommissioningClusterOpenCommissioningWindowCallback( - aEndpointId, apCommandObj, CommissioningTimeout, PAKEVerifier, Discriminator, Iterations, Salt, PasscodeID); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CommissioningTimeout, PAKEVerifier, Discriminator, + Iterations, Salt, PasscodeID, commandData); } break; } case Commands::RevokeCommissioning::Id: { + Commands::RevokeCommissioning::DecodableType commandData; - wasHandled = emberAfAdministratorCommissioningClusterRevokeCommissioningCallback(aEndpointId, apCommandObj); + wasHandled = emberAfAdministratorCommissioningClusterRevokeCommissioningCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, AdministratorCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -221,9 +228,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - AdministratorCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + AdministratorCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -241,16 +249,16 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace Basic { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { - ReportCommandUnsupported(apCommandObj, aEndpointId, Basic::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); } } // namespace Basic namespace DiagnosticLogs { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -263,9 +271,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::RetrieveLogsRequest::Id: { + Commands::RetrieveLogsRequest::DecodableType commandData; expectArgumentCount = 3; uint8_t intent; uint8_t requestedProtocol; @@ -327,14 +336,15 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfDiagnosticLogsClusterRetrieveLogsRequestCallback(aEndpointId, apCommandObj, intent, - requestedProtocol, transferFileDesignator); + wasHandled = emberAfDiagnosticLogsClusterRetrieveLogsRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, intent, requestedProtocol, transferFileDesignator, + commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, DiagnosticLogs::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -342,9 +352,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - DiagnosticLogs::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + DiagnosticLogs::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -362,7 +372,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace GeneralCommissioning { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -375,9 +385,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ArmFailSafe::Id: { + Commands::ArmFailSafe::DecodableType commandData; expectArgumentCount = 3; uint16_t expiryLengthSeconds; uint64_t breadcrumb; @@ -439,17 +450,20 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfGeneralCommissioningClusterArmFailSafeCallback(aEndpointId, apCommandObj, expiryLengthSeconds, - breadcrumb, timeoutMs); + wasHandled = emberAfGeneralCommissioningClusterArmFailSafeCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, expiryLengthSeconds, breadcrumb, timeoutMs, commandData); } break; } case Commands::CommissioningComplete::Id: { + Commands::CommissioningComplete::DecodableType commandData; - wasHandled = emberAfGeneralCommissioningClusterCommissioningCompleteCallback(aEndpointId, apCommandObj); + wasHandled = emberAfGeneralCommissioningClusterCommissioningCompleteCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, commandData); break; } case Commands::SetRegulatoryConfig::Id: { + Commands::SetRegulatoryConfig::DecodableType commandData; expectArgumentCount = 4; uint8_t location; const uint8_t * countryCode; @@ -517,13 +531,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { wasHandled = emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback( - aEndpointId, apCommandObj, location, const_cast(countryCode), breadcrumb, timeoutMs); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, location, const_cast(countryCode), breadcrumb, + timeoutMs, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, GeneralCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -531,9 +546,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - GeneralCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + GeneralCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -551,7 +567,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace NetworkCommissioning { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -564,9 +580,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::AddThreadNetwork::Id: { + Commands::AddThreadNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan operationalDataset; uint64_t breadcrumb; @@ -628,12 +645,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterAddThreadNetworkCallback(aEndpointId, apCommandObj, - operationalDataset, breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterAddThreadNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, operationalDataset, breadcrumb, timeoutMs, commandData); } break; } case Commands::AddWiFiNetwork::Id: { + Commands::AddWiFiNetwork::DecodableType commandData; expectArgumentCount = 4; chip::ByteSpan ssid; chip::ByteSpan credentials; @@ -699,12 +717,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterAddWiFiNetworkCallback(aEndpointId, apCommandObj, ssid, credentials, - breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterAddWiFiNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, ssid, credentials, breadcrumb, timeoutMs, commandData); } break; } case Commands::DisableNetwork::Id: { + Commands::DisableNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan networkID; uint64_t breadcrumb; @@ -766,12 +785,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterDisableNetworkCallback(aEndpointId, apCommandObj, networkID, - breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterDisableNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, networkID, breadcrumb, timeoutMs, commandData); } break; } case Commands::EnableNetwork::Id: { + Commands::EnableNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan networkID; uint64_t breadcrumb; @@ -833,12 +853,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterEnableNetworkCallback(aEndpointId, apCommandObj, networkID, - breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterEnableNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, networkID, breadcrumb, timeoutMs, commandData); } break; } case Commands::GetLastNetworkCommissioningResult::Id: { + Commands::GetLastNetworkCommissioningResult::DecodableType commandData; expectArgumentCount = 1; uint32_t timeoutMs; bool argExists[1]; @@ -892,12 +913,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback(aEndpointId, apCommandObj, - timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, timeoutMs, commandData); } break; } case Commands::RemoveNetwork::Id: { + Commands::RemoveNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan NetworkID; uint64_t Breadcrumb; @@ -959,12 +981,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterRemoveNetworkCallback(aEndpointId, apCommandObj, NetworkID, - Breadcrumb, TimeoutMs); + wasHandled = emberAfNetworkCommissioningClusterRemoveNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, NetworkID, Breadcrumb, TimeoutMs, commandData); } break; } case Commands::ScanNetworks::Id: { + Commands::ScanNetworks::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan ssid; uint64_t breadcrumb; @@ -1026,12 +1049,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = - emberAfNetworkCommissioningClusterScanNetworksCallback(aEndpointId, apCommandObj, ssid, breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterScanNetworksCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, ssid, breadcrumb, timeoutMs, commandData); } break; } case Commands::UpdateThreadNetwork::Id: { + Commands::UpdateThreadNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan operationalDataset; uint64_t breadcrumb; @@ -1094,11 +1118,12 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { wasHandled = emberAfNetworkCommissioningClusterUpdateThreadNetworkCallback( - aEndpointId, apCommandObj, operationalDataset, breadcrumb, timeoutMs); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, operationalDataset, breadcrumb, timeoutMs, commandData); } break; } case Commands::UpdateWiFiNetwork::Id: { + Commands::UpdateWiFiNetwork::DecodableType commandData; expectArgumentCount = 4; chip::ByteSpan ssid; chip::ByteSpan credentials; @@ -1164,14 +1189,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback(aEndpointId, apCommandObj, ssid, - credentials, breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, ssid, credentials, breadcrumb, timeoutMs, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, NetworkCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -1179,9 +1204,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - NetworkCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + NetworkCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -1199,7 +1225,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace OperationalCredentials { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -1212,9 +1238,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::AddNOC::Id: { + Commands::AddNOC::DecodableType commandData; expectArgumentCount = 5; chip::ByteSpan NOCValue; chip::ByteSpan ICACValue; @@ -1284,12 +1311,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterAddNOCCallback(aEndpointId, apCommandObj, NOCValue, ICACValue, - IPKValue, CaseAdminNode, AdminVendorId); + wasHandled = emberAfOperationalCredentialsClusterAddNOCCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, NOCValue, ICACValue, IPKValue, CaseAdminNode, + AdminVendorId, commandData); } break; } case Commands::AddTrustedRootCertificate::Id: { + Commands::AddTrustedRootCertificate::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan RootCertificate; bool argExists[1]; @@ -1343,12 +1372,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback(aEndpointId, apCommandObj, - RootCertificate); + wasHandled = emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, RootCertificate, commandData); } break; } case Commands::AttestationRequest::Id: { + Commands::AttestationRequest::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan AttestationNonce; bool argExists[1]; @@ -1402,12 +1432,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = - emberAfOperationalCredentialsClusterAttestationRequestCallback(aEndpointId, apCommandObj, AttestationNonce); + wasHandled = emberAfOperationalCredentialsClusterAttestationRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, AttestationNonce, commandData); } break; } case Commands::CertificateChainRequest::Id: { + Commands::CertificateChainRequest::DecodableType commandData; expectArgumentCount = 1; uint8_t CertificateType; bool argExists[1]; @@ -1461,12 +1492,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = - emberAfOperationalCredentialsClusterCertificateChainRequestCallback(aEndpointId, apCommandObj, CertificateType); + wasHandled = emberAfOperationalCredentialsClusterCertificateChainRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CertificateType, commandData); } break; } case Commands::OpCSRRequest::Id: { + Commands::OpCSRRequest::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan CSRNonce; bool argExists[1]; @@ -1520,11 +1552,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterOpCSRRequestCallback(aEndpointId, apCommandObj, CSRNonce); + wasHandled = emberAfOperationalCredentialsClusterOpCSRRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CSRNonce, commandData); } break; } case Commands::RemoveFabric::Id: { + Commands::RemoveFabric::DecodableType commandData; expectArgumentCount = 1; uint8_t FabricIndex; bool argExists[1]; @@ -1578,11 +1612,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterRemoveFabricCallback(aEndpointId, apCommandObj, FabricIndex); + wasHandled = emberAfOperationalCredentialsClusterRemoveFabricCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, FabricIndex, commandData); } break; } case Commands::RemoveTrustedRootCertificate::Id: { + Commands::RemoveTrustedRootCertificate::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan TrustedRootIdentifier; bool argExists[1]; @@ -1636,12 +1672,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterRemoveTrustedRootCertificateCallback(aEndpointId, apCommandObj, - TrustedRootIdentifier); + wasHandled = emberAfOperationalCredentialsClusterRemoveTrustedRootCertificateCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, TrustedRootIdentifier, commandData); } break; } case Commands::UpdateFabricLabel::Id: { + Commands::UpdateFabricLabel::DecodableType commandData; expectArgumentCount = 1; const uint8_t * Label; bool argExists[1]; @@ -1696,12 +1733,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterUpdateFabricLabelCallback(aEndpointId, apCommandObj, - const_cast(Label)); + wasHandled = emberAfOperationalCredentialsClusterUpdateFabricLabelCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, const_cast(Label), commandData); } break; } case Commands::UpdateNOC::Id: { + Commands::UpdateNOC::DecodableType commandData; expectArgumentCount = 2; chip::ByteSpan NOCValue; chip::ByteSpan ICACValue; @@ -1759,13 +1797,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterUpdateNOCCallback(aEndpointId, apCommandObj, NOCValue, ICACValue); + wasHandled = emberAfOperationalCredentialsClusterUpdateNOCCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, NOCValue, ICACValue, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, OperationalCredentials::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -1773,9 +1812,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - OperationalCredentials::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + OperationalCredentials::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -1799,27 +1839,28 @@ void DispatchSingleClusterCommand(ClusterId aClusterId, CommandId aCommandId, En 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); TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); switch (aClusterId) { case Clusters::AdministratorCommissioning::Id: - Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::Basic::Id: - Clusters::Basic::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::Basic::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::DiagnosticLogs::Id: - Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::GeneralCommissioning::Id: - Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::NetworkCommissioning::Id: - Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::OperationalCredentials::Id: - Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, commandPath, aReader); break; default: // Unrecognized cluster ID, error status will apply. @@ -1842,6 +1883,7 @@ void DispatchSingleClusterResponseCommand(ClusterId aClusterId, CommandId aComma 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); TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); switch (aClusterId) diff --git a/zzz_generated/temperature-measurement-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/temperature-measurement-app/zap-generated/IMClusterCommandHandler.cpp index 34645539f7dbde..a9794dc087043b 100644 --- a/zzz_generated/temperature-measurement-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/temperature-measurement-app/zap-generated/IMClusterCommandHandler.cpp @@ -23,6 +23,7 @@ #include "app/util/util.h" #include #include +#include #include #include @@ -35,15 +36,16 @@ namespace chip { namespace app { namespace { -void ReportCommandUnsupported(Command * aCommandObj, EndpointId aEndpointId, ClusterId aClusterId, CommandId aCommandId) +void ReportCommandUnsupported(Command * aCommandObj, const ConcreteCommandPath & aCommandPath) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - aClusterId, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + aCommandPath.mClusterId, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; aCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kNotFound, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandId), - ChipLogValueMEI(aClusterId)); + ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, + ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); } } // anonymous namespace @@ -53,7 +55,7 @@ namespace Clusters { namespace AdministratorCommissioning { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -66,9 +68,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::OpenBasicCommissioningWindow::Id: { + Commands::OpenBasicCommissioningWindow::DecodableType commandData; expectArgumentCount = 1; uint16_t CommissioningTimeout; bool argExists[1]; @@ -122,12 +125,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfAdministratorCommissioningClusterOpenBasicCommissioningWindowCallback(aEndpointId, apCommandObj, - CommissioningTimeout); + wasHandled = emberAfAdministratorCommissioningClusterOpenBasicCommissioningWindowCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CommissioningTimeout, commandData); } break; } case Commands::OpenCommissioningWindow::Id: { + Commands::OpenCommissioningWindow::DecodableType commandData; expectArgumentCount = 6; uint16_t CommissioningTimeout; chip::ByteSpan PAKEVerifier; @@ -202,18 +206,21 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 6 == validArgumentCount) { wasHandled = emberAfAdministratorCommissioningClusterOpenCommissioningWindowCallback( - aEndpointId, apCommandObj, CommissioningTimeout, PAKEVerifier, Discriminator, Iterations, Salt, PasscodeID); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CommissioningTimeout, PAKEVerifier, Discriminator, + Iterations, Salt, PasscodeID, commandData); } break; } case Commands::RevokeCommissioning::Id: { + Commands::RevokeCommissioning::DecodableType commandData; - wasHandled = emberAfAdministratorCommissioningClusterRevokeCommissioningCallback(aEndpointId, apCommandObj); + wasHandled = emberAfAdministratorCommissioningClusterRevokeCommissioningCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, AdministratorCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -221,9 +228,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - AdministratorCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + AdministratorCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -241,7 +249,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace DiagnosticLogs { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -254,9 +262,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::RetrieveLogsRequest::Id: { + Commands::RetrieveLogsRequest::DecodableType commandData; expectArgumentCount = 3; uint8_t intent; uint8_t requestedProtocol; @@ -318,14 +327,15 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfDiagnosticLogsClusterRetrieveLogsRequestCallback(aEndpointId, apCommandObj, intent, - requestedProtocol, transferFileDesignator); + wasHandled = emberAfDiagnosticLogsClusterRetrieveLogsRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, intent, requestedProtocol, transferFileDesignator, + commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, DiagnosticLogs::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -333,9 +343,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - DiagnosticLogs::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + DiagnosticLogs::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -353,7 +363,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace GeneralCommissioning { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -366,9 +376,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ArmFailSafe::Id: { + Commands::ArmFailSafe::DecodableType commandData; expectArgumentCount = 3; uint16_t expiryLengthSeconds; uint64_t breadcrumb; @@ -430,17 +441,20 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfGeneralCommissioningClusterArmFailSafeCallback(aEndpointId, apCommandObj, expiryLengthSeconds, - breadcrumb, timeoutMs); + wasHandled = emberAfGeneralCommissioningClusterArmFailSafeCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, expiryLengthSeconds, breadcrumb, timeoutMs, commandData); } break; } case Commands::CommissioningComplete::Id: { + Commands::CommissioningComplete::DecodableType commandData; - wasHandled = emberAfGeneralCommissioningClusterCommissioningCompleteCallback(aEndpointId, apCommandObj); + wasHandled = emberAfGeneralCommissioningClusterCommissioningCompleteCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, commandData); break; } case Commands::SetRegulatoryConfig::Id: { + Commands::SetRegulatoryConfig::DecodableType commandData; expectArgumentCount = 4; uint8_t location; const uint8_t * countryCode; @@ -508,13 +522,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { wasHandled = emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback( - aEndpointId, apCommandObj, location, const_cast(countryCode), breadcrumb, timeoutMs); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, location, const_cast(countryCode), breadcrumb, + timeoutMs, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, GeneralCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -522,9 +537,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - GeneralCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + GeneralCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -542,7 +558,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace NetworkCommissioning { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -555,9 +571,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::AddWiFiNetwork::Id: { + Commands::AddWiFiNetwork::DecodableType commandData; expectArgumentCount = 4; chip::ByteSpan ssid; chip::ByteSpan credentials; @@ -623,12 +640,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterAddWiFiNetworkCallback(aEndpointId, apCommandObj, ssid, credentials, - breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterAddWiFiNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, ssid, credentials, breadcrumb, timeoutMs, commandData); } break; } case Commands::DisableNetwork::Id: { + Commands::DisableNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan networkID; uint64_t breadcrumb; @@ -690,12 +708,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterDisableNetworkCallback(aEndpointId, apCommandObj, networkID, - breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterDisableNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, networkID, breadcrumb, timeoutMs, commandData); } break; } case Commands::EnableNetwork::Id: { + Commands::EnableNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan networkID; uint64_t breadcrumb; @@ -757,12 +776,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterEnableNetworkCallback(aEndpointId, apCommandObj, networkID, - breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterEnableNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, networkID, breadcrumb, timeoutMs, commandData); } break; } case Commands::GetLastNetworkCommissioningResult::Id: { + Commands::GetLastNetworkCommissioningResult::DecodableType commandData; expectArgumentCount = 1; uint32_t timeoutMs; bool argExists[1]; @@ -816,12 +836,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback(aEndpointId, apCommandObj, - timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, timeoutMs, commandData); } break; } case Commands::RemoveNetwork::Id: { + Commands::RemoveNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan NetworkID; uint64_t Breadcrumb; @@ -883,12 +904,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterRemoveNetworkCallback(aEndpointId, apCommandObj, NetworkID, - Breadcrumb, TimeoutMs); + wasHandled = emberAfNetworkCommissioningClusterRemoveNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, NetworkID, Breadcrumb, TimeoutMs, commandData); } break; } case Commands::ScanNetworks::Id: { + Commands::ScanNetworks::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan ssid; uint64_t breadcrumb; @@ -950,12 +972,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = - emberAfNetworkCommissioningClusterScanNetworksCallback(aEndpointId, apCommandObj, ssid, breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterScanNetworksCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, ssid, breadcrumb, timeoutMs, commandData); } break; } case Commands::UpdateWiFiNetwork::Id: { + Commands::UpdateWiFiNetwork::DecodableType commandData; expectArgumentCount = 4; chip::ByteSpan ssid; chip::ByteSpan credentials; @@ -1021,14 +1044,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback(aEndpointId, apCommandObj, ssid, - credentials, breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, ssid, credentials, breadcrumb, timeoutMs, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, NetworkCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -1036,9 +1059,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - NetworkCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + NetworkCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -1056,7 +1080,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace OperationalCredentials { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -1069,9 +1093,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::AddNOC::Id: { + Commands::AddNOC::DecodableType commandData; expectArgumentCount = 5; chip::ByteSpan NOCValue; chip::ByteSpan ICACValue; @@ -1141,12 +1166,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterAddNOCCallback(aEndpointId, apCommandObj, NOCValue, ICACValue, - IPKValue, CaseAdminNode, AdminVendorId); + wasHandled = emberAfOperationalCredentialsClusterAddNOCCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, NOCValue, ICACValue, IPKValue, CaseAdminNode, + AdminVendorId, commandData); } break; } case Commands::AddTrustedRootCertificate::Id: { + Commands::AddTrustedRootCertificate::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan RootCertificate; bool argExists[1]; @@ -1200,12 +1227,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback(aEndpointId, apCommandObj, - RootCertificate); + wasHandled = emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, RootCertificate, commandData); } break; } case Commands::AttestationRequest::Id: { + Commands::AttestationRequest::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan AttestationNonce; bool argExists[1]; @@ -1259,12 +1287,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = - emberAfOperationalCredentialsClusterAttestationRequestCallback(aEndpointId, apCommandObj, AttestationNonce); + wasHandled = emberAfOperationalCredentialsClusterAttestationRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, AttestationNonce, commandData); } break; } case Commands::CertificateChainRequest::Id: { + Commands::CertificateChainRequest::DecodableType commandData; expectArgumentCount = 1; uint8_t CertificateType; bool argExists[1]; @@ -1318,12 +1347,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = - emberAfOperationalCredentialsClusterCertificateChainRequestCallback(aEndpointId, apCommandObj, CertificateType); + wasHandled = emberAfOperationalCredentialsClusterCertificateChainRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CertificateType, commandData); } break; } case Commands::OpCSRRequest::Id: { + Commands::OpCSRRequest::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan CSRNonce; bool argExists[1]; @@ -1377,11 +1407,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterOpCSRRequestCallback(aEndpointId, apCommandObj, CSRNonce); + wasHandled = emberAfOperationalCredentialsClusterOpCSRRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CSRNonce, commandData); } break; } case Commands::RemoveFabric::Id: { + Commands::RemoveFabric::DecodableType commandData; expectArgumentCount = 1; uint8_t FabricIndex; bool argExists[1]; @@ -1435,11 +1467,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterRemoveFabricCallback(aEndpointId, apCommandObj, FabricIndex); + wasHandled = emberAfOperationalCredentialsClusterRemoveFabricCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, FabricIndex, commandData); } break; } case Commands::RemoveTrustedRootCertificate::Id: { + Commands::RemoveTrustedRootCertificate::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan TrustedRootIdentifier; bool argExists[1]; @@ -1493,12 +1527,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterRemoveTrustedRootCertificateCallback(aEndpointId, apCommandObj, - TrustedRootIdentifier); + wasHandled = emberAfOperationalCredentialsClusterRemoveTrustedRootCertificateCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, TrustedRootIdentifier, commandData); } break; } case Commands::UpdateFabricLabel::Id: { + Commands::UpdateFabricLabel::DecodableType commandData; expectArgumentCount = 1; const uint8_t * Label; bool argExists[1]; @@ -1553,12 +1588,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterUpdateFabricLabelCallback(aEndpointId, apCommandObj, - const_cast(Label)); + wasHandled = emberAfOperationalCredentialsClusterUpdateFabricLabelCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, const_cast(Label), commandData); } break; } case Commands::UpdateNOC::Id: { + Commands::UpdateNOC::DecodableType commandData; expectArgumentCount = 2; chip::ByteSpan NOCValue; chip::ByteSpan ICACValue; @@ -1616,13 +1652,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterUpdateNOCCallback(aEndpointId, apCommandObj, NOCValue, ICACValue); + wasHandled = emberAfOperationalCredentialsClusterUpdateNOCCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, NOCValue, ICACValue, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, OperationalCredentials::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -1630,9 +1667,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - OperationalCredentials::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + OperationalCredentials::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -1656,24 +1694,25 @@ void DispatchSingleClusterCommand(ClusterId aClusterId, CommandId aCommandId, En 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); TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); switch (aClusterId) { case Clusters::AdministratorCommissioning::Id: - Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::DiagnosticLogs::Id: - Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::GeneralCommissioning::Id: - Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::NetworkCommissioning::Id: - Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::OperationalCredentials::Id: - Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, commandPath, aReader); break; default: // Unrecognized cluster ID, error status will apply. @@ -1696,6 +1735,7 @@ void DispatchSingleClusterResponseCommand(ClusterId aClusterId, CommandId aComma 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); TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); switch (aClusterId) diff --git a/zzz_generated/thermostat/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/thermostat/zap-generated/IMClusterCommandHandler.cpp index 310dcaea64c1bc..aec2f28903cade 100644 --- a/zzz_generated/thermostat/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/thermostat/zap-generated/IMClusterCommandHandler.cpp @@ -23,6 +23,7 @@ #include "app/util/util.h" #include #include +#include #include #include @@ -35,15 +36,16 @@ namespace chip { namespace app { namespace { -void ReportCommandUnsupported(Command * aCommandObj, EndpointId aEndpointId, ClusterId aClusterId, CommandId aCommandId) +void ReportCommandUnsupported(Command * aCommandObj, const ConcreteCommandPath & aCommandPath) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - aClusterId, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + aCommandPath.mClusterId, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; aCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kNotFound, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandId), - ChipLogValueMEI(aClusterId)); + ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, + ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); } } // anonymous namespace @@ -53,7 +55,7 @@ namespace Clusters { namespace AdministratorCommissioning { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -66,9 +68,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::OpenBasicCommissioningWindow::Id: { + Commands::OpenBasicCommissioningWindow::DecodableType commandData; expectArgumentCount = 1; uint16_t CommissioningTimeout; bool argExists[1]; @@ -122,12 +125,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfAdministratorCommissioningClusterOpenBasicCommissioningWindowCallback(aEndpointId, apCommandObj, - CommissioningTimeout); + wasHandled = emberAfAdministratorCommissioningClusterOpenBasicCommissioningWindowCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CommissioningTimeout, commandData); } break; } case Commands::OpenCommissioningWindow::Id: { + Commands::OpenCommissioningWindow::DecodableType commandData; expectArgumentCount = 6; uint16_t CommissioningTimeout; chip::ByteSpan PAKEVerifier; @@ -202,18 +206,21 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 6 == validArgumentCount) { wasHandled = emberAfAdministratorCommissioningClusterOpenCommissioningWindowCallback( - aEndpointId, apCommandObj, CommissioningTimeout, PAKEVerifier, Discriminator, Iterations, Salt, PasscodeID); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CommissioningTimeout, PAKEVerifier, Discriminator, + Iterations, Salt, PasscodeID, commandData); } break; } case Commands::RevokeCommissioning::Id: { + Commands::RevokeCommissioning::DecodableType commandData; - wasHandled = emberAfAdministratorCommissioningClusterRevokeCommissioningCallback(aEndpointId, apCommandObj); + wasHandled = emberAfAdministratorCommissioningClusterRevokeCommissioningCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, AdministratorCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -221,9 +228,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - AdministratorCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + AdministratorCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -241,7 +249,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace BarrierControl { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -254,9 +262,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::BarrierControlGoToPercent::Id: { + Commands::BarrierControlGoToPercent::DecodableType commandData; expectArgumentCount = 1; uint8_t percentOpen; bool argExists[1]; @@ -310,18 +319,21 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfBarrierControlClusterBarrierControlGoToPercentCallback(aEndpointId, apCommandObj, percentOpen); + wasHandled = emberAfBarrierControlClusterBarrierControlGoToPercentCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, percentOpen, commandData); } break; } case Commands::BarrierControlStop::Id: { + Commands::BarrierControlStop::DecodableType commandData; - wasHandled = emberAfBarrierControlClusterBarrierControlStopCallback(aEndpointId, apCommandObj); + wasHandled = emberAfBarrierControlClusterBarrierControlStopCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, BarrierControl::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -329,9 +341,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - BarrierControl::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + BarrierControl::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -349,16 +361,16 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace Basic { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { - ReportCommandUnsupported(apCommandObj, aEndpointId, Basic::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); } } // namespace Basic namespace Binding { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -371,9 +383,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::Bind::Id: { + Commands::Bind::DecodableType commandData; expectArgumentCount = 4; chip::NodeId nodeId; chip::GroupId groupId; @@ -439,11 +452,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfBindingClusterBindCallback(aEndpointId, apCommandObj, nodeId, groupId, endpointId, clusterId); + wasHandled = emberAfBindingClusterBindCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, nodeId, + groupId, endpointId, clusterId, commandData); } break; } case Commands::Unbind::Id: { + Commands::Unbind::DecodableType commandData; expectArgumentCount = 4; chip::NodeId nodeId; chip::GroupId groupId; @@ -509,13 +524,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfBindingClusterUnbindCallback(aEndpointId, apCommandObj, nodeId, groupId, endpointId, clusterId); + wasHandled = emberAfBindingClusterUnbindCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, nodeId, + groupId, endpointId, clusterId, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, Binding::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -523,9 +539,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - Binding::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + Binding::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -543,7 +559,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace ColorControl { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -556,9 +572,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::MoveColor::Id: { + Commands::MoveColor::DecodableType commandData; expectArgumentCount = 4; int16_t rateX; int16_t rateY; @@ -624,12 +641,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfColorControlClusterMoveColorCallback(aEndpointId, apCommandObj, rateX, rateY, optionsMask, - optionsOverride); + wasHandled = emberAfColorControlClusterMoveColorCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + rateX, rateY, optionsMask, optionsOverride, commandData); } break; } case Commands::MoveColorTemperature::Id: { + Commands::MoveColorTemperature::DecodableType commandData; expectArgumentCount = 6; uint8_t moveMode; uint16_t rate; @@ -704,12 +722,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 6 == validArgumentCount) { wasHandled = emberAfColorControlClusterMoveColorTemperatureCallback( - aEndpointId, apCommandObj, moveMode, rate, colorTemperatureMinimum, colorTemperatureMaximum, optionsMask, - optionsOverride); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, moveMode, rate, colorTemperatureMinimum, + colorTemperatureMaximum, optionsMask, optionsOverride, commandData); } break; } case Commands::MoveHue::Id: { + Commands::MoveHue::DecodableType commandData; expectArgumentCount = 4; uint8_t moveMode; uint8_t rate; @@ -775,12 +794,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfColorControlClusterMoveHueCallback(aEndpointId, apCommandObj, moveMode, rate, optionsMask, - optionsOverride); + wasHandled = emberAfColorControlClusterMoveHueCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + moveMode, rate, optionsMask, optionsOverride, commandData); } break; } case Commands::MoveSaturation::Id: { + Commands::MoveSaturation::DecodableType commandData; expectArgumentCount = 4; uint8_t moveMode; uint8_t rate; @@ -846,12 +866,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfColorControlClusterMoveSaturationCallback(aEndpointId, apCommandObj, moveMode, rate, - optionsMask, optionsOverride); + wasHandled = + emberAfColorControlClusterMoveSaturationCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, moveMode, + rate, optionsMask, optionsOverride, commandData); } break; } case Commands::MoveToColor::Id: { + Commands::MoveToColor::DecodableType commandData; expectArgumentCount = 5; uint16_t colorX; uint16_t colorY; @@ -921,12 +943,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfColorControlClusterMoveToColorCallback(aEndpointId, apCommandObj, colorX, colorY, - transitionTime, optionsMask, optionsOverride); + wasHandled = emberAfColorControlClusterMoveToColorCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + colorX, colorY, transitionTime, optionsMask, + optionsOverride, commandData); } break; } case Commands::MoveToColorTemperature::Id: { + Commands::MoveToColorTemperature::DecodableType commandData; expectArgumentCount = 4; uint16_t colorTemperature; uint16_t transitionTime; @@ -992,12 +1016,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfColorControlClusterMoveToColorTemperatureCallback(aEndpointId, apCommandObj, colorTemperature, - transitionTime, optionsMask, optionsOverride); + wasHandled = emberAfColorControlClusterMoveToColorTemperatureCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, colorTemperature, transitionTime, optionsMask, + optionsOverride, commandData); } break; } case Commands::MoveToHue::Id: { + Commands::MoveToHue::DecodableType commandData; expectArgumentCount = 5; uint8_t hue; uint8_t direction; @@ -1067,12 +1093,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfColorControlClusterMoveToHueCallback(aEndpointId, apCommandObj, hue, direction, transitionTime, - optionsMask, optionsOverride); + wasHandled = emberAfColorControlClusterMoveToHueCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, hue, + direction, transitionTime, optionsMask, optionsOverride, + commandData); } break; } case Commands::MoveToHueAndSaturation::Id: { + Commands::MoveToHueAndSaturation::DecodableType commandData; expectArgumentCount = 5; uint8_t hue; uint8_t saturation; @@ -1142,12 +1170,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfColorControlClusterMoveToHueAndSaturationCallback(aEndpointId, apCommandObj, hue, saturation, - transitionTime, optionsMask, optionsOverride); + wasHandled = emberAfColorControlClusterMoveToHueAndSaturationCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, hue, saturation, transitionTime, optionsMask, + optionsOverride, commandData); } break; } case Commands::MoveToSaturation::Id: { + Commands::MoveToSaturation::DecodableType commandData; expectArgumentCount = 4; uint8_t saturation; uint16_t transitionTime; @@ -1213,12 +1243,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfColorControlClusterMoveToSaturationCallback(aEndpointId, apCommandObj, saturation, - transitionTime, optionsMask, optionsOverride); + wasHandled = emberAfColorControlClusterMoveToSaturationCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, saturation, transitionTime, optionsMask, optionsOverride, + commandData); } break; } case Commands::StepColor::Id: { + Commands::StepColor::DecodableType commandData; expectArgumentCount = 5; int16_t stepX; int16_t stepY; @@ -1288,12 +1320,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfColorControlClusterStepColorCallback(aEndpointId, apCommandObj, stepX, stepY, transitionTime, - optionsMask, optionsOverride); + wasHandled = + emberAfColorControlClusterStepColorCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, stepX, stepY, + transitionTime, optionsMask, optionsOverride, commandData); } break; } case Commands::StepColorTemperature::Id: { + Commands::StepColorTemperature::DecodableType commandData; expectArgumentCount = 7; uint8_t stepMode; uint16_t stepSize; @@ -1372,12 +1406,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 7 == validArgumentCount) { wasHandled = emberAfColorControlClusterStepColorTemperatureCallback( - aEndpointId, apCommandObj, stepMode, stepSize, transitionTime, colorTemperatureMinimum, colorTemperatureMaximum, - optionsMask, optionsOverride); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, stepMode, stepSize, transitionTime, + colorTemperatureMinimum, colorTemperatureMaximum, optionsMask, optionsOverride, commandData); } break; } case Commands::StepHue::Id: { + Commands::StepHue::DecodableType commandData; expectArgumentCount = 5; uint8_t stepMode; uint8_t stepSize; @@ -1447,12 +1482,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfColorControlClusterStepHueCallback(aEndpointId, apCommandObj, stepMode, stepSize, - transitionTime, optionsMask, optionsOverride); + wasHandled = + emberAfColorControlClusterStepHueCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, stepMode, + stepSize, transitionTime, optionsMask, optionsOverride, commandData); } break; } case Commands::StepSaturation::Id: { + Commands::StepSaturation::DecodableType commandData; expectArgumentCount = 5; uint8_t stepMode; uint8_t stepSize; @@ -1522,12 +1559,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfColorControlClusterStepSaturationCallback(aEndpointId, apCommandObj, stepMode, stepSize, - transitionTime, optionsMask, optionsOverride); + wasHandled = emberAfColorControlClusterStepSaturationCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + stepMode, stepSize, transitionTime, optionsMask, + optionsOverride, commandData); } break; } case Commands::StopMoveStep::Id: { + Commands::StopMoveStep::DecodableType commandData; expectArgumentCount = 2; uint8_t optionsMask; uint8_t optionsOverride; @@ -1585,14 +1624,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = - emberAfColorControlClusterStopMoveStepCallback(aEndpointId, apCommandObj, optionsMask, optionsOverride); + wasHandled = emberAfColorControlClusterStopMoveStepCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + optionsMask, optionsOverride, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, ColorControl::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -1600,9 +1639,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - ColorControl::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + ColorControl::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -1620,7 +1659,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace DiagnosticLogs { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -1633,9 +1672,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::RetrieveLogsRequest::Id: { + Commands::RetrieveLogsRequest::DecodableType commandData; expectArgumentCount = 3; uint8_t intent; uint8_t requestedProtocol; @@ -1697,14 +1737,15 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfDiagnosticLogsClusterRetrieveLogsRequestCallback(aEndpointId, apCommandObj, intent, - requestedProtocol, transferFileDesignator); + wasHandled = emberAfDiagnosticLogsClusterRetrieveLogsRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, intent, requestedProtocol, transferFileDesignator, + commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, DiagnosticLogs::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -1712,9 +1753,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - DiagnosticLogs::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + DiagnosticLogs::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -1732,7 +1773,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace DoorLock { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -1745,19 +1786,24 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ClearAllPins::Id: { + Commands::ClearAllPins::DecodableType commandData; - wasHandled = emberAfDoorLockClusterClearAllPinsCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfDoorLockClusterClearAllPinsCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::ClearAllRfids::Id: { + Commands::ClearAllRfids::DecodableType commandData; - wasHandled = emberAfDoorLockClusterClearAllRfidsCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfDoorLockClusterClearAllRfidsCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::ClearHolidaySchedule::Id: { + Commands::ClearHolidaySchedule::DecodableType commandData; expectArgumentCount = 1; uint8_t scheduleId; bool argExists[1]; @@ -1811,11 +1857,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterClearHolidayScheduleCallback(aEndpointId, apCommandObj, scheduleId); + wasHandled = emberAfDoorLockClusterClearHolidayScheduleCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, scheduleId, commandData); } break; } case Commands::ClearPin::Id: { + Commands::ClearPin::DecodableType commandData; expectArgumentCount = 1; uint16_t userId; bool argExists[1]; @@ -1869,11 +1917,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterClearPinCallback(aEndpointId, apCommandObj, userId); + wasHandled = emberAfDoorLockClusterClearPinCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, userId, + commandData); } break; } case Commands::ClearRfid::Id: { + Commands::ClearRfid::DecodableType commandData; expectArgumentCount = 1; uint16_t userId; bool argExists[1]; @@ -1927,11 +1977,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterClearRfidCallback(aEndpointId, apCommandObj, userId); + wasHandled = emberAfDoorLockClusterClearRfidCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, userId, + commandData); } break; } case Commands::ClearWeekdaySchedule::Id: { + Commands::ClearWeekdaySchedule::DecodableType commandData; expectArgumentCount = 2; uint8_t scheduleId; uint16_t userId; @@ -1989,11 +2041,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterClearWeekdayScheduleCallback(aEndpointId, apCommandObj, scheduleId, userId); + wasHandled = emberAfDoorLockClusterClearWeekdayScheduleCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, scheduleId, userId, commandData); } break; } case Commands::ClearYeardaySchedule::Id: { + Commands::ClearYeardaySchedule::DecodableType commandData; expectArgumentCount = 2; uint8_t scheduleId; uint16_t userId; @@ -2051,11 +2105,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterClearYeardayScheduleCallback(aEndpointId, apCommandObj, scheduleId, userId); + wasHandled = emberAfDoorLockClusterClearYeardayScheduleCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, scheduleId, userId, commandData); } break; } case Commands::GetHolidaySchedule::Id: { + Commands::GetHolidaySchedule::DecodableType commandData; expectArgumentCount = 1; uint8_t scheduleId; bool argExists[1]; @@ -2109,11 +2165,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterGetHolidayScheduleCallback(aEndpointId, apCommandObj, scheduleId); + wasHandled = emberAfDoorLockClusterGetHolidayScheduleCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + scheduleId, commandData); } break; } case Commands::GetLogRecord::Id: { + Commands::GetLogRecord::DecodableType commandData; expectArgumentCount = 1; uint16_t logIndex; bool argExists[1]; @@ -2167,11 +2225,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterGetLogRecordCallback(aEndpointId, apCommandObj, logIndex); + wasHandled = emberAfDoorLockClusterGetLogRecordCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + logIndex, commandData); } break; } case Commands::GetPin::Id: { + Commands::GetPin::DecodableType commandData; expectArgumentCount = 1; uint16_t userId; bool argExists[1]; @@ -2225,11 +2285,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterGetPinCallback(aEndpointId, apCommandObj, userId); + wasHandled = + emberAfDoorLockClusterGetPinCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, userId, commandData); } break; } case Commands::GetRfid::Id: { + Commands::GetRfid::DecodableType commandData; expectArgumentCount = 1; uint16_t userId; bool argExists[1]; @@ -2283,11 +2345,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterGetRfidCallback(aEndpointId, apCommandObj, userId); + wasHandled = emberAfDoorLockClusterGetRfidCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, userId, + commandData); } break; } case Commands::GetUserType::Id: { + Commands::GetUserType::DecodableType commandData; expectArgumentCount = 1; uint16_t userId; bool argExists[1]; @@ -2341,11 +2405,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterGetUserTypeCallback(aEndpointId, apCommandObj, userId); + wasHandled = emberAfDoorLockClusterGetUserTypeCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, userId, + commandData); } break; } case Commands::GetWeekdaySchedule::Id: { + Commands::GetWeekdaySchedule::DecodableType commandData; expectArgumentCount = 2; uint8_t scheduleId; uint16_t userId; @@ -2403,11 +2469,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterGetWeekdayScheduleCallback(aEndpointId, apCommandObj, scheduleId, userId); + wasHandled = emberAfDoorLockClusterGetWeekdayScheduleCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + scheduleId, userId, commandData); } break; } case Commands::GetYeardaySchedule::Id: { + Commands::GetYeardaySchedule::DecodableType commandData; expectArgumentCount = 2; uint8_t scheduleId; uint16_t userId; @@ -2465,11 +2533,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterGetYeardayScheduleCallback(aEndpointId, apCommandObj, scheduleId, userId); + wasHandled = emberAfDoorLockClusterGetYeardayScheduleCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + scheduleId, userId, commandData); } break; } case Commands::LockDoor::Id: { + Commands::LockDoor::DecodableType commandData; expectArgumentCount = 1; const uint8_t * PIN; bool argExists[1]; @@ -2524,11 +2594,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterLockDoorCallback(aEndpointId, apCommandObj, const_cast(PIN)); + wasHandled = emberAfDoorLockClusterLockDoorCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + const_cast(PIN), commandData); } break; } case Commands::SetHolidaySchedule::Id: { + Commands::SetHolidaySchedule::DecodableType commandData; expectArgumentCount = 4; uint8_t scheduleId; uint32_t localStartTime; @@ -2594,12 +2666,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterSetHolidayScheduleCallback(aEndpointId, apCommandObj, scheduleId, localStartTime, - localEndTime, operatingModeDuringHoliday); + wasHandled = emberAfDoorLockClusterSetHolidayScheduleCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + scheduleId, localStartTime, localEndTime, + operatingModeDuringHoliday, commandData); } break; } case Commands::SetPin::Id: { + Commands::SetPin::DecodableType commandData; expectArgumentCount = 4; uint16_t userId; uint8_t userStatus; @@ -2666,12 +2740,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterSetPinCallback(aEndpointId, apCommandObj, userId, userStatus, userType, - const_cast(pin)); + wasHandled = emberAfDoorLockClusterSetPinCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, userId, + userStatus, userType, const_cast(pin), commandData); } break; } case Commands::SetRfid::Id: { + Commands::SetRfid::DecodableType commandData; expectArgumentCount = 4; uint16_t userId; uint8_t userStatus; @@ -2738,12 +2813,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterSetRfidCallback(aEndpointId, apCommandObj, userId, userStatus, userType, - const_cast(id)); + wasHandled = emberAfDoorLockClusterSetRfidCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, userId, + userStatus, userType, const_cast(id), commandData); } break; } case Commands::SetUserType::Id: { + Commands::SetUserType::DecodableType commandData; expectArgumentCount = 2; uint16_t userId; uint8_t userType; @@ -2801,11 +2877,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterSetUserTypeCallback(aEndpointId, apCommandObj, userId, userType); + wasHandled = emberAfDoorLockClusterSetUserTypeCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, userId, + userType, commandData); } break; } case Commands::SetWeekdaySchedule::Id: { + Commands::SetWeekdaySchedule::DecodableType commandData; expectArgumentCount = 7; uint8_t scheduleId; uint16_t userId; @@ -2883,12 +2961,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 7 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterSetWeekdayScheduleCallback(aEndpointId, apCommandObj, scheduleId, userId, - daysMask, startHour, startMinute, endHour, endMinute); + wasHandled = emberAfDoorLockClusterSetWeekdayScheduleCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + scheduleId, userId, daysMask, startHour, startMinute, + endHour, endMinute, commandData); } break; } case Commands::SetYeardaySchedule::Id: { + Commands::SetYeardaySchedule::DecodableType commandData; expectArgumentCount = 4; uint8_t scheduleId; uint16_t userId; @@ -2954,12 +3034,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterSetYeardayScheduleCallback(aEndpointId, apCommandObj, scheduleId, userId, - localStartTime, localEndTime); + wasHandled = + emberAfDoorLockClusterSetYeardayScheduleCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + scheduleId, userId, localStartTime, localEndTime, commandData); } break; } case Commands::UnlockDoor::Id: { + Commands::UnlockDoor::DecodableType commandData; expectArgumentCount = 1; const uint8_t * PIN; bool argExists[1]; @@ -3014,11 +3096,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterUnlockDoorCallback(aEndpointId, apCommandObj, const_cast(PIN)); + wasHandled = emberAfDoorLockClusterUnlockDoorCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + const_cast(PIN), commandData); } break; } case Commands::UnlockWithTimeout::Id: { + Commands::UnlockWithTimeout::DecodableType commandData; expectArgumentCount = 2; uint16_t timeoutInSeconds; const uint8_t * pin; @@ -3077,14 +3161,15 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterUnlockWithTimeoutCallback(aEndpointId, apCommandObj, timeoutInSeconds, - const_cast(pin)); + wasHandled = + emberAfDoorLockClusterUnlockWithTimeoutCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + timeoutInSeconds, const_cast(pin), commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, DoorLock::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -3092,9 +3177,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - DoorLock::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + DoorLock::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -3112,7 +3197,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace GeneralCommissioning { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -3125,9 +3210,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ArmFailSafe::Id: { + Commands::ArmFailSafe::DecodableType commandData; expectArgumentCount = 3; uint16_t expiryLengthSeconds; uint64_t breadcrumb; @@ -3189,17 +3275,20 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfGeneralCommissioningClusterArmFailSafeCallback(aEndpointId, apCommandObj, expiryLengthSeconds, - breadcrumb, timeoutMs); + wasHandled = emberAfGeneralCommissioningClusterArmFailSafeCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, expiryLengthSeconds, breadcrumb, timeoutMs, commandData); } break; } case Commands::CommissioningComplete::Id: { + Commands::CommissioningComplete::DecodableType commandData; - wasHandled = emberAfGeneralCommissioningClusterCommissioningCompleteCallback(aEndpointId, apCommandObj); + wasHandled = emberAfGeneralCommissioningClusterCommissioningCompleteCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, commandData); break; } case Commands::SetRegulatoryConfig::Id: { + Commands::SetRegulatoryConfig::DecodableType commandData; expectArgumentCount = 4; uint8_t location; const uint8_t * countryCode; @@ -3267,13 +3356,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { wasHandled = emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback( - aEndpointId, apCommandObj, location, const_cast(countryCode), breadcrumb, timeoutMs); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, location, const_cast(countryCode), breadcrumb, + timeoutMs, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, GeneralCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -3281,9 +3371,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - GeneralCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + GeneralCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -3301,7 +3392,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace Groups { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -3314,9 +3405,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::AddGroup::Id: { + Commands::AddGroup::DecodableType commandData; expectArgumentCount = 2; uint16_t groupId; const uint8_t * groupName; @@ -3375,12 +3467,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = - emberAfGroupsClusterAddGroupCallback(aEndpointId, apCommandObj, groupId, const_cast(groupName)); + wasHandled = emberAfGroupsClusterAddGroupCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, groupId, + const_cast(groupName), commandData); } break; } case Commands::AddGroupIfIdentifying::Id: { + Commands::AddGroupIfIdentifying::DecodableType commandData; expectArgumentCount = 2; uint16_t groupId; const uint8_t * groupName; @@ -3439,12 +3532,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfGroupsClusterAddGroupIfIdentifyingCallback(aEndpointId, apCommandObj, groupId, - const_cast(groupName)); + wasHandled = emberAfGroupsClusterAddGroupIfIdentifyingCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, groupId, const_cast(groupName), commandData); } break; } case Commands::GetGroupMembership::Id: { + Commands::GetGroupMembership::DecodableType commandData; expectArgumentCount = 2; uint8_t groupCount; /* TYPE WARNING: array array defaults to */ uint8_t * groupList; @@ -3503,16 +3597,20 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfGroupsClusterGetGroupMembershipCallback(aEndpointId, apCommandObj, groupCount, groupList); + wasHandled = emberAfGroupsClusterGetGroupMembershipCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + groupCount, groupList, commandData); } break; } case Commands::RemoveAllGroups::Id: { + Commands::RemoveAllGroups::DecodableType commandData; - wasHandled = emberAfGroupsClusterRemoveAllGroupsCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfGroupsClusterRemoveAllGroupsCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::RemoveGroup::Id: { + Commands::RemoveGroup::DecodableType commandData; expectArgumentCount = 1; uint16_t groupId; bool argExists[1]; @@ -3566,11 +3664,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfGroupsClusterRemoveGroupCallback(aEndpointId, apCommandObj, groupId); + wasHandled = emberAfGroupsClusterRemoveGroupCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, groupId, + commandData); } break; } case Commands::ViewGroup::Id: { + Commands::ViewGroup::DecodableType commandData; expectArgumentCount = 1; uint16_t groupId; bool argExists[1]; @@ -3624,13 +3724,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfGroupsClusterViewGroupCallback(aEndpointId, apCommandObj, groupId); + wasHandled = emberAfGroupsClusterViewGroupCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, groupId, + commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, Groups::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -3638,9 +3739,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - Groups::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + Groups::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -3658,7 +3759,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace IasZone { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -3671,9 +3772,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ZoneEnrollResponse::Id: { + Commands::ZoneEnrollResponse::DecodableType commandData; expectArgumentCount = 2; uint8_t enrollResponseCode; uint8_t zoneId; @@ -3731,13 +3833,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfIasZoneClusterZoneEnrollResponseCallback(aEndpointId, apCommandObj, enrollResponseCode, zoneId); + wasHandled = emberAfIasZoneClusterZoneEnrollResponseCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + enrollResponseCode, zoneId, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, IasZone::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -3745,9 +3848,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - IasZone::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + IasZone::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -3765,7 +3868,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace Identify { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -3778,9 +3881,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::Identify::Id: { + Commands::Identify::DecodableType commandData; expectArgumentCount = 1; uint16_t identifyTime; bool argExists[1]; @@ -3834,18 +3938,21 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfIdentifyClusterIdentifyCallback(aEndpointId, apCommandObj, identifyTime); + wasHandled = emberAfIdentifyClusterIdentifyCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + identifyTime, commandData); } break; } case Commands::IdentifyQuery::Id: { + Commands::IdentifyQuery::DecodableType commandData; - wasHandled = emberAfIdentifyClusterIdentifyQueryCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfIdentifyClusterIdentifyQueryCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, Identify::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -3853,9 +3960,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - Identify::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + Identify::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -3873,7 +3980,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace LevelControl { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -3886,9 +3993,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::Move::Id: { + Commands::Move::DecodableType commandData; expectArgumentCount = 4; uint8_t moveMode; uint8_t rate; @@ -3954,12 +4062,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = - emberAfLevelControlClusterMoveCallback(aEndpointId, apCommandObj, moveMode, rate, optionMask, optionOverride); + wasHandled = emberAfLevelControlClusterMoveCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, moveMode, + rate, optionMask, optionOverride, commandData); } break; } case Commands::MoveToLevel::Id: { + Commands::MoveToLevel::DecodableType commandData; expectArgumentCount = 4; uint8_t level; uint16_t transitionTime; @@ -4025,12 +4134,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfLevelControlClusterMoveToLevelCallback(aEndpointId, apCommandObj, level, transitionTime, - optionMask, optionOverride); + wasHandled = + emberAfLevelControlClusterMoveToLevelCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, level, + transitionTime, optionMask, optionOverride, commandData); } break; } case Commands::MoveToLevelWithOnOff::Id: { + Commands::MoveToLevelWithOnOff::DecodableType commandData; expectArgumentCount = 2; uint8_t level; uint16_t transitionTime; @@ -4088,12 +4199,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = - emberAfLevelControlClusterMoveToLevelWithOnOffCallback(aEndpointId, apCommandObj, level, transitionTime); + wasHandled = emberAfLevelControlClusterMoveToLevelWithOnOffCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, level, transitionTime, commandData); } break; } case Commands::MoveWithOnOff::Id: { + Commands::MoveWithOnOff::DecodableType commandData; expectArgumentCount = 2; uint8_t moveMode; uint8_t rate; @@ -4151,11 +4263,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfLevelControlClusterMoveWithOnOffCallback(aEndpointId, apCommandObj, moveMode, rate); + wasHandled = emberAfLevelControlClusterMoveWithOnOffCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + moveMode, rate, commandData); } break; } case Commands::Step::Id: { + Commands::Step::DecodableType commandData; expectArgumentCount = 5; uint8_t stepMode; uint8_t stepSize; @@ -4225,12 +4339,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfLevelControlClusterStepCallback(aEndpointId, apCommandObj, stepMode, stepSize, transitionTime, - optionMask, optionOverride); + wasHandled = + emberAfLevelControlClusterStepCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, stepMode, stepSize, + transitionTime, optionMask, optionOverride, commandData); } break; } case Commands::StepWithOnOff::Id: { + Commands::StepWithOnOff::DecodableType commandData; expectArgumentCount = 3; uint8_t stepMode; uint8_t stepSize; @@ -4292,12 +4408,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = - emberAfLevelControlClusterStepWithOnOffCallback(aEndpointId, apCommandObj, stepMode, stepSize, transitionTime); + wasHandled = emberAfLevelControlClusterStepWithOnOffCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + stepMode, stepSize, transitionTime, commandData); } break; } case Commands::Stop::Id: { + Commands::Stop::DecodableType commandData; expectArgumentCount = 2; uint8_t optionMask; uint8_t optionOverride; @@ -4355,18 +4472,21 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfLevelControlClusterStopCallback(aEndpointId, apCommandObj, optionMask, optionOverride); + wasHandled = emberAfLevelControlClusterStopCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + optionMask, optionOverride, commandData); } break; } case Commands::StopWithOnOff::Id: { + Commands::StopWithOnOff::DecodableType commandData; - wasHandled = emberAfLevelControlClusterStopWithOnOffCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfLevelControlClusterStopWithOnOffCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, LevelControl::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -4374,9 +4494,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - LevelControl::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + LevelControl::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -4394,7 +4514,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace LowPower { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -4407,16 +4527,17 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::Sleep::Id: { + Commands::Sleep::DecodableType commandData; - wasHandled = emberAfLowPowerClusterSleepCallback(aEndpointId, apCommandObj); + wasHandled = emberAfLowPowerClusterSleepCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, LowPower::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -4424,9 +4545,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - LowPower::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + LowPower::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -4444,7 +4565,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace NetworkCommissioning { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -4457,9 +4578,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::AddThreadNetwork::Id: { + Commands::AddThreadNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan operationalDataset; uint64_t breadcrumb; @@ -4521,12 +4643,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterAddThreadNetworkCallback(aEndpointId, apCommandObj, - operationalDataset, breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterAddThreadNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, operationalDataset, breadcrumb, timeoutMs, commandData); } break; } case Commands::AddWiFiNetwork::Id: { + Commands::AddWiFiNetwork::DecodableType commandData; expectArgumentCount = 4; chip::ByteSpan ssid; chip::ByteSpan credentials; @@ -4592,12 +4715,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterAddWiFiNetworkCallback(aEndpointId, apCommandObj, ssid, credentials, - breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterAddWiFiNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, ssid, credentials, breadcrumb, timeoutMs, commandData); } break; } case Commands::DisableNetwork::Id: { + Commands::DisableNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan networkID; uint64_t breadcrumb; @@ -4659,12 +4783,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterDisableNetworkCallback(aEndpointId, apCommandObj, networkID, - breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterDisableNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, networkID, breadcrumb, timeoutMs, commandData); } break; } case Commands::EnableNetwork::Id: { + Commands::EnableNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan networkID; uint64_t breadcrumb; @@ -4726,12 +4851,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterEnableNetworkCallback(aEndpointId, apCommandObj, networkID, - breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterEnableNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, networkID, breadcrumb, timeoutMs, commandData); } break; } case Commands::GetLastNetworkCommissioningResult::Id: { + Commands::GetLastNetworkCommissioningResult::DecodableType commandData; expectArgumentCount = 1; uint32_t timeoutMs; bool argExists[1]; @@ -4785,12 +4911,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback(aEndpointId, apCommandObj, - timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, timeoutMs, commandData); } break; } case Commands::RemoveNetwork::Id: { + Commands::RemoveNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan NetworkID; uint64_t Breadcrumb; @@ -4852,12 +4979,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterRemoveNetworkCallback(aEndpointId, apCommandObj, NetworkID, - Breadcrumb, TimeoutMs); + wasHandled = emberAfNetworkCommissioningClusterRemoveNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, NetworkID, Breadcrumb, TimeoutMs, commandData); } break; } case Commands::ScanNetworks::Id: { + Commands::ScanNetworks::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan ssid; uint64_t breadcrumb; @@ -4919,12 +5047,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = - emberAfNetworkCommissioningClusterScanNetworksCallback(aEndpointId, apCommandObj, ssid, breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterScanNetworksCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, ssid, breadcrumb, timeoutMs, commandData); } break; } case Commands::UpdateThreadNetwork::Id: { + Commands::UpdateThreadNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan operationalDataset; uint64_t breadcrumb; @@ -4987,11 +5116,12 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { wasHandled = emberAfNetworkCommissioningClusterUpdateThreadNetworkCallback( - aEndpointId, apCommandObj, operationalDataset, breadcrumb, timeoutMs); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, operationalDataset, breadcrumb, timeoutMs, commandData); } break; } case Commands::UpdateWiFiNetwork::Id: { + Commands::UpdateWiFiNetwork::DecodableType commandData; expectArgumentCount = 4; chip::ByteSpan ssid; chip::ByteSpan credentials; @@ -5057,14 +5187,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback(aEndpointId, apCommandObj, ssid, - credentials, breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, ssid, credentials, breadcrumb, timeoutMs, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, NetworkCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -5072,9 +5202,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - NetworkCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + NetworkCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -5092,7 +5223,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace OtaSoftwareUpdateProvider { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -5105,9 +5236,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ApplyUpdateRequest::Id: { + Commands::ApplyUpdateRequest::DecodableType commandData; expectArgumentCount = 2; chip::ByteSpan updateToken; uint32_t newVersion; @@ -5165,12 +5297,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestCallback(aEndpointId, apCommandObj, - updateToken, newVersion); + wasHandled = emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, updateToken, newVersion, commandData); } break; } case Commands::NotifyUpdateApplied::Id: { + Commands::NotifyUpdateApplied::DecodableType commandData; expectArgumentCount = 2; chip::ByteSpan updateToken; uint32_t softwareVersion; @@ -5228,12 +5361,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedCallback(aEndpointId, apCommandObj, - updateToken, softwareVersion); + wasHandled = emberAfOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, updateToken, softwareVersion, commandData); } break; } case Commands::QueryImage::Id: { + Commands::QueryImage::DecodableType commandData; expectArgumentCount = 8; uint16_t vendorId; uint16_t productId; @@ -5317,14 +5451,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 8 == validArgumentCount) { wasHandled = emberAfOtaSoftwareUpdateProviderClusterQueryImageCallback( - aEndpointId, apCommandObj, vendorId, productId, hardwareVersion, softwareVersion, protocolsSupported, - const_cast(location), requestorCanConsent, metadataForProvider); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, vendorId, productId, hardwareVersion, softwareVersion, + protocolsSupported, const_cast(location), requestorCanConsent, metadataForProvider, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, OtaSoftwareUpdateProvider::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -5332,9 +5466,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - OtaSoftwareUpdateProvider::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + OtaSoftwareUpdateProvider::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -5352,7 +5487,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace OnOff { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -5365,26 +5500,29 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::Off::Id: { + Commands::Off::DecodableType commandData; - wasHandled = emberAfOnOffClusterOffCallback(aEndpointId, apCommandObj); + wasHandled = emberAfOnOffClusterOffCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::On::Id: { + Commands::On::DecodableType commandData; - wasHandled = emberAfOnOffClusterOnCallback(aEndpointId, apCommandObj); + wasHandled = emberAfOnOffClusterOnCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::Toggle::Id: { + Commands::Toggle::DecodableType commandData; - wasHandled = emberAfOnOffClusterToggleCallback(aEndpointId, apCommandObj); + wasHandled = emberAfOnOffClusterToggleCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, OnOff::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -5392,9 +5530,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - OnOff::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + OnOff::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -5412,7 +5550,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace OperationalCredentials { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -5425,9 +5563,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::AddNOC::Id: { + Commands::AddNOC::DecodableType commandData; expectArgumentCount = 5; chip::ByteSpan NOCValue; chip::ByteSpan ICACValue; @@ -5497,12 +5636,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterAddNOCCallback(aEndpointId, apCommandObj, NOCValue, ICACValue, - IPKValue, CaseAdminNode, AdminVendorId); + wasHandled = emberAfOperationalCredentialsClusterAddNOCCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, NOCValue, ICACValue, IPKValue, CaseAdminNode, + AdminVendorId, commandData); } break; } case Commands::AddTrustedRootCertificate::Id: { + Commands::AddTrustedRootCertificate::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan RootCertificate; bool argExists[1]; @@ -5556,12 +5697,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback(aEndpointId, apCommandObj, - RootCertificate); + wasHandled = emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, RootCertificate, commandData); } break; } case Commands::AttestationRequest::Id: { + Commands::AttestationRequest::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan AttestationNonce; bool argExists[1]; @@ -5615,12 +5757,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = - emberAfOperationalCredentialsClusterAttestationRequestCallback(aEndpointId, apCommandObj, AttestationNonce); + wasHandled = emberAfOperationalCredentialsClusterAttestationRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, AttestationNonce, commandData); } break; } case Commands::CertificateChainRequest::Id: { + Commands::CertificateChainRequest::DecodableType commandData; expectArgumentCount = 1; uint8_t CertificateType; bool argExists[1]; @@ -5674,12 +5817,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = - emberAfOperationalCredentialsClusterCertificateChainRequestCallback(aEndpointId, apCommandObj, CertificateType); + wasHandled = emberAfOperationalCredentialsClusterCertificateChainRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CertificateType, commandData); } break; } case Commands::OpCSRRequest::Id: { + Commands::OpCSRRequest::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan CSRNonce; bool argExists[1]; @@ -5733,11 +5877,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterOpCSRRequestCallback(aEndpointId, apCommandObj, CSRNonce); + wasHandled = emberAfOperationalCredentialsClusterOpCSRRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CSRNonce, commandData); } break; } case Commands::RemoveFabric::Id: { + Commands::RemoveFabric::DecodableType commandData; expectArgumentCount = 1; uint8_t FabricIndex; bool argExists[1]; @@ -5791,11 +5937,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterRemoveFabricCallback(aEndpointId, apCommandObj, FabricIndex); + wasHandled = emberAfOperationalCredentialsClusterRemoveFabricCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, FabricIndex, commandData); } break; } case Commands::RemoveTrustedRootCertificate::Id: { + Commands::RemoveTrustedRootCertificate::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan TrustedRootIdentifier; bool argExists[1]; @@ -5849,12 +5997,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterRemoveTrustedRootCertificateCallback(aEndpointId, apCommandObj, - TrustedRootIdentifier); + wasHandled = emberAfOperationalCredentialsClusterRemoveTrustedRootCertificateCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, TrustedRootIdentifier, commandData); } break; } case Commands::UpdateFabricLabel::Id: { + Commands::UpdateFabricLabel::DecodableType commandData; expectArgumentCount = 1; const uint8_t * Label; bool argExists[1]; @@ -5909,12 +6058,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterUpdateFabricLabelCallback(aEndpointId, apCommandObj, - const_cast(Label)); + wasHandled = emberAfOperationalCredentialsClusterUpdateFabricLabelCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, const_cast(Label), commandData); } break; } case Commands::UpdateNOC::Id: { + Commands::UpdateNOC::DecodableType commandData; expectArgumentCount = 2; chip::ByteSpan NOCValue; chip::ByteSpan ICACValue; @@ -5972,13 +6122,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterUpdateNOCCallback(aEndpointId, apCommandObj, NOCValue, ICACValue); + wasHandled = emberAfOperationalCredentialsClusterUpdateNOCCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, NOCValue, ICACValue, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, OperationalCredentials::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -5986,9 +6137,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - OperationalCredentials::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + OperationalCredentials::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -6006,7 +6158,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace Scenes { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -6019,9 +6171,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::AddScene::Id: { + Commands::AddScene::DecodableType commandData; expectArgumentCount = 5; uint16_t groupId; uint8_t sceneId; @@ -6093,12 +6246,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfScenesClusterAddSceneCallback(aEndpointId, apCommandObj, groupId, sceneId, transitionTime, - const_cast(sceneName), extensionFieldSets); + wasHandled = emberAfScenesClusterAddSceneCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, groupId, + sceneId, transitionTime, const_cast(sceneName), + extensionFieldSets, commandData); } break; } case Commands::GetSceneMembership::Id: { + Commands::GetSceneMembership::DecodableType commandData; expectArgumentCount = 1; uint16_t groupId; bool argExists[1]; @@ -6152,11 +6307,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfScenesClusterGetSceneMembershipCallback(aEndpointId, apCommandObj, groupId); + wasHandled = emberAfScenesClusterGetSceneMembershipCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + groupId, commandData); } break; } case Commands::RecallScene::Id: { + Commands::RecallScene::DecodableType commandData; expectArgumentCount = 3; uint16_t groupId; uint8_t sceneId; @@ -6218,11 +6375,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfScenesClusterRecallSceneCallback(aEndpointId, apCommandObj, groupId, sceneId, transitionTime); + wasHandled = emberAfScenesClusterRecallSceneCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, groupId, + sceneId, transitionTime, commandData); } break; } case Commands::RemoveAllScenes::Id: { + Commands::RemoveAllScenes::DecodableType commandData; expectArgumentCount = 1; uint16_t groupId; bool argExists[1]; @@ -6276,11 +6435,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfScenesClusterRemoveAllScenesCallback(aEndpointId, apCommandObj, groupId); + wasHandled = emberAfScenesClusterRemoveAllScenesCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + groupId, commandData); } break; } case Commands::RemoveScene::Id: { + Commands::RemoveScene::DecodableType commandData; expectArgumentCount = 2; uint16_t groupId; uint8_t sceneId; @@ -6338,11 +6499,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfScenesClusterRemoveSceneCallback(aEndpointId, apCommandObj, groupId, sceneId); + wasHandled = emberAfScenesClusterRemoveSceneCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, groupId, + sceneId, commandData); } break; } case Commands::StoreScene::Id: { + Commands::StoreScene::DecodableType commandData; expectArgumentCount = 2; uint16_t groupId; uint8_t sceneId; @@ -6400,11 +6563,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfScenesClusterStoreSceneCallback(aEndpointId, apCommandObj, groupId, sceneId); + wasHandled = emberAfScenesClusterStoreSceneCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, groupId, + sceneId, commandData); } break; } case Commands::ViewScene::Id: { + Commands::ViewScene::DecodableType commandData; expectArgumentCount = 2; uint16_t groupId; uint8_t sceneId; @@ -6462,13 +6627,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfScenesClusterViewSceneCallback(aEndpointId, apCommandObj, groupId, sceneId); + wasHandled = emberAfScenesClusterViewSceneCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, groupId, + sceneId, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, Scenes::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -6476,9 +6642,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - Scenes::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + Scenes::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -6496,7 +6662,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace TestCluster { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -6509,26 +6675,31 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::Test::Id: { + Commands::Test::DecodableType commandData; - wasHandled = emberAfTestClusterClusterTestCallback(aEndpointId, apCommandObj); + wasHandled = emberAfTestClusterClusterTestCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::TestNotHandled::Id: { + Commands::TestNotHandled::DecodableType commandData; - wasHandled = emberAfTestClusterClusterTestNotHandledCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfTestClusterClusterTestNotHandledCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::TestSpecific::Id: { + Commands::TestSpecific::DecodableType commandData; - wasHandled = emberAfTestClusterClusterTestSpecificCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfTestClusterClusterTestSpecificCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, TestCluster::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -6536,9 +6707,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - TestCluster::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + TestCluster::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -6556,7 +6727,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace Thermostat { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -6569,14 +6740,17 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ClearWeeklySchedule::Id: { + Commands::ClearWeeklySchedule::DecodableType commandData; - wasHandled = emberAfThermostatClusterClearWeeklyScheduleCallback(aEndpointId, apCommandObj); + wasHandled = emberAfThermostatClusterClearWeeklyScheduleCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + commandData); break; } case Commands::GetWeeklySchedule::Id: { + Commands::GetWeeklySchedule::DecodableType commandData; expectArgumentCount = 2; uint8_t daysToReturn; uint8_t modeToReturn; @@ -6634,12 +6808,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = - emberAfThermostatClusterGetWeeklyScheduleCallback(aEndpointId, apCommandObj, daysToReturn, modeToReturn); + wasHandled = emberAfThermostatClusterGetWeeklyScheduleCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + daysToReturn, modeToReturn, commandData); } break; } case Commands::SetWeeklySchedule::Id: { + Commands::SetWeeklySchedule::DecodableType commandData; expectArgumentCount = 4; uint8_t numberOfTransitionsForSequence; uint8_t dayOfWeekForSequence; @@ -6706,12 +6881,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfThermostatClusterSetWeeklyScheduleCallback( - aEndpointId, apCommandObj, numberOfTransitionsForSequence, dayOfWeekForSequence, modeForSequence, payload); + wasHandled = emberAfThermostatClusterSetWeeklyScheduleCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + numberOfTransitionsForSequence, dayOfWeekForSequence, + modeForSequence, payload, commandData); } break; } case Commands::SetpointRaiseLower::Id: { + Commands::SetpointRaiseLower::DecodableType commandData; expectArgumentCount = 2; uint8_t mode; int8_t amount; @@ -6769,13 +6946,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfThermostatClusterSetpointRaiseLowerCallback(aEndpointId, apCommandObj, mode, amount); + wasHandled = emberAfThermostatClusterSetpointRaiseLowerCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, mode, amount, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, Thermostat::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -6783,9 +6961,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - Thermostat::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + Thermostat::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -6809,69 +6987,70 @@ void DispatchSingleClusterCommand(ClusterId aClusterId, CommandId aCommandId, En 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); TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); switch (aClusterId) { case Clusters::AdministratorCommissioning::Id: - Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::BarrierControl::Id: - Clusters::BarrierControl::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::BarrierControl::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::Basic::Id: - Clusters::Basic::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::Basic::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::Binding::Id: - Clusters::Binding::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::Binding::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::ColorControl::Id: - Clusters::ColorControl::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::ColorControl::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::DiagnosticLogs::Id: - Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::DoorLock::Id: - Clusters::DoorLock::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::DoorLock::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::GeneralCommissioning::Id: - Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::Groups::Id: - Clusters::Groups::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::Groups::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::IasZone::Id: - Clusters::IasZone::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::IasZone::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::Identify::Id: - Clusters::Identify::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::Identify::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::LevelControl::Id: - Clusters::LevelControl::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::LevelControl::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::LowPower::Id: - Clusters::LowPower::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::LowPower::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::NetworkCommissioning::Id: - Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::OtaSoftwareUpdateProvider::Id: - Clusters::OtaSoftwareUpdateProvider::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::OtaSoftwareUpdateProvider::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::OnOff::Id: - Clusters::OnOff::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::OnOff::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::OperationalCredentials::Id: - Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::Scenes::Id: - Clusters::Scenes::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::Scenes::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::TestCluster::Id: - Clusters::TestCluster::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::TestCluster::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::Thermostat::Id: - Clusters::Thermostat::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::Thermostat::DispatchServerCommand(apCommandObj, commandPath, aReader); break; default: // Unrecognized cluster ID, error status will apply. @@ -6894,6 +7073,7 @@ void DispatchSingleClusterResponseCommand(ClusterId aClusterId, CommandId aComma 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); TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); switch (aClusterId) diff --git a/zzz_generated/tv-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/tv-app/zap-generated/IMClusterCommandHandler.cpp index 1ecb0f8adbeb3a..22d79e09788794 100644 --- a/zzz_generated/tv-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/tv-app/zap-generated/IMClusterCommandHandler.cpp @@ -23,6 +23,7 @@ #include "app/util/util.h" #include #include +#include #include #include @@ -35,15 +36,16 @@ namespace chip { namespace app { namespace { -void ReportCommandUnsupported(Command * aCommandObj, EndpointId aEndpointId, ClusterId aClusterId, CommandId aCommandId) +void ReportCommandUnsupported(Command * aCommandObj, const ConcreteCommandPath & aCommandPath) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - aClusterId, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + aCommandPath.mClusterId, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; aCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kNotFound, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandId), - ChipLogValueMEI(aClusterId)); + ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, + ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); } } // anonymous namespace @@ -53,7 +55,7 @@ namespace Clusters { namespace AccountLogin { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -66,9 +68,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::GetSetupPIN::Id: { + Commands::GetSetupPIN::DecodableType commandData; expectArgumentCount = 1; const uint8_t * tempAccountIdentifier; bool argExists[1]; @@ -123,12 +126,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfAccountLoginClusterGetSetupPINCallback(aEndpointId, apCommandObj, - const_cast(tempAccountIdentifier)); + wasHandled = + emberAfAccountLoginClusterGetSetupPINCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + const_cast(tempAccountIdentifier), commandData); } break; } case Commands::Login::Id: { + Commands::Login::DecodableType commandData; expectArgumentCount = 2; const uint8_t * tempAccountIdentifier; const uint8_t * setupPIN; @@ -188,14 +193,15 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfAccountLoginClusterLoginCallback( - aEndpointId, apCommandObj, const_cast(tempAccountIdentifier), const_cast(setupPIN)); + wasHandled = emberAfAccountLoginClusterLoginCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + const_cast(tempAccountIdentifier), + const_cast(setupPIN), commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, AccountLogin::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -203,9 +209,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - AccountLogin::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + AccountLogin::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -223,7 +229,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace AdministratorCommissioning { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -236,9 +242,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::OpenBasicCommissioningWindow::Id: { + Commands::OpenBasicCommissioningWindow::DecodableType commandData; expectArgumentCount = 1; uint16_t CommissioningTimeout; bool argExists[1]; @@ -292,12 +299,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfAdministratorCommissioningClusterOpenBasicCommissioningWindowCallback(aEndpointId, apCommandObj, - CommissioningTimeout); + wasHandled = emberAfAdministratorCommissioningClusterOpenBasicCommissioningWindowCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CommissioningTimeout, commandData); } break; } case Commands::OpenCommissioningWindow::Id: { + Commands::OpenCommissioningWindow::DecodableType commandData; expectArgumentCount = 6; uint16_t CommissioningTimeout; chip::ByteSpan PAKEVerifier; @@ -372,18 +380,21 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 6 == validArgumentCount) { wasHandled = emberAfAdministratorCommissioningClusterOpenCommissioningWindowCallback( - aEndpointId, apCommandObj, CommissioningTimeout, PAKEVerifier, Discriminator, Iterations, Salt, PasscodeID); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CommissioningTimeout, PAKEVerifier, Discriminator, + Iterations, Salt, PasscodeID, commandData); } break; } case Commands::RevokeCommissioning::Id: { + Commands::RevokeCommissioning::DecodableType commandData; - wasHandled = emberAfAdministratorCommissioningClusterRevokeCommissioningCallback(aEndpointId, apCommandObj); + wasHandled = emberAfAdministratorCommissioningClusterRevokeCommissioningCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, AdministratorCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -391,9 +402,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - AdministratorCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + AdministratorCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -411,7 +423,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace ApplicationBasic { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -424,9 +436,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ChangeStatus::Id: { + Commands::ChangeStatus::DecodableType commandData; expectArgumentCount = 1; uint8_t status; bool argExists[1]; @@ -480,13 +493,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfApplicationBasicClusterChangeStatusCallback(aEndpointId, apCommandObj, status); + wasHandled = emberAfApplicationBasicClusterChangeStatusCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, status, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, ApplicationBasic::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -494,9 +508,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - ApplicationBasic::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + ApplicationBasic::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -514,7 +529,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace ApplicationLauncher { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -527,9 +542,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::LaunchApp::Id: { + Commands::LaunchApp::DecodableType commandData; expectArgumentCount = 3; const uint8_t * data; uint16_t catalogVendorId; @@ -594,13 +610,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { wasHandled = emberAfApplicationLauncherClusterLaunchAppCallback( - aEndpointId, apCommandObj, const_cast(data), catalogVendorId, const_cast(applicationId)); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, const_cast(data), catalogVendorId, + const_cast(applicationId), commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, ApplicationLauncher::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -608,9 +625,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - ApplicationLauncher::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + ApplicationLauncher::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -628,7 +646,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace AudioOutput { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -641,9 +659,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::RenameOutput::Id: { + Commands::RenameOutput::DecodableType commandData; expectArgumentCount = 2; uint8_t index; const uint8_t * name; @@ -702,12 +721,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = - emberAfAudioOutputClusterRenameOutputCallback(aEndpointId, apCommandObj, index, const_cast(name)); + wasHandled = emberAfAudioOutputClusterRenameOutputCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + index, const_cast(name), commandData); } break; } case Commands::SelectOutput::Id: { + Commands::SelectOutput::DecodableType commandData; expectArgumentCount = 1; uint8_t index; bool argExists[1]; @@ -761,13 +781,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfAudioOutputClusterSelectOutputCallback(aEndpointId, apCommandObj, index); + wasHandled = emberAfAudioOutputClusterSelectOutputCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + index, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, AudioOutput::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -775,9 +796,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - AudioOutput::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + AudioOutput::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -795,16 +816,16 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace Basic { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { - ReportCommandUnsupported(apCommandObj, aEndpointId, Basic::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); } } // namespace Basic namespace Binding { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -817,9 +838,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::Bind::Id: { + Commands::Bind::DecodableType commandData; expectArgumentCount = 4; chip::NodeId nodeId; chip::GroupId groupId; @@ -885,11 +907,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfBindingClusterBindCallback(aEndpointId, apCommandObj, nodeId, groupId, endpointId, clusterId); + wasHandled = emberAfBindingClusterBindCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, nodeId, + groupId, endpointId, clusterId, commandData); } break; } case Commands::Unbind::Id: { + Commands::Unbind::DecodableType commandData; expectArgumentCount = 4; chip::NodeId nodeId; chip::GroupId groupId; @@ -955,13 +979,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfBindingClusterUnbindCallback(aEndpointId, apCommandObj, nodeId, groupId, endpointId, clusterId); + wasHandled = emberAfBindingClusterUnbindCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, nodeId, + groupId, endpointId, clusterId, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, Binding::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -969,9 +994,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - Binding::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + Binding::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -989,7 +1014,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace ContentLauncher { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -1002,9 +1027,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::LaunchContent::Id: { + Commands::LaunchContent::DecodableType commandData; expectArgumentCount = 2; bool autoPlay; const uint8_t * data; @@ -1063,12 +1089,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfContentLauncherClusterLaunchContentCallback(aEndpointId, apCommandObj, autoPlay, - const_cast(data)); + wasHandled = emberAfContentLauncherClusterLaunchContentCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, autoPlay, const_cast(data), commandData); } break; } case Commands::LaunchURL::Id: { + Commands::LaunchURL::DecodableType commandData; expectArgumentCount = 2; const uint8_t * contentURL; const uint8_t * displayString; @@ -1128,14 +1155,15 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfContentLauncherClusterLaunchURLCallback( - aEndpointId, apCommandObj, const_cast(contentURL), const_cast(displayString)); + wasHandled = emberAfContentLauncherClusterLaunchURLCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + const_cast(contentURL), + const_cast(displayString), commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, ContentLauncher::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -1143,9 +1171,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - ContentLauncher::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + ContentLauncher::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -1163,7 +1192,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace DiagnosticLogs { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -1176,9 +1205,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::RetrieveLogsRequest::Id: { + Commands::RetrieveLogsRequest::DecodableType commandData; expectArgumentCount = 3; uint8_t intent; uint8_t requestedProtocol; @@ -1240,14 +1270,15 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfDiagnosticLogsClusterRetrieveLogsRequestCallback(aEndpointId, apCommandObj, intent, - requestedProtocol, transferFileDesignator); + wasHandled = emberAfDiagnosticLogsClusterRetrieveLogsRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, intent, requestedProtocol, transferFileDesignator, + commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, DiagnosticLogs::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -1255,9 +1286,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - DiagnosticLogs::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + DiagnosticLogs::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -1275,7 +1306,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace GeneralCommissioning { -void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -1288,7 +1319,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ArmFailSafeResponse::Id: { expectArgumentCount = 2; @@ -1349,8 +1380,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfGeneralCommissioningClusterArmFailSafeResponseCallback(aEndpointId, apCommandObj, errorCode, - const_cast(debugText)); + wasHandled = emberAfGeneralCommissioningClusterArmFailSafeResponseCallback( + aCommandPath.mEndpointId, apCommandObj, errorCode, const_cast(debugText)); } break; } @@ -1414,7 +1445,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { wasHandled = emberAfGeneralCommissioningClusterCommissioningCompleteResponseCallback( - aEndpointId, apCommandObj, errorCode, const_cast(debugText)); + aCommandPath.mEndpointId, apCommandObj, errorCode, const_cast(debugText)); } break; } @@ -1478,13 +1509,13 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { wasHandled = emberAfGeneralCommissioningClusterSetRegulatoryConfigResponseCallback( - aEndpointId, apCommandObj, errorCode, const_cast(debugText)); + aCommandPath.mEndpointId, apCommandObj, errorCode, const_cast(debugText)); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, GeneralCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -1492,9 +1523,10 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - GeneralCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + GeneralCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -1512,7 +1544,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E namespace GeneralCommissioning { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -1525,9 +1557,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ArmFailSafe::Id: { + Commands::ArmFailSafe::DecodableType commandData; expectArgumentCount = 3; uint16_t expiryLengthSeconds; uint64_t breadcrumb; @@ -1589,17 +1622,20 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfGeneralCommissioningClusterArmFailSafeCallback(aEndpointId, apCommandObj, expiryLengthSeconds, - breadcrumb, timeoutMs); + wasHandled = emberAfGeneralCommissioningClusterArmFailSafeCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, expiryLengthSeconds, breadcrumb, timeoutMs, commandData); } break; } case Commands::CommissioningComplete::Id: { + Commands::CommissioningComplete::DecodableType commandData; - wasHandled = emberAfGeneralCommissioningClusterCommissioningCompleteCallback(aEndpointId, apCommandObj); + wasHandled = emberAfGeneralCommissioningClusterCommissioningCompleteCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, commandData); break; } case Commands::SetRegulatoryConfig::Id: { + Commands::SetRegulatoryConfig::DecodableType commandData; expectArgumentCount = 4; uint8_t location; const uint8_t * countryCode; @@ -1667,13 +1703,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { wasHandled = emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback( - aEndpointId, apCommandObj, location, const_cast(countryCode), breadcrumb, timeoutMs); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, location, const_cast(countryCode), breadcrumb, + timeoutMs, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, GeneralCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -1681,9 +1718,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - GeneralCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + GeneralCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -1701,7 +1739,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace KeypadInput { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -1714,9 +1752,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::SendKey::Id: { + Commands::SendKey::DecodableType commandData; expectArgumentCount = 1; uint8_t keyCode; bool argExists[1]; @@ -1770,13 +1809,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfKeypadInputClusterSendKeyCallback(aEndpointId, apCommandObj, keyCode); + wasHandled = emberAfKeypadInputClusterSendKeyCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, keyCode, + commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, KeypadInput::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -1784,9 +1824,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - KeypadInput::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + KeypadInput::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -1804,7 +1844,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace LevelControl { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -1817,9 +1857,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::Move::Id: { + Commands::Move::DecodableType commandData; expectArgumentCount = 4; uint8_t moveMode; uint8_t rate; @@ -1885,12 +1926,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = - emberAfLevelControlClusterMoveCallback(aEndpointId, apCommandObj, moveMode, rate, optionMask, optionOverride); + wasHandled = emberAfLevelControlClusterMoveCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, moveMode, + rate, optionMask, optionOverride, commandData); } break; } case Commands::MoveToLevel::Id: { + Commands::MoveToLevel::DecodableType commandData; expectArgumentCount = 4; uint8_t level; uint16_t transitionTime; @@ -1956,12 +1998,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfLevelControlClusterMoveToLevelCallback(aEndpointId, apCommandObj, level, transitionTime, - optionMask, optionOverride); + wasHandled = + emberAfLevelControlClusterMoveToLevelCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, level, + transitionTime, optionMask, optionOverride, commandData); } break; } case Commands::MoveToLevelWithOnOff::Id: { + Commands::MoveToLevelWithOnOff::DecodableType commandData; expectArgumentCount = 2; uint8_t level; uint16_t transitionTime; @@ -2019,12 +2063,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = - emberAfLevelControlClusterMoveToLevelWithOnOffCallback(aEndpointId, apCommandObj, level, transitionTime); + wasHandled = emberAfLevelControlClusterMoveToLevelWithOnOffCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, level, transitionTime, commandData); } break; } case Commands::MoveWithOnOff::Id: { + Commands::MoveWithOnOff::DecodableType commandData; expectArgumentCount = 2; uint8_t moveMode; uint8_t rate; @@ -2082,11 +2127,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfLevelControlClusterMoveWithOnOffCallback(aEndpointId, apCommandObj, moveMode, rate); + wasHandled = emberAfLevelControlClusterMoveWithOnOffCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + moveMode, rate, commandData); } break; } case Commands::Step::Id: { + Commands::Step::DecodableType commandData; expectArgumentCount = 5; uint8_t stepMode; uint8_t stepSize; @@ -2156,12 +2203,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfLevelControlClusterStepCallback(aEndpointId, apCommandObj, stepMode, stepSize, transitionTime, - optionMask, optionOverride); + wasHandled = + emberAfLevelControlClusterStepCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, stepMode, stepSize, + transitionTime, optionMask, optionOverride, commandData); } break; } case Commands::StepWithOnOff::Id: { + Commands::StepWithOnOff::DecodableType commandData; expectArgumentCount = 3; uint8_t stepMode; uint8_t stepSize; @@ -2223,12 +2272,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = - emberAfLevelControlClusterStepWithOnOffCallback(aEndpointId, apCommandObj, stepMode, stepSize, transitionTime); + wasHandled = emberAfLevelControlClusterStepWithOnOffCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + stepMode, stepSize, transitionTime, commandData); } break; } case Commands::Stop::Id: { + Commands::Stop::DecodableType commandData; expectArgumentCount = 2; uint8_t optionMask; uint8_t optionOverride; @@ -2286,18 +2336,21 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfLevelControlClusterStopCallback(aEndpointId, apCommandObj, optionMask, optionOverride); + wasHandled = emberAfLevelControlClusterStopCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + optionMask, optionOverride, commandData); } break; } case Commands::StopWithOnOff::Id: { + Commands::StopWithOnOff::DecodableType commandData; - wasHandled = emberAfLevelControlClusterStopWithOnOffCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfLevelControlClusterStopWithOnOffCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, LevelControl::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -2305,9 +2358,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - LevelControl::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + LevelControl::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -2325,7 +2378,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace LowPower { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -2338,16 +2391,17 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::Sleep::Id: { + Commands::Sleep::DecodableType commandData; - wasHandled = emberAfLowPowerClusterSleepCallback(aEndpointId, apCommandObj); + wasHandled = emberAfLowPowerClusterSleepCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, LowPower::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -2355,9 +2409,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - LowPower::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + LowPower::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -2375,7 +2429,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace MediaInput { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -2388,14 +2442,17 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::HideInputStatus::Id: { + Commands::HideInputStatus::DecodableType commandData; - wasHandled = emberAfMediaInputClusterHideInputStatusCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfMediaInputClusterHideInputStatusCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::RenameInput::Id: { + Commands::RenameInput::DecodableType commandData; expectArgumentCount = 2; uint8_t index; const uint8_t * name; @@ -2454,12 +2511,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = - emberAfMediaInputClusterRenameInputCallback(aEndpointId, apCommandObj, index, const_cast(name)); + wasHandled = emberAfMediaInputClusterRenameInputCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + index, const_cast(name), commandData); } break; } case Commands::SelectInput::Id: { + Commands::SelectInput::DecodableType commandData; expectArgumentCount = 1; uint8_t index; bool argExists[1]; @@ -2513,18 +2571,21 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfMediaInputClusterSelectInputCallback(aEndpointId, apCommandObj, index); + wasHandled = emberAfMediaInputClusterSelectInputCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + index, commandData); } break; } case Commands::ShowInputStatus::Id: { + Commands::ShowInputStatus::DecodableType commandData; - wasHandled = emberAfMediaInputClusterShowInputStatusCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfMediaInputClusterShowInputStatusCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, MediaInput::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -2532,9 +2593,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - MediaInput::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + MediaInput::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -2552,7 +2613,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace MediaPlayback { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -2565,39 +2626,52 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::MediaFastForward::Id: { + Commands::MediaFastForward::DecodableType commandData; - wasHandled = emberAfMediaPlaybackClusterMediaFastForwardCallback(aEndpointId, apCommandObj); + wasHandled = emberAfMediaPlaybackClusterMediaFastForwardCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + commandData); break; } case Commands::MediaNext::Id: { + Commands::MediaNext::DecodableType commandData; - wasHandled = emberAfMediaPlaybackClusterMediaNextCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfMediaPlaybackClusterMediaNextCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::MediaPause::Id: { + Commands::MediaPause::DecodableType commandData; - wasHandled = emberAfMediaPlaybackClusterMediaPauseCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfMediaPlaybackClusterMediaPauseCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::MediaPlay::Id: { + Commands::MediaPlay::DecodableType commandData; - wasHandled = emberAfMediaPlaybackClusterMediaPlayCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfMediaPlaybackClusterMediaPlayCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::MediaPrevious::Id: { + Commands::MediaPrevious::DecodableType commandData; - wasHandled = emberAfMediaPlaybackClusterMediaPreviousCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfMediaPlaybackClusterMediaPreviousCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::MediaRewind::Id: { + Commands::MediaRewind::DecodableType commandData; - wasHandled = emberAfMediaPlaybackClusterMediaRewindCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfMediaPlaybackClusterMediaRewindCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::MediaSeek::Id: { + Commands::MediaSeek::DecodableType commandData; expectArgumentCount = 1; uint64_t position; bool argExists[1]; @@ -2651,11 +2725,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfMediaPlaybackClusterMediaSeekCallback(aEndpointId, apCommandObj, position); + wasHandled = emberAfMediaPlaybackClusterMediaSeekCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + position, commandData); } break; } case Commands::MediaSkipBackward::Id: { + Commands::MediaSkipBackward::DecodableType commandData; expectArgumentCount = 1; uint64_t deltaPositionMilliseconds; bool argExists[1]; @@ -2709,12 +2785,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = - emberAfMediaPlaybackClusterMediaSkipBackwardCallback(aEndpointId, apCommandObj, deltaPositionMilliseconds); + wasHandled = emberAfMediaPlaybackClusterMediaSkipBackwardCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, deltaPositionMilliseconds, commandData); } break; } case Commands::MediaSkipForward::Id: { + Commands::MediaSkipForward::DecodableType commandData; expectArgumentCount = 1; uint64_t deltaPositionMilliseconds; bool argExists[1]; @@ -2768,24 +2845,28 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = - emberAfMediaPlaybackClusterMediaSkipForwardCallback(aEndpointId, apCommandObj, deltaPositionMilliseconds); + wasHandled = emberAfMediaPlaybackClusterMediaSkipForwardCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, deltaPositionMilliseconds, commandData); } break; } case Commands::MediaStartOver::Id: { + Commands::MediaStartOver::DecodableType commandData; - wasHandled = emberAfMediaPlaybackClusterMediaStartOverCallback(aEndpointId, apCommandObj); + wasHandled = emberAfMediaPlaybackClusterMediaStartOverCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + commandData); break; } case Commands::MediaStop::Id: { + Commands::MediaStop::DecodableType commandData; - wasHandled = emberAfMediaPlaybackClusterMediaStopCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfMediaPlaybackClusterMediaStopCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, MediaPlayback::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -2793,9 +2874,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - MediaPlayback::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + MediaPlayback::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -2813,7 +2894,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace NetworkCommissioning { -void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -2826,7 +2907,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::AddThreadNetworkResponse::Id: { expectArgumentCount = 2; @@ -2888,7 +2969,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { wasHandled = emberAfNetworkCommissioningClusterAddThreadNetworkResponseCallback( - aEndpointId, apCommandObj, errorCode, const_cast(debugText)); + aCommandPath.mEndpointId, apCommandObj, errorCode, const_cast(debugText)); } break; } @@ -2951,8 +3032,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterAddWiFiNetworkResponseCallback(aEndpointId, apCommandObj, errorCode, - const_cast(debugText)); + wasHandled = emberAfNetworkCommissioningClusterAddWiFiNetworkResponseCallback( + aCommandPath.mEndpointId, apCommandObj, errorCode, const_cast(debugText)); } break; } @@ -3015,8 +3096,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterDisableNetworkResponseCallback(aEndpointId, apCommandObj, errorCode, - const_cast(debugText)); + wasHandled = emberAfNetworkCommissioningClusterDisableNetworkResponseCallback( + aCommandPath.mEndpointId, apCommandObj, errorCode, const_cast(debugText)); } break; } @@ -3079,8 +3160,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterEnableNetworkResponseCallback(aEndpointId, apCommandObj, errorCode, - const_cast(debugText)); + wasHandled = emberAfNetworkCommissioningClusterEnableNetworkResponseCallback( + aCommandPath.mEndpointId, apCommandObj, errorCode, const_cast(debugText)); } break; } @@ -3143,8 +3224,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterRemoveNetworkResponseCallback(aEndpointId, apCommandObj, errorCode, - const_cast(debugText)); + wasHandled = emberAfNetworkCommissioningClusterRemoveNetworkResponseCallback( + aCommandPath.mEndpointId, apCommandObj, errorCode, const_cast(debugText)); } break; } @@ -3218,7 +3299,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { wasHandled = emberAfNetworkCommissioningClusterScanNetworksResponseCallback( - aEndpointId, apCommandObj, errorCode, const_cast(debugText), wifiScanResults, threadScanResults); + aCommandPath.mEndpointId, apCommandObj, errorCode, const_cast(debugText), wifiScanResults, + threadScanResults); } break; } @@ -3282,7 +3364,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { wasHandled = emberAfNetworkCommissioningClusterUpdateThreadNetworkResponseCallback( - aEndpointId, apCommandObj, errorCode, const_cast(debugText)); + aCommandPath.mEndpointId, apCommandObj, errorCode, const_cast(debugText)); } break; } @@ -3346,13 +3428,13 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { wasHandled = emberAfNetworkCommissioningClusterUpdateWiFiNetworkResponseCallback( - aEndpointId, apCommandObj, errorCode, const_cast(debugText)); + aCommandPath.mEndpointId, apCommandObj, errorCode, const_cast(debugText)); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, NetworkCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -3360,9 +3442,10 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - NetworkCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + NetworkCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -3380,7 +3463,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E namespace NetworkCommissioning { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -3393,9 +3476,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::AddThreadNetwork::Id: { + Commands::AddThreadNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan operationalDataset; uint64_t breadcrumb; @@ -3457,12 +3541,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterAddThreadNetworkCallback(aEndpointId, apCommandObj, - operationalDataset, breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterAddThreadNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, operationalDataset, breadcrumb, timeoutMs, commandData); } break; } case Commands::AddWiFiNetwork::Id: { + Commands::AddWiFiNetwork::DecodableType commandData; expectArgumentCount = 4; chip::ByteSpan ssid; chip::ByteSpan credentials; @@ -3528,12 +3613,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterAddWiFiNetworkCallback(aEndpointId, apCommandObj, ssid, credentials, - breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterAddWiFiNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, ssid, credentials, breadcrumb, timeoutMs, commandData); } break; } case Commands::DisableNetwork::Id: { + Commands::DisableNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan networkID; uint64_t breadcrumb; @@ -3595,12 +3681,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterDisableNetworkCallback(aEndpointId, apCommandObj, networkID, - breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterDisableNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, networkID, breadcrumb, timeoutMs, commandData); } break; } case Commands::EnableNetwork::Id: { + Commands::EnableNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan networkID; uint64_t breadcrumb; @@ -3662,12 +3749,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterEnableNetworkCallback(aEndpointId, apCommandObj, networkID, - breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterEnableNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, networkID, breadcrumb, timeoutMs, commandData); } break; } case Commands::GetLastNetworkCommissioningResult::Id: { + Commands::GetLastNetworkCommissioningResult::DecodableType commandData; expectArgumentCount = 1; uint32_t timeoutMs; bool argExists[1]; @@ -3721,12 +3809,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback(aEndpointId, apCommandObj, - timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, timeoutMs, commandData); } break; } case Commands::RemoveNetwork::Id: { + Commands::RemoveNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan NetworkID; uint64_t Breadcrumb; @@ -3788,12 +3877,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterRemoveNetworkCallback(aEndpointId, apCommandObj, NetworkID, - Breadcrumb, TimeoutMs); + wasHandled = emberAfNetworkCommissioningClusterRemoveNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, NetworkID, Breadcrumb, TimeoutMs, commandData); } break; } case Commands::ScanNetworks::Id: { + Commands::ScanNetworks::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan ssid; uint64_t breadcrumb; @@ -3855,12 +3945,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = - emberAfNetworkCommissioningClusterScanNetworksCallback(aEndpointId, apCommandObj, ssid, breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterScanNetworksCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, ssid, breadcrumb, timeoutMs, commandData); } break; } case Commands::UpdateThreadNetwork::Id: { + Commands::UpdateThreadNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan operationalDataset; uint64_t breadcrumb; @@ -3923,11 +4014,12 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { wasHandled = emberAfNetworkCommissioningClusterUpdateThreadNetworkCallback( - aEndpointId, apCommandObj, operationalDataset, breadcrumb, timeoutMs); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, operationalDataset, breadcrumb, timeoutMs, commandData); } break; } case Commands::UpdateWiFiNetwork::Id: { + Commands::UpdateWiFiNetwork::DecodableType commandData; expectArgumentCount = 4; chip::ByteSpan ssid; chip::ByteSpan credentials; @@ -3993,14 +4085,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback(aEndpointId, apCommandObj, ssid, - credentials, breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, ssid, credentials, breadcrumb, timeoutMs, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, NetworkCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -4008,9 +4100,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - NetworkCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + NetworkCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -4028,7 +4121,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace OtaSoftwareUpdateProvider { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -4041,9 +4134,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ApplyUpdateRequest::Id: { + Commands::ApplyUpdateRequest::DecodableType commandData; expectArgumentCount = 2; chip::ByteSpan updateToken; uint32_t newVersion; @@ -4101,12 +4195,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestCallback(aEndpointId, apCommandObj, - updateToken, newVersion); + wasHandled = emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, updateToken, newVersion, commandData); } break; } case Commands::NotifyUpdateApplied::Id: { + Commands::NotifyUpdateApplied::DecodableType commandData; expectArgumentCount = 2; chip::ByteSpan updateToken; uint32_t softwareVersion; @@ -4164,12 +4259,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedCallback(aEndpointId, apCommandObj, - updateToken, softwareVersion); + wasHandled = emberAfOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, updateToken, softwareVersion, commandData); } break; } case Commands::QueryImage::Id: { + Commands::QueryImage::DecodableType commandData; expectArgumentCount = 8; uint16_t vendorId; uint16_t productId; @@ -4253,14 +4349,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 8 == validArgumentCount) { wasHandled = emberAfOtaSoftwareUpdateProviderClusterQueryImageCallback( - aEndpointId, apCommandObj, vendorId, productId, hardwareVersion, softwareVersion, protocolsSupported, - const_cast(location), requestorCanConsent, metadataForProvider); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, vendorId, productId, hardwareVersion, softwareVersion, + protocolsSupported, const_cast(location), requestorCanConsent, metadataForProvider, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, OtaSoftwareUpdateProvider::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -4268,9 +4364,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - OtaSoftwareUpdateProvider::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + OtaSoftwareUpdateProvider::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -4288,7 +4385,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace OnOff { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -4301,26 +4398,29 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::Off::Id: { + Commands::Off::DecodableType commandData; - wasHandled = emberAfOnOffClusterOffCallback(aEndpointId, apCommandObj); + wasHandled = emberAfOnOffClusterOffCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::On::Id: { + Commands::On::DecodableType commandData; - wasHandled = emberAfOnOffClusterOnCallback(aEndpointId, apCommandObj); + wasHandled = emberAfOnOffClusterOnCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::Toggle::Id: { + Commands::Toggle::DecodableType commandData; - wasHandled = emberAfOnOffClusterToggleCallback(aEndpointId, apCommandObj); + wasHandled = emberAfOnOffClusterToggleCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, OnOff::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -4328,9 +4428,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - OnOff::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + OnOff::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -4348,7 +4448,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace OperationalCredentials { -void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -4361,7 +4461,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::AttestationResponse::Id: { expectArgumentCount = 2; @@ -4421,7 +4521,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterAttestationResponseCallback(aEndpointId, apCommandObj, + wasHandled = emberAfOperationalCredentialsClusterAttestationResponseCallback(aCommandPath.mEndpointId, apCommandObj, AttestationElements, Signature); } break; @@ -4480,8 +4580,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = - emberAfOperationalCredentialsClusterCertificateChainResponseCallback(aEndpointId, apCommandObj, Certificate); + wasHandled = emberAfOperationalCredentialsClusterCertificateChainResponseCallback(aCommandPath.mEndpointId, + apCommandObj, Certificate); } break; } @@ -4547,8 +4647,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterNOCResponseCallback(aEndpointId, apCommandObj, StatusCode, - FabricIndex, DebugText); + wasHandled = emberAfOperationalCredentialsClusterNOCResponseCallback(aCommandPath.mEndpointId, apCommandObj, + StatusCode, FabricIndex, DebugText); } break; } @@ -4610,14 +4710,14 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterOpCSRResponseCallback(aEndpointId, apCommandObj, NOCSRElements, - AttestationSignature); + wasHandled = emberAfOperationalCredentialsClusterOpCSRResponseCallback(aCommandPath.mEndpointId, apCommandObj, + NOCSRElements, AttestationSignature); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, OperationalCredentials::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -4625,9 +4725,10 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - OperationalCredentials::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + OperationalCredentials::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -4645,7 +4746,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, CommandId aCommandId, E namespace OperationalCredentials { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -4658,9 +4759,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::AddNOC::Id: { + Commands::AddNOC::DecodableType commandData; expectArgumentCount = 5; chip::ByteSpan NOCValue; chip::ByteSpan ICACValue; @@ -4730,12 +4832,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterAddNOCCallback(aEndpointId, apCommandObj, NOCValue, ICACValue, - IPKValue, CaseAdminNode, AdminVendorId); + wasHandled = emberAfOperationalCredentialsClusterAddNOCCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, NOCValue, ICACValue, IPKValue, CaseAdminNode, + AdminVendorId, commandData); } break; } case Commands::AddTrustedRootCertificate::Id: { + Commands::AddTrustedRootCertificate::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan RootCertificate; bool argExists[1]; @@ -4789,12 +4893,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback(aEndpointId, apCommandObj, - RootCertificate); + wasHandled = emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, RootCertificate, commandData); } break; } case Commands::AttestationRequest::Id: { + Commands::AttestationRequest::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan AttestationNonce; bool argExists[1]; @@ -4848,12 +4953,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = - emberAfOperationalCredentialsClusterAttestationRequestCallback(aEndpointId, apCommandObj, AttestationNonce); + wasHandled = emberAfOperationalCredentialsClusterAttestationRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, AttestationNonce, commandData); } break; } case Commands::CertificateChainRequest::Id: { + Commands::CertificateChainRequest::DecodableType commandData; expectArgumentCount = 1; uint8_t CertificateType; bool argExists[1]; @@ -4907,12 +5013,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = - emberAfOperationalCredentialsClusterCertificateChainRequestCallback(aEndpointId, apCommandObj, CertificateType); + wasHandled = emberAfOperationalCredentialsClusterCertificateChainRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CertificateType, commandData); } break; } case Commands::OpCSRRequest::Id: { + Commands::OpCSRRequest::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan CSRNonce; bool argExists[1]; @@ -4966,11 +5073,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterOpCSRRequestCallback(aEndpointId, apCommandObj, CSRNonce); + wasHandled = emberAfOperationalCredentialsClusterOpCSRRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CSRNonce, commandData); } break; } case Commands::RemoveFabric::Id: { + Commands::RemoveFabric::DecodableType commandData; expectArgumentCount = 1; uint8_t FabricIndex; bool argExists[1]; @@ -5024,11 +5133,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterRemoveFabricCallback(aEndpointId, apCommandObj, FabricIndex); + wasHandled = emberAfOperationalCredentialsClusterRemoveFabricCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, FabricIndex, commandData); } break; } case Commands::RemoveTrustedRootCertificate::Id: { + Commands::RemoveTrustedRootCertificate::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan TrustedRootIdentifier; bool argExists[1]; @@ -5082,12 +5193,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterRemoveTrustedRootCertificateCallback(aEndpointId, apCommandObj, - TrustedRootIdentifier); + wasHandled = emberAfOperationalCredentialsClusterRemoveTrustedRootCertificateCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, TrustedRootIdentifier, commandData); } break; } case Commands::UpdateFabricLabel::Id: { + Commands::UpdateFabricLabel::DecodableType commandData; expectArgumentCount = 1; const uint8_t * Label; bool argExists[1]; @@ -5142,12 +5254,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterUpdateFabricLabelCallback(aEndpointId, apCommandObj, - const_cast(Label)); + wasHandled = emberAfOperationalCredentialsClusterUpdateFabricLabelCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, const_cast(Label), commandData); } break; } case Commands::UpdateNOC::Id: { + Commands::UpdateNOC::DecodableType commandData; expectArgumentCount = 2; chip::ByteSpan NOCValue; chip::ByteSpan ICACValue; @@ -5205,13 +5318,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterUpdateNOCCallback(aEndpointId, apCommandObj, NOCValue, ICACValue); + wasHandled = emberAfOperationalCredentialsClusterUpdateNOCCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, NOCValue, ICACValue, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, OperationalCredentials::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -5219,9 +5333,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - OperationalCredentials::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + OperationalCredentials::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -5239,7 +5354,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace TvChannel { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -5252,9 +5367,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ChangeChannel::Id: { + Commands::ChangeChannel::DecodableType commandData; expectArgumentCount = 1; const uint8_t * match; bool argExists[1]; @@ -5309,11 +5425,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfTvChannelClusterChangeChannelCallback(aEndpointId, apCommandObj, const_cast(match)); + wasHandled = emberAfTvChannelClusterChangeChannelCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + const_cast(match), commandData); } break; } case Commands::ChangeChannelByNumber::Id: { + Commands::ChangeChannelByNumber::DecodableType commandData; expectArgumentCount = 2; uint16_t majorNumber; uint16_t minorNumber; @@ -5371,12 +5489,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = - emberAfTvChannelClusterChangeChannelByNumberCallback(aEndpointId, apCommandObj, majorNumber, minorNumber); + wasHandled = emberAfTvChannelClusterChangeChannelByNumberCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, majorNumber, minorNumber, commandData); } break; } case Commands::SkipChannel::Id: { + Commands::SkipChannel::DecodableType commandData; expectArgumentCount = 1; uint16_t Count; bool argExists[1]; @@ -5430,13 +5549,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfTvChannelClusterSkipChannelCallback(aEndpointId, apCommandObj, Count); + wasHandled = emberAfTvChannelClusterSkipChannelCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, Count, + commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, TvChannel::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -5444,9 +5564,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - TvChannel::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + TvChannel::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -5464,7 +5584,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace TargetNavigator { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -5477,9 +5597,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::NavigateTarget::Id: { + Commands::NavigateTarget::DecodableType commandData; expectArgumentCount = 2; uint8_t target; const uint8_t * data; @@ -5538,14 +5659,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfTargetNavigatorClusterNavigateTargetCallback(aEndpointId, apCommandObj, target, - const_cast(data)); + wasHandled = emberAfTargetNavigatorClusterNavigateTargetCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, target, const_cast(data), commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, TargetNavigator::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -5553,9 +5674,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - TargetNavigator::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + TargetNavigator::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -5579,72 +5701,73 @@ void DispatchSingleClusterCommand(ClusterId aClusterId, CommandId aCommandId, En 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); TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); switch (aClusterId) { case Clusters::AccountLogin::Id: - Clusters::AccountLogin::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::AccountLogin::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::AdministratorCommissioning::Id: - Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::ApplicationBasic::Id: - Clusters::ApplicationBasic::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::ApplicationBasic::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::ApplicationLauncher::Id: - Clusters::ApplicationLauncher::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::ApplicationLauncher::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::AudioOutput::Id: - Clusters::AudioOutput::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::AudioOutput::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::Basic::Id: - Clusters::Basic::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::Basic::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::Binding::Id: - Clusters::Binding::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::Binding::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::ContentLauncher::Id: - Clusters::ContentLauncher::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::ContentLauncher::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::DiagnosticLogs::Id: - Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::GeneralCommissioning::Id: - Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::KeypadInput::Id: - Clusters::KeypadInput::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::KeypadInput::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::LevelControl::Id: - Clusters::LevelControl::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::LevelControl::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::LowPower::Id: - Clusters::LowPower::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::LowPower::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::MediaInput::Id: - Clusters::MediaInput::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::MediaInput::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::MediaPlayback::Id: - Clusters::MediaPlayback::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::MediaPlayback::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::NetworkCommissioning::Id: - Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::OtaSoftwareUpdateProvider::Id: - Clusters::OtaSoftwareUpdateProvider::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::OtaSoftwareUpdateProvider::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::OnOff::Id: - Clusters::OnOff::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::OnOff::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::OperationalCredentials::Id: - Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::TvChannel::Id: - Clusters::TvChannel::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::TvChannel::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::TargetNavigator::Id: - Clusters::TargetNavigator::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::TargetNavigator::DispatchServerCommand(apCommandObj, commandPath, aReader); break; default: // Unrecognized cluster ID, error status will apply. @@ -5667,18 +5790,19 @@ void DispatchSingleClusterResponseCommand(ClusterId aClusterId, CommandId aComma 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); TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); switch (aClusterId) { case Clusters::GeneralCommissioning::Id: - Clusters::GeneralCommissioning::DispatchClientCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::GeneralCommissioning::DispatchClientCommand(apCommandObj, commandPath, aReader); break; case Clusters::NetworkCommissioning::Id: - Clusters::NetworkCommissioning::DispatchClientCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::NetworkCommissioning::DispatchClientCommand(apCommandObj, commandPath, aReader); break; case Clusters::OperationalCredentials::Id: - Clusters::OperationalCredentials::DispatchClientCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::OperationalCredentials::DispatchClientCommand(apCommandObj, commandPath, aReader); break; default: // Unrecognized cluster ID, error status will apply. diff --git a/zzz_generated/tv-casting-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/tv-casting-app/zap-generated/IMClusterCommandHandler.cpp index 3791ed57d6644d..c34cd54487fad2 100644 --- a/zzz_generated/tv-casting-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/tv-casting-app/zap-generated/IMClusterCommandHandler.cpp @@ -23,6 +23,7 @@ #include "app/util/util.h" #include #include +#include #include #include @@ -35,15 +36,16 @@ namespace chip { namespace app { namespace { -void ReportCommandUnsupported(Command * aCommandObj, EndpointId aEndpointId, ClusterId aClusterId, CommandId aCommandId) +void ReportCommandUnsupported(Command * aCommandObj, const ConcreteCommandPath & aCommandPath) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - aClusterId, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + aCommandPath.mClusterId, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; aCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kNotFound, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandId), - ChipLogValueMEI(aClusterId)); + ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, + ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); } } // anonymous namespace @@ -53,7 +55,7 @@ namespace Clusters { namespace AdministratorCommissioning { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -66,9 +68,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::OpenBasicCommissioningWindow::Id: { + Commands::OpenBasicCommissioningWindow::DecodableType commandData; expectArgumentCount = 1; uint16_t CommissioningTimeout; bool argExists[1]; @@ -122,12 +125,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfAdministratorCommissioningClusterOpenBasicCommissioningWindowCallback(aEndpointId, apCommandObj, - CommissioningTimeout); + wasHandled = emberAfAdministratorCommissioningClusterOpenBasicCommissioningWindowCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CommissioningTimeout, commandData); } break; } case Commands::OpenCommissioningWindow::Id: { + Commands::OpenCommissioningWindow::DecodableType commandData; expectArgumentCount = 6; uint16_t CommissioningTimeout; chip::ByteSpan PAKEVerifier; @@ -202,18 +206,21 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 6 == validArgumentCount) { wasHandled = emberAfAdministratorCommissioningClusterOpenCommissioningWindowCallback( - aEndpointId, apCommandObj, CommissioningTimeout, PAKEVerifier, Discriminator, Iterations, Salt, PasscodeID); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CommissioningTimeout, PAKEVerifier, Discriminator, + Iterations, Salt, PasscodeID, commandData); } break; } case Commands::RevokeCommissioning::Id: { + Commands::RevokeCommissioning::DecodableType commandData; - wasHandled = emberAfAdministratorCommissioningClusterRevokeCommissioningCallback(aEndpointId, apCommandObj); + wasHandled = emberAfAdministratorCommissioningClusterRevokeCommissioningCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, AdministratorCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -221,9 +228,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - AdministratorCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + AdministratorCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -241,7 +249,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace BarrierControl { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -254,9 +262,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::BarrierControlGoToPercent::Id: { + Commands::BarrierControlGoToPercent::DecodableType commandData; expectArgumentCount = 1; uint8_t percentOpen; bool argExists[1]; @@ -310,18 +319,21 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfBarrierControlClusterBarrierControlGoToPercentCallback(aEndpointId, apCommandObj, percentOpen); + wasHandled = emberAfBarrierControlClusterBarrierControlGoToPercentCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, percentOpen, commandData); } break; } case Commands::BarrierControlStop::Id: { + Commands::BarrierControlStop::DecodableType commandData; - wasHandled = emberAfBarrierControlClusterBarrierControlStopCallback(aEndpointId, apCommandObj); + wasHandled = emberAfBarrierControlClusterBarrierControlStopCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, BarrierControl::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -329,9 +341,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - BarrierControl::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + BarrierControl::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -349,16 +361,16 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace Basic { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { - ReportCommandUnsupported(apCommandObj, aEndpointId, Basic::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); } } // namespace Basic namespace Binding { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -371,9 +383,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::Bind::Id: { + Commands::Bind::DecodableType commandData; expectArgumentCount = 4; chip::NodeId nodeId; chip::GroupId groupId; @@ -439,11 +452,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfBindingClusterBindCallback(aEndpointId, apCommandObj, nodeId, groupId, endpointId, clusterId); + wasHandled = emberAfBindingClusterBindCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, nodeId, + groupId, endpointId, clusterId, commandData); } break; } case Commands::Unbind::Id: { + Commands::Unbind::DecodableType commandData; expectArgumentCount = 4; chip::NodeId nodeId; chip::GroupId groupId; @@ -509,13 +524,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfBindingClusterUnbindCallback(aEndpointId, apCommandObj, nodeId, groupId, endpointId, clusterId); + wasHandled = emberAfBindingClusterUnbindCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, nodeId, + groupId, endpointId, clusterId, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, Binding::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -523,9 +539,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - Binding::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + Binding::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -543,7 +559,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace ColorControl { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -556,9 +572,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::MoveColor::Id: { + Commands::MoveColor::DecodableType commandData; expectArgumentCount = 4; int16_t rateX; int16_t rateY; @@ -624,12 +641,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfColorControlClusterMoveColorCallback(aEndpointId, apCommandObj, rateX, rateY, optionsMask, - optionsOverride); + wasHandled = emberAfColorControlClusterMoveColorCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + rateX, rateY, optionsMask, optionsOverride, commandData); } break; } case Commands::MoveColorTemperature::Id: { + Commands::MoveColorTemperature::DecodableType commandData; expectArgumentCount = 6; uint8_t moveMode; uint16_t rate; @@ -704,12 +722,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 6 == validArgumentCount) { wasHandled = emberAfColorControlClusterMoveColorTemperatureCallback( - aEndpointId, apCommandObj, moveMode, rate, colorTemperatureMinimum, colorTemperatureMaximum, optionsMask, - optionsOverride); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, moveMode, rate, colorTemperatureMinimum, + colorTemperatureMaximum, optionsMask, optionsOverride, commandData); } break; } case Commands::MoveHue::Id: { + Commands::MoveHue::DecodableType commandData; expectArgumentCount = 4; uint8_t moveMode; uint8_t rate; @@ -775,12 +794,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfColorControlClusterMoveHueCallback(aEndpointId, apCommandObj, moveMode, rate, optionsMask, - optionsOverride); + wasHandled = emberAfColorControlClusterMoveHueCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + moveMode, rate, optionsMask, optionsOverride, commandData); } break; } case Commands::MoveSaturation::Id: { + Commands::MoveSaturation::DecodableType commandData; expectArgumentCount = 4; uint8_t moveMode; uint8_t rate; @@ -846,12 +866,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfColorControlClusterMoveSaturationCallback(aEndpointId, apCommandObj, moveMode, rate, - optionsMask, optionsOverride); + wasHandled = + emberAfColorControlClusterMoveSaturationCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, moveMode, + rate, optionsMask, optionsOverride, commandData); } break; } case Commands::MoveToColor::Id: { + Commands::MoveToColor::DecodableType commandData; expectArgumentCount = 5; uint16_t colorX; uint16_t colorY; @@ -921,12 +943,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfColorControlClusterMoveToColorCallback(aEndpointId, apCommandObj, colorX, colorY, - transitionTime, optionsMask, optionsOverride); + wasHandled = emberAfColorControlClusterMoveToColorCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + colorX, colorY, transitionTime, optionsMask, + optionsOverride, commandData); } break; } case Commands::MoveToColorTemperature::Id: { + Commands::MoveToColorTemperature::DecodableType commandData; expectArgumentCount = 4; uint16_t colorTemperature; uint16_t transitionTime; @@ -992,12 +1016,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfColorControlClusterMoveToColorTemperatureCallback(aEndpointId, apCommandObj, colorTemperature, - transitionTime, optionsMask, optionsOverride); + wasHandled = emberAfColorControlClusterMoveToColorTemperatureCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, colorTemperature, transitionTime, optionsMask, + optionsOverride, commandData); } break; } case Commands::MoveToHue::Id: { + Commands::MoveToHue::DecodableType commandData; expectArgumentCount = 5; uint8_t hue; uint8_t direction; @@ -1067,12 +1093,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfColorControlClusterMoveToHueCallback(aEndpointId, apCommandObj, hue, direction, transitionTime, - optionsMask, optionsOverride); + wasHandled = emberAfColorControlClusterMoveToHueCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, hue, + direction, transitionTime, optionsMask, optionsOverride, + commandData); } break; } case Commands::MoveToHueAndSaturation::Id: { + Commands::MoveToHueAndSaturation::DecodableType commandData; expectArgumentCount = 5; uint8_t hue; uint8_t saturation; @@ -1142,12 +1170,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfColorControlClusterMoveToHueAndSaturationCallback(aEndpointId, apCommandObj, hue, saturation, - transitionTime, optionsMask, optionsOverride); + wasHandled = emberAfColorControlClusterMoveToHueAndSaturationCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, hue, saturation, transitionTime, optionsMask, + optionsOverride, commandData); } break; } case Commands::MoveToSaturation::Id: { + Commands::MoveToSaturation::DecodableType commandData; expectArgumentCount = 4; uint8_t saturation; uint16_t transitionTime; @@ -1213,12 +1243,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfColorControlClusterMoveToSaturationCallback(aEndpointId, apCommandObj, saturation, - transitionTime, optionsMask, optionsOverride); + wasHandled = emberAfColorControlClusterMoveToSaturationCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, saturation, transitionTime, optionsMask, optionsOverride, + commandData); } break; } case Commands::StepColor::Id: { + Commands::StepColor::DecodableType commandData; expectArgumentCount = 5; int16_t stepX; int16_t stepY; @@ -1288,12 +1320,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfColorControlClusterStepColorCallback(aEndpointId, apCommandObj, stepX, stepY, transitionTime, - optionsMask, optionsOverride); + wasHandled = + emberAfColorControlClusterStepColorCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, stepX, stepY, + transitionTime, optionsMask, optionsOverride, commandData); } break; } case Commands::StepColorTemperature::Id: { + Commands::StepColorTemperature::DecodableType commandData; expectArgumentCount = 7; uint8_t stepMode; uint16_t stepSize; @@ -1372,12 +1406,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 7 == validArgumentCount) { wasHandled = emberAfColorControlClusterStepColorTemperatureCallback( - aEndpointId, apCommandObj, stepMode, stepSize, transitionTime, colorTemperatureMinimum, colorTemperatureMaximum, - optionsMask, optionsOverride); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, stepMode, stepSize, transitionTime, + colorTemperatureMinimum, colorTemperatureMaximum, optionsMask, optionsOverride, commandData); } break; } case Commands::StepHue::Id: { + Commands::StepHue::DecodableType commandData; expectArgumentCount = 5; uint8_t stepMode; uint8_t stepSize; @@ -1447,12 +1482,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfColorControlClusterStepHueCallback(aEndpointId, apCommandObj, stepMode, stepSize, - transitionTime, optionsMask, optionsOverride); + wasHandled = + emberAfColorControlClusterStepHueCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, stepMode, + stepSize, transitionTime, optionsMask, optionsOverride, commandData); } break; } case Commands::StepSaturation::Id: { + Commands::StepSaturation::DecodableType commandData; expectArgumentCount = 5; uint8_t stepMode; uint8_t stepSize; @@ -1522,12 +1559,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfColorControlClusterStepSaturationCallback(aEndpointId, apCommandObj, stepMode, stepSize, - transitionTime, optionsMask, optionsOverride); + wasHandled = emberAfColorControlClusterStepSaturationCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + stepMode, stepSize, transitionTime, optionsMask, + optionsOverride, commandData); } break; } case Commands::StopMoveStep::Id: { + Commands::StopMoveStep::DecodableType commandData; expectArgumentCount = 2; uint8_t optionsMask; uint8_t optionsOverride; @@ -1585,14 +1624,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = - emberAfColorControlClusterStopMoveStepCallback(aEndpointId, apCommandObj, optionsMask, optionsOverride); + wasHandled = emberAfColorControlClusterStopMoveStepCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + optionsMask, optionsOverride, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, ColorControl::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -1600,9 +1639,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - ColorControl::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + ColorControl::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -1620,7 +1659,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace DiagnosticLogs { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -1633,9 +1672,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::RetrieveLogsRequest::Id: { + Commands::RetrieveLogsRequest::DecodableType commandData; expectArgumentCount = 3; uint8_t intent; uint8_t requestedProtocol; @@ -1697,14 +1737,15 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfDiagnosticLogsClusterRetrieveLogsRequestCallback(aEndpointId, apCommandObj, intent, - requestedProtocol, transferFileDesignator); + wasHandled = emberAfDiagnosticLogsClusterRetrieveLogsRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, intent, requestedProtocol, transferFileDesignator, + commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, DiagnosticLogs::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -1712,9 +1753,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - DiagnosticLogs::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + DiagnosticLogs::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -1732,7 +1773,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace DoorLock { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -1745,19 +1786,24 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ClearAllPins::Id: { + Commands::ClearAllPins::DecodableType commandData; - wasHandled = emberAfDoorLockClusterClearAllPinsCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfDoorLockClusterClearAllPinsCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::ClearAllRfids::Id: { + Commands::ClearAllRfids::DecodableType commandData; - wasHandled = emberAfDoorLockClusterClearAllRfidsCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfDoorLockClusterClearAllRfidsCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::ClearHolidaySchedule::Id: { + Commands::ClearHolidaySchedule::DecodableType commandData; expectArgumentCount = 1; uint8_t scheduleId; bool argExists[1]; @@ -1811,11 +1857,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterClearHolidayScheduleCallback(aEndpointId, apCommandObj, scheduleId); + wasHandled = emberAfDoorLockClusterClearHolidayScheduleCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, scheduleId, commandData); } break; } case Commands::ClearPin::Id: { + Commands::ClearPin::DecodableType commandData; expectArgumentCount = 1; uint16_t userId; bool argExists[1]; @@ -1869,11 +1917,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterClearPinCallback(aEndpointId, apCommandObj, userId); + wasHandled = emberAfDoorLockClusterClearPinCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, userId, + commandData); } break; } case Commands::ClearRfid::Id: { + Commands::ClearRfid::DecodableType commandData; expectArgumentCount = 1; uint16_t userId; bool argExists[1]; @@ -1927,11 +1977,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterClearRfidCallback(aEndpointId, apCommandObj, userId); + wasHandled = emberAfDoorLockClusterClearRfidCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, userId, + commandData); } break; } case Commands::ClearWeekdaySchedule::Id: { + Commands::ClearWeekdaySchedule::DecodableType commandData; expectArgumentCount = 2; uint8_t scheduleId; uint16_t userId; @@ -1989,11 +2041,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterClearWeekdayScheduleCallback(aEndpointId, apCommandObj, scheduleId, userId); + wasHandled = emberAfDoorLockClusterClearWeekdayScheduleCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, scheduleId, userId, commandData); } break; } case Commands::ClearYeardaySchedule::Id: { + Commands::ClearYeardaySchedule::DecodableType commandData; expectArgumentCount = 2; uint8_t scheduleId; uint16_t userId; @@ -2051,11 +2105,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterClearYeardayScheduleCallback(aEndpointId, apCommandObj, scheduleId, userId); + wasHandled = emberAfDoorLockClusterClearYeardayScheduleCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, scheduleId, userId, commandData); } break; } case Commands::GetHolidaySchedule::Id: { + Commands::GetHolidaySchedule::DecodableType commandData; expectArgumentCount = 1; uint8_t scheduleId; bool argExists[1]; @@ -2109,11 +2165,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterGetHolidayScheduleCallback(aEndpointId, apCommandObj, scheduleId); + wasHandled = emberAfDoorLockClusterGetHolidayScheduleCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + scheduleId, commandData); } break; } case Commands::GetLogRecord::Id: { + Commands::GetLogRecord::DecodableType commandData; expectArgumentCount = 1; uint16_t logIndex; bool argExists[1]; @@ -2167,11 +2225,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterGetLogRecordCallback(aEndpointId, apCommandObj, logIndex); + wasHandled = emberAfDoorLockClusterGetLogRecordCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + logIndex, commandData); } break; } case Commands::GetPin::Id: { + Commands::GetPin::DecodableType commandData; expectArgumentCount = 1; uint16_t userId; bool argExists[1]; @@ -2225,11 +2285,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterGetPinCallback(aEndpointId, apCommandObj, userId); + wasHandled = + emberAfDoorLockClusterGetPinCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, userId, commandData); } break; } case Commands::GetRfid::Id: { + Commands::GetRfid::DecodableType commandData; expectArgumentCount = 1; uint16_t userId; bool argExists[1]; @@ -2283,11 +2345,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterGetRfidCallback(aEndpointId, apCommandObj, userId); + wasHandled = emberAfDoorLockClusterGetRfidCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, userId, + commandData); } break; } case Commands::GetUserType::Id: { + Commands::GetUserType::DecodableType commandData; expectArgumentCount = 1; uint16_t userId; bool argExists[1]; @@ -2341,11 +2405,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterGetUserTypeCallback(aEndpointId, apCommandObj, userId); + wasHandled = emberAfDoorLockClusterGetUserTypeCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, userId, + commandData); } break; } case Commands::GetWeekdaySchedule::Id: { + Commands::GetWeekdaySchedule::DecodableType commandData; expectArgumentCount = 2; uint8_t scheduleId; uint16_t userId; @@ -2403,11 +2469,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterGetWeekdayScheduleCallback(aEndpointId, apCommandObj, scheduleId, userId); + wasHandled = emberAfDoorLockClusterGetWeekdayScheduleCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + scheduleId, userId, commandData); } break; } case Commands::GetYeardaySchedule::Id: { + Commands::GetYeardaySchedule::DecodableType commandData; expectArgumentCount = 2; uint8_t scheduleId; uint16_t userId; @@ -2465,11 +2533,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterGetYeardayScheduleCallback(aEndpointId, apCommandObj, scheduleId, userId); + wasHandled = emberAfDoorLockClusterGetYeardayScheduleCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + scheduleId, userId, commandData); } break; } case Commands::LockDoor::Id: { + Commands::LockDoor::DecodableType commandData; expectArgumentCount = 1; const uint8_t * PIN; bool argExists[1]; @@ -2524,11 +2594,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterLockDoorCallback(aEndpointId, apCommandObj, const_cast(PIN)); + wasHandled = emberAfDoorLockClusterLockDoorCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + const_cast(PIN), commandData); } break; } case Commands::SetHolidaySchedule::Id: { + Commands::SetHolidaySchedule::DecodableType commandData; expectArgumentCount = 4; uint8_t scheduleId; uint32_t localStartTime; @@ -2594,12 +2666,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterSetHolidayScheduleCallback(aEndpointId, apCommandObj, scheduleId, localStartTime, - localEndTime, operatingModeDuringHoliday); + wasHandled = emberAfDoorLockClusterSetHolidayScheduleCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + scheduleId, localStartTime, localEndTime, + operatingModeDuringHoliday, commandData); } break; } case Commands::SetPin::Id: { + Commands::SetPin::DecodableType commandData; expectArgumentCount = 4; uint16_t userId; uint8_t userStatus; @@ -2666,12 +2740,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterSetPinCallback(aEndpointId, apCommandObj, userId, userStatus, userType, - const_cast(pin)); + wasHandled = emberAfDoorLockClusterSetPinCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, userId, + userStatus, userType, const_cast(pin), commandData); } break; } case Commands::SetRfid::Id: { + Commands::SetRfid::DecodableType commandData; expectArgumentCount = 4; uint16_t userId; uint8_t userStatus; @@ -2738,12 +2813,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterSetRfidCallback(aEndpointId, apCommandObj, userId, userStatus, userType, - const_cast(id)); + wasHandled = emberAfDoorLockClusterSetRfidCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, userId, + userStatus, userType, const_cast(id), commandData); } break; } case Commands::SetUserType::Id: { + Commands::SetUserType::DecodableType commandData; expectArgumentCount = 2; uint16_t userId; uint8_t userType; @@ -2801,11 +2877,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterSetUserTypeCallback(aEndpointId, apCommandObj, userId, userType); + wasHandled = emberAfDoorLockClusterSetUserTypeCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, userId, + userType, commandData); } break; } case Commands::SetWeekdaySchedule::Id: { + Commands::SetWeekdaySchedule::DecodableType commandData; expectArgumentCount = 7; uint8_t scheduleId; uint16_t userId; @@ -2883,12 +2961,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 7 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterSetWeekdayScheduleCallback(aEndpointId, apCommandObj, scheduleId, userId, - daysMask, startHour, startMinute, endHour, endMinute); + wasHandled = emberAfDoorLockClusterSetWeekdayScheduleCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + scheduleId, userId, daysMask, startHour, startMinute, + endHour, endMinute, commandData); } break; } case Commands::SetYeardaySchedule::Id: { + Commands::SetYeardaySchedule::DecodableType commandData; expectArgumentCount = 4; uint8_t scheduleId; uint16_t userId; @@ -2954,12 +3034,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterSetYeardayScheduleCallback(aEndpointId, apCommandObj, scheduleId, userId, - localStartTime, localEndTime); + wasHandled = + emberAfDoorLockClusterSetYeardayScheduleCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + scheduleId, userId, localStartTime, localEndTime, commandData); } break; } case Commands::UnlockDoor::Id: { + Commands::UnlockDoor::DecodableType commandData; expectArgumentCount = 1; const uint8_t * PIN; bool argExists[1]; @@ -3014,11 +3096,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterUnlockDoorCallback(aEndpointId, apCommandObj, const_cast(PIN)); + wasHandled = emberAfDoorLockClusterUnlockDoorCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + const_cast(PIN), commandData); } break; } case Commands::UnlockWithTimeout::Id: { + Commands::UnlockWithTimeout::DecodableType commandData; expectArgumentCount = 2; uint16_t timeoutInSeconds; const uint8_t * pin; @@ -3077,14 +3161,15 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfDoorLockClusterUnlockWithTimeoutCallback(aEndpointId, apCommandObj, timeoutInSeconds, - const_cast(pin)); + wasHandled = + emberAfDoorLockClusterUnlockWithTimeoutCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + timeoutInSeconds, const_cast(pin), commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, DoorLock::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -3092,9 +3177,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - DoorLock::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + DoorLock::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -3112,7 +3197,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace GeneralCommissioning { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -3125,9 +3210,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ArmFailSafe::Id: { + Commands::ArmFailSafe::DecodableType commandData; expectArgumentCount = 3; uint16_t expiryLengthSeconds; uint64_t breadcrumb; @@ -3189,17 +3275,20 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfGeneralCommissioningClusterArmFailSafeCallback(aEndpointId, apCommandObj, expiryLengthSeconds, - breadcrumb, timeoutMs); + wasHandled = emberAfGeneralCommissioningClusterArmFailSafeCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, expiryLengthSeconds, breadcrumb, timeoutMs, commandData); } break; } case Commands::CommissioningComplete::Id: { + Commands::CommissioningComplete::DecodableType commandData; - wasHandled = emberAfGeneralCommissioningClusterCommissioningCompleteCallback(aEndpointId, apCommandObj); + wasHandled = emberAfGeneralCommissioningClusterCommissioningCompleteCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, commandData); break; } case Commands::SetRegulatoryConfig::Id: { + Commands::SetRegulatoryConfig::DecodableType commandData; expectArgumentCount = 4; uint8_t location; const uint8_t * countryCode; @@ -3267,13 +3356,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { wasHandled = emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback( - aEndpointId, apCommandObj, location, const_cast(countryCode), breadcrumb, timeoutMs); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, location, const_cast(countryCode), breadcrumb, + timeoutMs, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, GeneralCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -3281,9 +3371,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - GeneralCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + GeneralCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -3301,7 +3392,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace Groups { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -3314,9 +3405,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::AddGroup::Id: { + Commands::AddGroup::DecodableType commandData; expectArgumentCount = 2; uint16_t groupId; const uint8_t * groupName; @@ -3375,12 +3467,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = - emberAfGroupsClusterAddGroupCallback(aEndpointId, apCommandObj, groupId, const_cast(groupName)); + wasHandled = emberAfGroupsClusterAddGroupCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, groupId, + const_cast(groupName), commandData); } break; } case Commands::AddGroupIfIdentifying::Id: { + Commands::AddGroupIfIdentifying::DecodableType commandData; expectArgumentCount = 2; uint16_t groupId; const uint8_t * groupName; @@ -3439,12 +3532,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfGroupsClusterAddGroupIfIdentifyingCallback(aEndpointId, apCommandObj, groupId, - const_cast(groupName)); + wasHandled = emberAfGroupsClusterAddGroupIfIdentifyingCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, groupId, const_cast(groupName), commandData); } break; } case Commands::GetGroupMembership::Id: { + Commands::GetGroupMembership::DecodableType commandData; expectArgumentCount = 2; uint8_t groupCount; /* TYPE WARNING: array array defaults to */ uint8_t * groupList; @@ -3503,16 +3597,20 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfGroupsClusterGetGroupMembershipCallback(aEndpointId, apCommandObj, groupCount, groupList); + wasHandled = emberAfGroupsClusterGetGroupMembershipCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + groupCount, groupList, commandData); } break; } case Commands::RemoveAllGroups::Id: { + Commands::RemoveAllGroups::DecodableType commandData; - wasHandled = emberAfGroupsClusterRemoveAllGroupsCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfGroupsClusterRemoveAllGroupsCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::RemoveGroup::Id: { + Commands::RemoveGroup::DecodableType commandData; expectArgumentCount = 1; uint16_t groupId; bool argExists[1]; @@ -3566,11 +3664,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfGroupsClusterRemoveGroupCallback(aEndpointId, apCommandObj, groupId); + wasHandled = emberAfGroupsClusterRemoveGroupCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, groupId, + commandData); } break; } case Commands::ViewGroup::Id: { + Commands::ViewGroup::DecodableType commandData; expectArgumentCount = 1; uint16_t groupId; bool argExists[1]; @@ -3624,13 +3724,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfGroupsClusterViewGroupCallback(aEndpointId, apCommandObj, groupId); + wasHandled = emberAfGroupsClusterViewGroupCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, groupId, + commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, Groups::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -3638,9 +3739,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - Groups::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + Groups::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -3658,7 +3759,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace IasZone { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -3671,9 +3772,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ZoneEnrollResponse::Id: { + Commands::ZoneEnrollResponse::DecodableType commandData; expectArgumentCount = 2; uint8_t enrollResponseCode; uint8_t zoneId; @@ -3731,13 +3833,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfIasZoneClusterZoneEnrollResponseCallback(aEndpointId, apCommandObj, enrollResponseCode, zoneId); + wasHandled = emberAfIasZoneClusterZoneEnrollResponseCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + enrollResponseCode, zoneId, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, IasZone::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -3745,9 +3848,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - IasZone::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + IasZone::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -3765,7 +3868,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace Identify { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -3778,9 +3881,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::Identify::Id: { + Commands::Identify::DecodableType commandData; expectArgumentCount = 1; uint16_t identifyTime; bool argExists[1]; @@ -3834,18 +3938,21 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfIdentifyClusterIdentifyCallback(aEndpointId, apCommandObj, identifyTime); + wasHandled = emberAfIdentifyClusterIdentifyCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + identifyTime, commandData); } break; } case Commands::IdentifyQuery::Id: { + Commands::IdentifyQuery::DecodableType commandData; - wasHandled = emberAfIdentifyClusterIdentifyQueryCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfIdentifyClusterIdentifyQueryCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, Identify::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -3853,9 +3960,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - Identify::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + Identify::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -3873,7 +3980,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace LevelControl { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -3886,9 +3993,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::Move::Id: { + Commands::Move::DecodableType commandData; expectArgumentCount = 4; uint8_t moveMode; uint8_t rate; @@ -3954,12 +4062,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = - emberAfLevelControlClusterMoveCallback(aEndpointId, apCommandObj, moveMode, rate, optionMask, optionOverride); + wasHandled = emberAfLevelControlClusterMoveCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, moveMode, + rate, optionMask, optionOverride, commandData); } break; } case Commands::MoveToLevel::Id: { + Commands::MoveToLevel::DecodableType commandData; expectArgumentCount = 4; uint8_t level; uint16_t transitionTime; @@ -4025,12 +4134,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfLevelControlClusterMoveToLevelCallback(aEndpointId, apCommandObj, level, transitionTime, - optionMask, optionOverride); + wasHandled = + emberAfLevelControlClusterMoveToLevelCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, level, + transitionTime, optionMask, optionOverride, commandData); } break; } case Commands::MoveToLevelWithOnOff::Id: { + Commands::MoveToLevelWithOnOff::DecodableType commandData; expectArgumentCount = 2; uint8_t level; uint16_t transitionTime; @@ -4088,12 +4199,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = - emberAfLevelControlClusterMoveToLevelWithOnOffCallback(aEndpointId, apCommandObj, level, transitionTime); + wasHandled = emberAfLevelControlClusterMoveToLevelWithOnOffCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, level, transitionTime, commandData); } break; } case Commands::MoveWithOnOff::Id: { + Commands::MoveWithOnOff::DecodableType commandData; expectArgumentCount = 2; uint8_t moveMode; uint8_t rate; @@ -4151,11 +4263,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfLevelControlClusterMoveWithOnOffCallback(aEndpointId, apCommandObj, moveMode, rate); + wasHandled = emberAfLevelControlClusterMoveWithOnOffCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + moveMode, rate, commandData); } break; } case Commands::Step::Id: { + Commands::Step::DecodableType commandData; expectArgumentCount = 5; uint8_t stepMode; uint8_t stepSize; @@ -4225,12 +4339,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfLevelControlClusterStepCallback(aEndpointId, apCommandObj, stepMode, stepSize, transitionTime, - optionMask, optionOverride); + wasHandled = + emberAfLevelControlClusterStepCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, stepMode, stepSize, + transitionTime, optionMask, optionOverride, commandData); } break; } case Commands::StepWithOnOff::Id: { + Commands::StepWithOnOff::DecodableType commandData; expectArgumentCount = 3; uint8_t stepMode; uint8_t stepSize; @@ -4292,12 +4408,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = - emberAfLevelControlClusterStepWithOnOffCallback(aEndpointId, apCommandObj, stepMode, stepSize, transitionTime); + wasHandled = emberAfLevelControlClusterStepWithOnOffCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + stepMode, stepSize, transitionTime, commandData); } break; } case Commands::Stop::Id: { + Commands::Stop::DecodableType commandData; expectArgumentCount = 2; uint8_t optionMask; uint8_t optionOverride; @@ -4355,18 +4472,21 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfLevelControlClusterStopCallback(aEndpointId, apCommandObj, optionMask, optionOverride); + wasHandled = emberAfLevelControlClusterStopCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + optionMask, optionOverride, commandData); } break; } case Commands::StopWithOnOff::Id: { + Commands::StopWithOnOff::DecodableType commandData; - wasHandled = emberAfLevelControlClusterStopWithOnOffCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfLevelControlClusterStopWithOnOffCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, LevelControl::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -4374,9 +4494,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - LevelControl::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + LevelControl::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -4394,7 +4514,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace NetworkCommissioning { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -4407,9 +4527,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::AddThreadNetwork::Id: { + Commands::AddThreadNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan operationalDataset; uint64_t breadcrumb; @@ -4471,12 +4592,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterAddThreadNetworkCallback(aEndpointId, apCommandObj, - operationalDataset, breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterAddThreadNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, operationalDataset, breadcrumb, timeoutMs, commandData); } break; } case Commands::AddWiFiNetwork::Id: { + Commands::AddWiFiNetwork::DecodableType commandData; expectArgumentCount = 4; chip::ByteSpan ssid; chip::ByteSpan credentials; @@ -4542,12 +4664,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterAddWiFiNetworkCallback(aEndpointId, apCommandObj, ssid, credentials, - breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterAddWiFiNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, ssid, credentials, breadcrumb, timeoutMs, commandData); } break; } case Commands::DisableNetwork::Id: { + Commands::DisableNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan networkID; uint64_t breadcrumb; @@ -4609,12 +4732,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterDisableNetworkCallback(aEndpointId, apCommandObj, networkID, - breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterDisableNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, networkID, breadcrumb, timeoutMs, commandData); } break; } case Commands::EnableNetwork::Id: { + Commands::EnableNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan networkID; uint64_t breadcrumb; @@ -4676,12 +4800,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterEnableNetworkCallback(aEndpointId, apCommandObj, networkID, - breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterEnableNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, networkID, breadcrumb, timeoutMs, commandData); } break; } case Commands::GetLastNetworkCommissioningResult::Id: { + Commands::GetLastNetworkCommissioningResult::DecodableType commandData; expectArgumentCount = 1; uint32_t timeoutMs; bool argExists[1]; @@ -4735,12 +4860,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback(aEndpointId, apCommandObj, - timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, timeoutMs, commandData); } break; } case Commands::RemoveNetwork::Id: { + Commands::RemoveNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan NetworkID; uint64_t Breadcrumb; @@ -4802,12 +4928,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterRemoveNetworkCallback(aEndpointId, apCommandObj, NetworkID, - Breadcrumb, TimeoutMs); + wasHandled = emberAfNetworkCommissioningClusterRemoveNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, NetworkID, Breadcrumb, TimeoutMs, commandData); } break; } case Commands::ScanNetworks::Id: { + Commands::ScanNetworks::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan ssid; uint64_t breadcrumb; @@ -4869,12 +4996,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = - emberAfNetworkCommissioningClusterScanNetworksCallback(aEndpointId, apCommandObj, ssid, breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterScanNetworksCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, ssid, breadcrumb, timeoutMs, commandData); } break; } case Commands::UpdateThreadNetwork::Id: { + Commands::UpdateThreadNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan operationalDataset; uint64_t breadcrumb; @@ -4937,11 +5065,12 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { wasHandled = emberAfNetworkCommissioningClusterUpdateThreadNetworkCallback( - aEndpointId, apCommandObj, operationalDataset, breadcrumb, timeoutMs); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, operationalDataset, breadcrumb, timeoutMs, commandData); } break; } case Commands::UpdateWiFiNetwork::Id: { + Commands::UpdateWiFiNetwork::DecodableType commandData; expectArgumentCount = 4; chip::ByteSpan ssid; chip::ByteSpan credentials; @@ -5007,14 +5136,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback(aEndpointId, apCommandObj, ssid, - credentials, breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, ssid, credentials, breadcrumb, timeoutMs, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, NetworkCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -5022,9 +5151,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - NetworkCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + NetworkCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -5042,7 +5172,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace OtaSoftwareUpdateProvider { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -5055,9 +5185,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ApplyUpdateRequest::Id: { + Commands::ApplyUpdateRequest::DecodableType commandData; expectArgumentCount = 2; chip::ByteSpan updateToken; uint32_t newVersion; @@ -5115,12 +5246,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestCallback(aEndpointId, apCommandObj, - updateToken, newVersion); + wasHandled = emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, updateToken, newVersion, commandData); } break; } case Commands::NotifyUpdateApplied::Id: { + Commands::NotifyUpdateApplied::DecodableType commandData; expectArgumentCount = 2; chip::ByteSpan updateToken; uint32_t softwareVersion; @@ -5178,12 +5310,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedCallback(aEndpointId, apCommandObj, - updateToken, softwareVersion); + wasHandled = emberAfOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, updateToken, softwareVersion, commandData); } break; } case Commands::QueryImage::Id: { + Commands::QueryImage::DecodableType commandData; expectArgumentCount = 8; uint16_t vendorId; uint16_t productId; @@ -5267,14 +5400,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 8 == validArgumentCount) { wasHandled = emberAfOtaSoftwareUpdateProviderClusterQueryImageCallback( - aEndpointId, apCommandObj, vendorId, productId, hardwareVersion, softwareVersion, protocolsSupported, - const_cast(location), requestorCanConsent, metadataForProvider); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, vendorId, productId, hardwareVersion, softwareVersion, + protocolsSupported, const_cast(location), requestorCanConsent, metadataForProvider, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, OtaSoftwareUpdateProvider::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -5282,9 +5415,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - OtaSoftwareUpdateProvider::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + OtaSoftwareUpdateProvider::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -5302,7 +5436,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace OnOff { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -5315,26 +5449,29 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::Off::Id: { + Commands::Off::DecodableType commandData; - wasHandled = emberAfOnOffClusterOffCallback(aEndpointId, apCommandObj); + wasHandled = emberAfOnOffClusterOffCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::On::Id: { + Commands::On::DecodableType commandData; - wasHandled = emberAfOnOffClusterOnCallback(aEndpointId, apCommandObj); + wasHandled = emberAfOnOffClusterOnCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::Toggle::Id: { + Commands::Toggle::DecodableType commandData; - wasHandled = emberAfOnOffClusterToggleCallback(aEndpointId, apCommandObj); + wasHandled = emberAfOnOffClusterToggleCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, OnOff::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -5342,9 +5479,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - OnOff::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + OnOff::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -5362,7 +5499,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace OperationalCredentials { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -5375,9 +5512,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::AddNOC::Id: { + Commands::AddNOC::DecodableType commandData; expectArgumentCount = 5; chip::ByteSpan NOCValue; chip::ByteSpan ICACValue; @@ -5447,12 +5585,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterAddNOCCallback(aEndpointId, apCommandObj, NOCValue, ICACValue, - IPKValue, CaseAdminNode, AdminVendorId); + wasHandled = emberAfOperationalCredentialsClusterAddNOCCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, NOCValue, ICACValue, IPKValue, CaseAdminNode, + AdminVendorId, commandData); } break; } case Commands::AddTrustedRootCertificate::Id: { + Commands::AddTrustedRootCertificate::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan RootCertificate; bool argExists[1]; @@ -5506,12 +5646,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback(aEndpointId, apCommandObj, - RootCertificate); + wasHandled = emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, RootCertificate, commandData); } break; } case Commands::AttestationRequest::Id: { + Commands::AttestationRequest::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan AttestationNonce; bool argExists[1]; @@ -5565,12 +5706,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = - emberAfOperationalCredentialsClusterAttestationRequestCallback(aEndpointId, apCommandObj, AttestationNonce); + wasHandled = emberAfOperationalCredentialsClusterAttestationRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, AttestationNonce, commandData); } break; } case Commands::CertificateChainRequest::Id: { + Commands::CertificateChainRequest::DecodableType commandData; expectArgumentCount = 1; uint8_t CertificateType; bool argExists[1]; @@ -5624,12 +5766,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = - emberAfOperationalCredentialsClusterCertificateChainRequestCallback(aEndpointId, apCommandObj, CertificateType); + wasHandled = emberAfOperationalCredentialsClusterCertificateChainRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CertificateType, commandData); } break; } case Commands::OpCSRRequest::Id: { + Commands::OpCSRRequest::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan CSRNonce; bool argExists[1]; @@ -5683,11 +5826,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterOpCSRRequestCallback(aEndpointId, apCommandObj, CSRNonce); + wasHandled = emberAfOperationalCredentialsClusterOpCSRRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CSRNonce, commandData); } break; } case Commands::RemoveFabric::Id: { + Commands::RemoveFabric::DecodableType commandData; expectArgumentCount = 1; uint8_t FabricIndex; bool argExists[1]; @@ -5741,11 +5886,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterRemoveFabricCallback(aEndpointId, apCommandObj, FabricIndex); + wasHandled = emberAfOperationalCredentialsClusterRemoveFabricCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, FabricIndex, commandData); } break; } case Commands::RemoveTrustedRootCertificate::Id: { + Commands::RemoveTrustedRootCertificate::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan TrustedRootIdentifier; bool argExists[1]; @@ -5799,12 +5946,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterRemoveTrustedRootCertificateCallback(aEndpointId, apCommandObj, - TrustedRootIdentifier); + wasHandled = emberAfOperationalCredentialsClusterRemoveTrustedRootCertificateCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, TrustedRootIdentifier, commandData); } break; } case Commands::UpdateFabricLabel::Id: { + Commands::UpdateFabricLabel::DecodableType commandData; expectArgumentCount = 1; const uint8_t * Label; bool argExists[1]; @@ -5859,12 +6007,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterUpdateFabricLabelCallback(aEndpointId, apCommandObj, - const_cast(Label)); + wasHandled = emberAfOperationalCredentialsClusterUpdateFabricLabelCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, const_cast(Label), commandData); } break; } case Commands::UpdateNOC::Id: { + Commands::UpdateNOC::DecodableType commandData; expectArgumentCount = 2; chip::ByteSpan NOCValue; chip::ByteSpan ICACValue; @@ -5922,13 +6071,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterUpdateNOCCallback(aEndpointId, apCommandObj, NOCValue, ICACValue); + wasHandled = emberAfOperationalCredentialsClusterUpdateNOCCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, NOCValue, ICACValue, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, OperationalCredentials::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -5936,9 +6086,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - OperationalCredentials::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + OperationalCredentials::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -5956,7 +6107,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace Scenes { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -5969,9 +6120,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::AddScene::Id: { + Commands::AddScene::DecodableType commandData; expectArgumentCount = 5; uint16_t groupId; uint8_t sceneId; @@ -6043,12 +6195,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfScenesClusterAddSceneCallback(aEndpointId, apCommandObj, groupId, sceneId, transitionTime, - const_cast(sceneName), extensionFieldSets); + wasHandled = emberAfScenesClusterAddSceneCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, groupId, + sceneId, transitionTime, const_cast(sceneName), + extensionFieldSets, commandData); } break; } case Commands::GetSceneMembership::Id: { + Commands::GetSceneMembership::DecodableType commandData; expectArgumentCount = 1; uint16_t groupId; bool argExists[1]; @@ -6102,11 +6256,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfScenesClusterGetSceneMembershipCallback(aEndpointId, apCommandObj, groupId); + wasHandled = emberAfScenesClusterGetSceneMembershipCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + groupId, commandData); } break; } case Commands::RecallScene::Id: { + Commands::RecallScene::DecodableType commandData; expectArgumentCount = 3; uint16_t groupId; uint8_t sceneId; @@ -6168,11 +6324,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfScenesClusterRecallSceneCallback(aEndpointId, apCommandObj, groupId, sceneId, transitionTime); + wasHandled = emberAfScenesClusterRecallSceneCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, groupId, + sceneId, transitionTime, commandData); } break; } case Commands::RemoveAllScenes::Id: { + Commands::RemoveAllScenes::DecodableType commandData; expectArgumentCount = 1; uint16_t groupId; bool argExists[1]; @@ -6226,11 +6384,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfScenesClusterRemoveAllScenesCallback(aEndpointId, apCommandObj, groupId); + wasHandled = emberAfScenesClusterRemoveAllScenesCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + groupId, commandData); } break; } case Commands::RemoveScene::Id: { + Commands::RemoveScene::DecodableType commandData; expectArgumentCount = 2; uint16_t groupId; uint8_t sceneId; @@ -6288,11 +6448,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfScenesClusterRemoveSceneCallback(aEndpointId, apCommandObj, groupId, sceneId); + wasHandled = emberAfScenesClusterRemoveSceneCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, groupId, + sceneId, commandData); } break; } case Commands::StoreScene::Id: { + Commands::StoreScene::DecodableType commandData; expectArgumentCount = 2; uint16_t groupId; uint8_t sceneId; @@ -6350,11 +6512,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfScenesClusterStoreSceneCallback(aEndpointId, apCommandObj, groupId, sceneId); + wasHandled = emberAfScenesClusterStoreSceneCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, groupId, + sceneId, commandData); } break; } case Commands::ViewScene::Id: { + Commands::ViewScene::DecodableType commandData; expectArgumentCount = 2; uint16_t groupId; uint8_t sceneId; @@ -6412,13 +6576,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfScenesClusterViewSceneCallback(aEndpointId, apCommandObj, groupId, sceneId); + wasHandled = emberAfScenesClusterViewSceneCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, groupId, + sceneId, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, Scenes::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -6426,9 +6591,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - Scenes::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + Scenes::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -6446,7 +6611,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace TestCluster { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -6459,26 +6624,31 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::Test::Id: { + Commands::Test::DecodableType commandData; - wasHandled = emberAfTestClusterClusterTestCallback(aEndpointId, apCommandObj); + wasHandled = emberAfTestClusterClusterTestCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::TestNotHandled::Id: { + Commands::TestNotHandled::DecodableType commandData; - wasHandled = emberAfTestClusterClusterTestNotHandledCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfTestClusterClusterTestNotHandledCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::TestSpecific::Id: { + Commands::TestSpecific::DecodableType commandData; - wasHandled = emberAfTestClusterClusterTestSpecificCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfTestClusterClusterTestSpecificCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, TestCluster::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -6486,9 +6656,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - TestCluster::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + TestCluster::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -6512,63 +6682,64 @@ void DispatchSingleClusterCommand(ClusterId aClusterId, CommandId aCommandId, En 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); TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); switch (aClusterId) { case Clusters::AdministratorCommissioning::Id: - Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::BarrierControl::Id: - Clusters::BarrierControl::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::BarrierControl::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::Basic::Id: - Clusters::Basic::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::Basic::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::Binding::Id: - Clusters::Binding::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::Binding::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::ColorControl::Id: - Clusters::ColorControl::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::ColorControl::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::DiagnosticLogs::Id: - Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::DoorLock::Id: - Clusters::DoorLock::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::DoorLock::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::GeneralCommissioning::Id: - Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::Groups::Id: - Clusters::Groups::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::Groups::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::IasZone::Id: - Clusters::IasZone::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::IasZone::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::Identify::Id: - Clusters::Identify::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::Identify::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::LevelControl::Id: - Clusters::LevelControl::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::LevelControl::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::NetworkCommissioning::Id: - Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::OtaSoftwareUpdateProvider::Id: - Clusters::OtaSoftwareUpdateProvider::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::OtaSoftwareUpdateProvider::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::OnOff::Id: - Clusters::OnOff::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::OnOff::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::OperationalCredentials::Id: - Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::Scenes::Id: - Clusters::Scenes::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::Scenes::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::TestCluster::Id: - Clusters::TestCluster::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::TestCluster::DispatchServerCommand(apCommandObj, commandPath, aReader); break; default: // Unrecognized cluster ID, error status will apply. @@ -6591,6 +6762,7 @@ void DispatchSingleClusterResponseCommand(ClusterId aClusterId, CommandId aComma 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); TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); switch (aClusterId) diff --git a/zzz_generated/window-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/window-app/zap-generated/IMClusterCommandHandler.cpp index 8b8382de3ba78e..5901ab9567d2fc 100644 --- a/zzz_generated/window-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/window-app/zap-generated/IMClusterCommandHandler.cpp @@ -23,6 +23,7 @@ #include "app/util/util.h" #include #include +#include #include #include @@ -35,15 +36,16 @@ namespace chip { namespace app { namespace { -void ReportCommandUnsupported(Command * aCommandObj, EndpointId aEndpointId, ClusterId aClusterId, CommandId aCommandId) +void ReportCommandUnsupported(Command * aCommandObj, const ConcreteCommandPath & aCommandPath) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - aClusterId, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + aCommandPath.mClusterId, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; aCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kNotFound, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, ChipLogValueMEI(aCommandId), - ChipLogValueMEI(aClusterId)); + ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, + ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); } } // anonymous namespace @@ -53,7 +55,7 @@ namespace Clusters { namespace AdministratorCommissioning { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -66,9 +68,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::OpenBasicCommissioningWindow::Id: { + Commands::OpenBasicCommissioningWindow::DecodableType commandData; expectArgumentCount = 1; uint16_t CommissioningTimeout; bool argExists[1]; @@ -122,12 +125,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfAdministratorCommissioningClusterOpenBasicCommissioningWindowCallback(aEndpointId, apCommandObj, - CommissioningTimeout); + wasHandled = emberAfAdministratorCommissioningClusterOpenBasicCommissioningWindowCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CommissioningTimeout, commandData); } break; } case Commands::OpenCommissioningWindow::Id: { + Commands::OpenCommissioningWindow::DecodableType commandData; expectArgumentCount = 6; uint16_t CommissioningTimeout; chip::ByteSpan PAKEVerifier; @@ -202,18 +206,21 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 6 == validArgumentCount) { wasHandled = emberAfAdministratorCommissioningClusterOpenCommissioningWindowCallback( - aEndpointId, apCommandObj, CommissioningTimeout, PAKEVerifier, Discriminator, Iterations, Salt, PasscodeID); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CommissioningTimeout, PAKEVerifier, Discriminator, + Iterations, Salt, PasscodeID, commandData); } break; } case Commands::RevokeCommissioning::Id: { + Commands::RevokeCommissioning::DecodableType commandData; - wasHandled = emberAfAdministratorCommissioningClusterRevokeCommissioningCallback(aEndpointId, apCommandObj); + wasHandled = emberAfAdministratorCommissioningClusterRevokeCommissioningCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, AdministratorCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -221,9 +228,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - AdministratorCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + AdministratorCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -241,7 +249,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace GeneralCommissioning { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -254,9 +262,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::ArmFailSafe::Id: { + Commands::ArmFailSafe::DecodableType commandData; expectArgumentCount = 3; uint16_t expiryLengthSeconds; uint64_t breadcrumb; @@ -318,17 +327,20 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfGeneralCommissioningClusterArmFailSafeCallback(aEndpointId, apCommandObj, expiryLengthSeconds, - breadcrumb, timeoutMs); + wasHandled = emberAfGeneralCommissioningClusterArmFailSafeCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, expiryLengthSeconds, breadcrumb, timeoutMs, commandData); } break; } case Commands::CommissioningComplete::Id: { + Commands::CommissioningComplete::DecodableType commandData; - wasHandled = emberAfGeneralCommissioningClusterCommissioningCompleteCallback(aEndpointId, apCommandObj); + wasHandled = emberAfGeneralCommissioningClusterCommissioningCompleteCallback(apCommandObj, aCommandPath, + aCommandPath.mEndpointId, commandData); break; } case Commands::SetRegulatoryConfig::Id: { + Commands::SetRegulatoryConfig::DecodableType commandData; expectArgumentCount = 4; uint8_t location; const uint8_t * countryCode; @@ -396,13 +408,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { wasHandled = emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback( - aEndpointId, apCommandObj, location, const_cast(countryCode), breadcrumb, timeoutMs); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, location, const_cast(countryCode), breadcrumb, + timeoutMs, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, GeneralCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -410,9 +423,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - GeneralCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + GeneralCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -430,7 +444,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace NetworkCommissioning { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -443,9 +457,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::AddThreadNetwork::Id: { + Commands::AddThreadNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan operationalDataset; uint64_t breadcrumb; @@ -507,12 +522,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterAddThreadNetworkCallback(aEndpointId, apCommandObj, - operationalDataset, breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterAddThreadNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, operationalDataset, breadcrumb, timeoutMs, commandData); } break; } case Commands::AddWiFiNetwork::Id: { + Commands::AddWiFiNetwork::DecodableType commandData; expectArgumentCount = 4; chip::ByteSpan ssid; chip::ByteSpan credentials; @@ -578,12 +594,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterAddWiFiNetworkCallback(aEndpointId, apCommandObj, ssid, credentials, - breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterAddWiFiNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, ssid, credentials, breadcrumb, timeoutMs, commandData); } break; } case Commands::DisableNetwork::Id: { + Commands::DisableNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan networkID; uint64_t breadcrumb; @@ -645,12 +662,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterDisableNetworkCallback(aEndpointId, apCommandObj, networkID, - breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterDisableNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, networkID, breadcrumb, timeoutMs, commandData); } break; } case Commands::EnableNetwork::Id: { + Commands::EnableNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan networkID; uint64_t breadcrumb; @@ -712,12 +730,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterEnableNetworkCallback(aEndpointId, apCommandObj, networkID, - breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterEnableNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, networkID, breadcrumb, timeoutMs, commandData); } break; } case Commands::GetLastNetworkCommissioningResult::Id: { + Commands::GetLastNetworkCommissioningResult::DecodableType commandData; expectArgumentCount = 1; uint32_t timeoutMs; bool argExists[1]; @@ -771,12 +790,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback(aEndpointId, apCommandObj, - timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, timeoutMs, commandData); } break; } case Commands::RemoveNetwork::Id: { + Commands::RemoveNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan NetworkID; uint64_t Breadcrumb; @@ -838,12 +858,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterRemoveNetworkCallback(aEndpointId, apCommandObj, NetworkID, - Breadcrumb, TimeoutMs); + wasHandled = emberAfNetworkCommissioningClusterRemoveNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, NetworkID, Breadcrumb, TimeoutMs, commandData); } break; } case Commands::ScanNetworks::Id: { + Commands::ScanNetworks::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan ssid; uint64_t breadcrumb; @@ -905,12 +926,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = - emberAfNetworkCommissioningClusterScanNetworksCallback(aEndpointId, apCommandObj, ssid, breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterScanNetworksCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, ssid, breadcrumb, timeoutMs, commandData); } break; } case Commands::UpdateThreadNetwork::Id: { + Commands::UpdateThreadNetwork::DecodableType commandData; expectArgumentCount = 3; chip::ByteSpan operationalDataset; uint64_t breadcrumb; @@ -973,11 +995,12 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { wasHandled = emberAfNetworkCommissioningClusterUpdateThreadNetworkCallback( - aEndpointId, apCommandObj, operationalDataset, breadcrumb, timeoutMs); + apCommandObj, aCommandPath, aCommandPath.mEndpointId, operationalDataset, breadcrumb, timeoutMs, commandData); } break; } case Commands::UpdateWiFiNetwork::Id: { + Commands::UpdateWiFiNetwork::DecodableType commandData; expectArgumentCount = 4; chip::ByteSpan ssid; chip::ByteSpan credentials; @@ -1043,14 +1066,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { - wasHandled = emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback(aEndpointId, apCommandObj, ssid, - credentials, breadcrumb, timeoutMs); + wasHandled = emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, ssid, credentials, breadcrumb, timeoutMs, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, NetworkCommissioning::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -1058,9 +1081,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - NetworkCommissioning::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + NetworkCommissioning::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -1078,7 +1102,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace OperationalCredentials { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -1091,9 +1115,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::AddNOC::Id: { + Commands::AddNOC::DecodableType commandData; expectArgumentCount = 5; chip::ByteSpan NOCValue; chip::ByteSpan ICACValue; @@ -1163,12 +1188,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterAddNOCCallback(aEndpointId, apCommandObj, NOCValue, ICACValue, - IPKValue, CaseAdminNode, AdminVendorId); + wasHandled = emberAfOperationalCredentialsClusterAddNOCCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, NOCValue, ICACValue, IPKValue, CaseAdminNode, + AdminVendorId, commandData); } break; } case Commands::AddTrustedRootCertificate::Id: { + Commands::AddTrustedRootCertificate::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan RootCertificate; bool argExists[1]; @@ -1222,12 +1249,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback(aEndpointId, apCommandObj, - RootCertificate); + wasHandled = emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, RootCertificate, commandData); } break; } case Commands::AttestationRequest::Id: { + Commands::AttestationRequest::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan AttestationNonce; bool argExists[1]; @@ -1281,12 +1309,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = - emberAfOperationalCredentialsClusterAttestationRequestCallback(aEndpointId, apCommandObj, AttestationNonce); + wasHandled = emberAfOperationalCredentialsClusterAttestationRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, AttestationNonce, commandData); } break; } case Commands::CertificateChainRequest::Id: { + Commands::CertificateChainRequest::DecodableType commandData; expectArgumentCount = 1; uint8_t CertificateType; bool argExists[1]; @@ -1340,12 +1369,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = - emberAfOperationalCredentialsClusterCertificateChainRequestCallback(aEndpointId, apCommandObj, CertificateType); + wasHandled = emberAfOperationalCredentialsClusterCertificateChainRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CertificateType, commandData); } break; } case Commands::OpCSRRequest::Id: { + Commands::OpCSRRequest::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan CSRNonce; bool argExists[1]; @@ -1399,11 +1429,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterOpCSRRequestCallback(aEndpointId, apCommandObj, CSRNonce); + wasHandled = emberAfOperationalCredentialsClusterOpCSRRequestCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, CSRNonce, commandData); } break; } case Commands::RemoveFabric::Id: { + Commands::RemoveFabric::DecodableType commandData; expectArgumentCount = 1; uint8_t FabricIndex; bool argExists[1]; @@ -1457,11 +1489,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterRemoveFabricCallback(aEndpointId, apCommandObj, FabricIndex); + wasHandled = emberAfOperationalCredentialsClusterRemoveFabricCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, FabricIndex, commandData); } break; } case Commands::RemoveTrustedRootCertificate::Id: { + Commands::RemoveTrustedRootCertificate::DecodableType commandData; expectArgumentCount = 1; chip::ByteSpan TrustedRootIdentifier; bool argExists[1]; @@ -1515,12 +1549,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterRemoveTrustedRootCertificateCallback(aEndpointId, apCommandObj, - TrustedRootIdentifier); + wasHandled = emberAfOperationalCredentialsClusterRemoveTrustedRootCertificateCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, TrustedRootIdentifier, commandData); } break; } case Commands::UpdateFabricLabel::Id: { + Commands::UpdateFabricLabel::DecodableType commandData; expectArgumentCount = 1; const uint8_t * Label; bool argExists[1]; @@ -1575,12 +1610,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterUpdateFabricLabelCallback(aEndpointId, apCommandObj, - const_cast(Label)); + wasHandled = emberAfOperationalCredentialsClusterUpdateFabricLabelCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, const_cast(Label), commandData); } break; } case Commands::UpdateNOC::Id: { + Commands::UpdateNOC::DecodableType commandData; expectArgumentCount = 2; chip::ByteSpan NOCValue; chip::ByteSpan ICACValue; @@ -1638,13 +1674,14 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfOperationalCredentialsClusterUpdateNOCCallback(aEndpointId, apCommandObj, NOCValue, ICACValue); + wasHandled = emberAfOperationalCredentialsClusterUpdateNOCCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, NOCValue, ICACValue, commandData); } break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, OperationalCredentials::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -1652,9 +1689,10 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - OperationalCredentials::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + OperationalCredentials::Id, aCommandPath.mCommandId, + (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -1672,7 +1710,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, namespace WindowCovering { -void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -1685,14 +1723,17 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, uint32_t currentDecodeTagId = 0; bool wasHandled = false; { - switch (aCommandId) + switch (aCommandPath.mCommandId) { case Commands::DownOrClose::Id: { + Commands::DownOrClose::DecodableType commandData; - wasHandled = emberAfWindowCoveringClusterDownOrCloseCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfWindowCoveringClusterDownOrCloseCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::GoToLiftPercentage::Id: { + Commands::GoToLiftPercentage::DecodableType commandData; expectArgumentCount = 2; uint8_t liftPercentageValue; uint16_t liftPercent100thsValue; @@ -1750,12 +1791,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfWindowCoveringClusterGoToLiftPercentageCallback(aEndpointId, apCommandObj, liftPercentageValue, - liftPercent100thsValue); + wasHandled = emberAfWindowCoveringClusterGoToLiftPercentageCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, liftPercentageValue, liftPercent100thsValue, commandData); } break; } case Commands::GoToLiftValue::Id: { + Commands::GoToLiftValue::DecodableType commandData; expectArgumentCount = 1; uint16_t liftValue; bool argExists[1]; @@ -1809,11 +1851,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfWindowCoveringClusterGoToLiftValueCallback(aEndpointId, apCommandObj, liftValue); + wasHandled = emberAfWindowCoveringClusterGoToLiftValueCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + liftValue, commandData); } break; } case Commands::GoToTiltPercentage::Id: { + Commands::GoToTiltPercentage::DecodableType commandData; expectArgumentCount = 2; uint8_t tiltPercentageValue; uint16_t tiltPercent100thsValue; @@ -1871,12 +1915,13 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfWindowCoveringClusterGoToTiltPercentageCallback(aEndpointId, apCommandObj, tiltPercentageValue, - tiltPercent100thsValue); + wasHandled = emberAfWindowCoveringClusterGoToTiltPercentageCallback( + apCommandObj, aCommandPath, aCommandPath.mEndpointId, tiltPercentageValue, tiltPercent100thsValue, commandData); } break; } case Commands::GoToTiltValue::Id: { + Commands::GoToTiltValue::DecodableType commandData; expectArgumentCount = 1; uint16_t tiltValue; bool argExists[1]; @@ -1930,23 +1975,28 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfWindowCoveringClusterGoToTiltValueCallback(aEndpointId, apCommandObj, tiltValue); + wasHandled = emberAfWindowCoveringClusterGoToTiltValueCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, + tiltValue, commandData); } break; } case Commands::StopMotion::Id: { + Commands::StopMotion::DecodableType commandData; - wasHandled = emberAfWindowCoveringClusterStopMotionCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfWindowCoveringClusterStopMotionCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } case Commands::UpOrOpen::Id: { + Commands::UpOrOpen::DecodableType commandData; - wasHandled = emberAfWindowCoveringClusterUpOrOpenCallback(aEndpointId, apCommandObj); + wasHandled = + emberAfWindowCoveringClusterUpOrOpenCallback(apCommandObj, aCommandPath, aCommandPath.mEndpointId, commandData); break; } default: { // Unrecognized command ID, error status will apply. - ReportCommandUnsupported(apCommandObj, aEndpointId, WindowCovering::Id, aCommandId); + ReportCommandUnsupported(apCommandObj, aCommandPath); return; } } @@ -1954,9 +2004,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, CommandId aCommandId, if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) { - CommandPathParams returnStatusParam = { aEndpointId, + CommandPathParams returnStatusParam = { aCommandPath.mEndpointId, 0, // GroupId - WindowCovering::Id, aCommandId, (CommandPathFlags::kEndpointIdValid) }; + WindowCovering::Id, aCommandPath.mCommandId, (CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::Status::InvalidCommand); ChipLogProgress(Zcl, @@ -1980,24 +2030,25 @@ void DispatchSingleClusterCommand(ClusterId aClusterId, CommandId aCommandId, En 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); TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); switch (aClusterId) { case Clusters::AdministratorCommissioning::Id: - Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::GeneralCommissioning::Id: - Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::NetworkCommissioning::Id: - Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::OperationalCredentials::Id: - Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, commandPath, aReader); break; case Clusters::WindowCovering::Id: - Clusters::WindowCovering::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + Clusters::WindowCovering::DispatchServerCommand(apCommandObj, commandPath, aReader); break; default: // Unrecognized cluster ID, error status will apply. @@ -2020,6 +2071,7 @@ void DispatchSingleClusterResponseCommand(ClusterId aClusterId, CommandId aComma 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); TLV::TLVType dataTlvType; SuccessOrExit(aReader.EnterContainer(dataTlvType)); switch (aClusterId)