diff --git a/build/chip/chip_codegen.cmake b/build/chip/chip_codegen.cmake index f7e4366a6d9aa8..3a9c744cb39bdc 100644 --- a/build/chip/chip_codegen.cmake +++ b/build/chip/chip_codegen.cmake @@ -108,7 +108,6 @@ endfunction() # GENERATOR "app-templates" # OUTPUTS # "zap-generated/access.h", -# "zap-generated/CHIPClusters.h" # "zap-generated/endpoint_config.h", # "zap-generated/gen_config.h", # "zap-generated/IMClusterCommandHandler.cpp" @@ -162,7 +161,6 @@ function(chip_zapgen TARGET_NAME) SET(EXTRA_DEPENDENCIES "${CHIP_ROOT}/src/app/zap-templates/partials/header.zapt" "${CHIP_ROOT}/src/app/zap-templates/templates/app/access.zapt" - "${CHIP_ROOT}/src/app/zap-templates/templates/app/CHIPClusters.zapt" "${CHIP_ROOT}/src/app/zap-templates/templates/app/endpoint_config.zapt" "${CHIP_ROOT}/src/app/zap-templates/templates/app/gen_config.zapt" "${CHIP_ROOT}/src/app/zap-templates/templates/app/im-cluster-command-handler.zapt" diff --git a/build/chip/chip_codegen.gni b/build/chip/chip_codegen.gni index 6d40f614fff71c..02acd08150aae8 100644 --- a/build/chip/chip_codegen.gni +++ b/build/chip/chip_codegen.gni @@ -144,7 +144,6 @@ template("_chip_build_time_zapgen") { # Application templates, actually generating files "${_template_dir}/access.zapt", - "${_template_dir}/CHIPClusters.zapt", "${_template_dir}/endpoint_config.zapt", "${_template_dir}/gen_config.zapt", "${_template_dir}/im-cluster-command-handler.zapt", diff --git a/build/chip/esp32/esp32_codegen.cmake b/build/chip/esp32/esp32_codegen.cmake index af943e39fbff30..d83bdb7ccf12c8 100644 --- a/build/chip/esp32/esp32_codegen.cmake +++ b/build/chip/esp32/esp32_codegen.cmake @@ -61,7 +61,6 @@ macro(chip_app_component_zapgen ZAP_NAME) GENERATOR "app-templates" OUTPUTS "zap-generated/access.h" - "zap-generated/CHIPClusters.h" "zap-generated/endpoint_config.h" "zap-generated/gen_config.h" "zap-generated/IMClusterCommandHandler.cpp" diff --git a/examples/thermostat/asr/include/CHIPClusters.h b/examples/thermostat/asr/include/CHIPClusters.h deleted file mode 100644 index e3b7157126b8c8..00000000000000 --- a/examples/thermostat/asr/include/CHIPClusters.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * - * Copyright (c) 2022 Project CHIP Authors - * - * 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. - */ - -// Prevent multiple inclusion -#pragma once - -#include -#include - -#include -#include -#include - -namespace chip { -namespace Controller { - -class DLL_EXPORT IdentifyCluster : public ClusterBase -{ -public: - IdentifyCluster(Messaging::ExchangeManager & exchangeManager, const SessionHandle & session, EndpointId endpoint) : - ClusterBase(exchangeManager, session, endpoint) - {} - ~IdentifyCluster() {} -}; - -class DLL_EXPORT DescriptorCluster : public ClusterBase -{ -public: - DescriptorCluster(Messaging::ExchangeManager & exchangeManager, const SessionHandle & session, EndpointId endpoint) : - ClusterBase(exchangeManager, session, endpoint) - {} - ~DescriptorCluster() {} -}; - -class DLL_EXPORT OtaSoftwareUpdateProviderCluster : public ClusterBase -{ -public: - OtaSoftwareUpdateProviderCluster(Messaging::ExchangeManager & exchangeManager, const SessionHandle & session, - EndpointId endpoint) : - ClusterBase(exchangeManager, session, endpoint) - {} - ~OtaSoftwareUpdateProviderCluster() {} -}; - -class DLL_EXPORT TemperatureMeasurementCluster : public ClusterBase -{ -public: - TemperatureMeasurementCluster(Messaging::ExchangeManager & exchangeManager, const SessionHandle & session, - EndpointId endpoint) : - ClusterBase(exchangeManager, session, endpoint) - {} - ~TemperatureMeasurementCluster() {} -}; - -class DLL_EXPORT RelativeHumidityMeasurementCluster : public ClusterBase -{ -public: - RelativeHumidityMeasurementCluster(Messaging::ExchangeManager & exchangeManager, const SessionHandle & session, - EndpointId endpoint) : - ClusterBase(exchangeManager, session, endpoint) - {} - ~RelativeHumidityMeasurementCluster() {} -}; - -} // namespace Controller -} // namespace chip diff --git a/examples/tv-app/android/java/TVApp-JNI.cpp b/examples/tv-app/android/java/TVApp-JNI.cpp index 82fae67ec1dd39..6bbc35ed297415 100644 --- a/examples/tv-app/android/java/TVApp-JNI.cpp +++ b/examples/tv-app/android/java/TVApp-JNI.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -41,7 +42,6 @@ #include #include #include -#include using namespace chip; using namespace chip::app; @@ -216,7 +216,7 @@ class MyPostCommissioningListener : public PostCommissioningListener const SessionHandle & sessionHandle) override { // read current binding list - chip::Controller::BindingCluster cluster(exchangeMgr, sessionHandle, kTargetBindingClusterEndpointId); + chip::Controller::ClusterBase cluster(exchangeMgr, sessionHandle, kTargetBindingClusterEndpointId); cacheContext(vendorId, productId, nodeId, exchangeMgr, sessionHandle); diff --git a/examples/tv-app/tv-common/src/AppTv.cpp b/examples/tv-app/tv-common/src/AppTv.cpp index 8cd0cd409b783a..939e14be5315cc 100644 --- a/examples/tv-app/tv-common/src/AppTv.cpp +++ b/examples/tv-app/tv-common/src/AppTv.cpp @@ -21,6 +21,9 @@ #include "AppTv.h" +#include +#include + #include #include #include @@ -28,8 +31,7 @@ #include #include #include -#include -#include +#include #include #include #include @@ -38,7 +40,6 @@ #include #include #include -#include #if CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE #include @@ -126,7 +127,7 @@ class MyPostCommissioningListener : public PostCommissioningListener const SessionHandle & sessionHandle) override { // read current binding list - chip::Controller::BindingCluster cluster(exchangeMgr, sessionHandle, kTargetBindingClusterEndpointId); + chip::Controller::ClusterBase cluster(exchangeMgr, sessionHandle, kTargetBindingClusterEndpointId); cacheContext(vendorId, productId, nodeId, exchangeMgr, sessionHandle); diff --git a/examples/virtual-device-app/android/java/DeviceApp-JNI.cpp b/examples/virtual-device-app/android/java/DeviceApp-JNI.cpp index 8175ce0b955157..4636dab286df65 100644 --- a/examples/virtual-device-app/android/java/DeviceApp-JNI.cpp +++ b/examples/virtual-device-app/android/java/DeviceApp-JNI.cpp @@ -34,7 +34,6 @@ #include #include #include -#include using namespace chip; using namespace chip::app; diff --git a/scripts/tools/zap/tests/available_tests.yaml b/scripts/tools/zap/tests/available_tests.yaml index 3af788d5267b46..6c152a1aef0b77 100644 --- a/scripts/tools/zap/tests/available_tests.yaml +++ b/scripts/tools/zap/tests/available_tests.yaml @@ -12,7 +12,6 @@ # and the expected content for those output files. inputs/all-clusters-app.zap: ../../../../src/app/zap-templates/app-templates.json: - CHIPClusters.h: outputs/all-clusters-app/app-templates/CHIPClusters.h endpoint_config.h: outputs/all-clusters-app/app-templates/endpoint_config.h gen_config.h: outputs/all-clusters-app/app-templates/gen_config.h access.h: outputs/all-clusters-app/app-templates/access.h @@ -20,7 +19,6 @@ inputs/all-clusters-app.zap: inputs/lighting-app.zap: ../../../../src/app/zap-templates/app-templates.json: - CHIPClusters.h: outputs/lighting-app/app-templates/CHIPClusters.h endpoint_config.h: outputs/lighting-app/app-templates/endpoint_config.h gen_config.h: outputs/lighting-app/app-templates/gen_config.h access.h: outputs/lighting-app/app-templates/access.h diff --git a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/CHIPClusters.h b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/CHIPClusters.h deleted file mode 100644 index 0b42feede68eab..00000000000000 --- a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/CHIPClusters.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * - * Copyright (c) 2022 Project CHIP Authors - * - * 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. - */ - -// THIS FILE IS GENERATED BY ZAP -#pragma once - -#include -#include - -#include -#include -#include - -namespace chip { -namespace Controller { - -class DLL_EXPORT OtaSoftwareUpdateProviderCluster : public ClusterBase -{ -public: - OtaSoftwareUpdateProviderCluster(Messaging::ExchangeManager & exchangeManager, const SessionHandle & session, - EndpointId endpoint) : ClusterBase(exchangeManager, session, endpoint) - {} - ~OtaSoftwareUpdateProviderCluster() {} -}; - -} // namespace Controller -} // namespace chip diff --git a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/CHIPClusters.h b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/CHIPClusters.h deleted file mode 100644 index 0b42feede68eab..00000000000000 --- a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/CHIPClusters.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * - * Copyright (c) 2022 Project CHIP Authors - * - * 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. - */ - -// THIS FILE IS GENERATED BY ZAP -#pragma once - -#include -#include - -#include -#include -#include - -namespace chip { -namespace Controller { - -class DLL_EXPORT OtaSoftwareUpdateProviderCluster : public ClusterBase -{ -public: - OtaSoftwareUpdateProviderCluster(Messaging::ExchangeManager & exchangeManager, const SessionHandle & session, - EndpointId endpoint) : ClusterBase(exchangeManager, session, endpoint) - {} - ~OtaSoftwareUpdateProviderCluster() {} -}; - -} // namespace Controller -} // namespace chip diff --git a/src/app/chip_data_model.cmake b/src/app/chip_data_model.cmake index 3e1d669a49569a..610986a6186d8f 100644 --- a/src/app/chip_data_model.cmake +++ b/src/app/chip_data_model.cmake @@ -123,7 +123,6 @@ function(chip_configure_data_model APP_TARGET) GENERATOR "app-templates" OUTPUTS "zap-generated/access.h" - "zap-generated/CHIPClusters.h" "zap-generated/endpoint_config.h" "zap-generated/gen_config.h" "zap-generated/IMClusterCommandHandler.cpp" diff --git a/src/app/chip_data_model.gni b/src/app/chip_data_model.gni index bc6c48df53d742..85f5224ada7d37 100644 --- a/src/app/chip_data_model.gni +++ b/src/app/chip_data_model.gni @@ -66,24 +66,22 @@ template("chip_data_model") { input = rebase_path(invoker.zap_file) generator = "app-templates" + # NOTE: these files MUST be in sync with outputs in + # src/app/zap-templates/app-templates.json outputs = [ "zap-generated/access.h", "zap-generated/gen_config.h", "zap-generated/endpoint_config.h", ] + # NOTE: these are ALSO auto-generated but handled below: + # "zap-generated/IMClusterCommandHandler.cpp" + # -> contains one large DispatchSingleClusterCommand and DispatchServerCommand + if (chip_code_pre_generated_directory == "") { prune_outputs = [] } - if (chip_controller) { - outputs += [ "zap-generated/CHIPClusters.h" ] - } else { - if (defined(prune_outputs)) { - prune_outputs += [ "zap-generated/CHIPClusters.h" ] - } - } - # TODO: It is unclear here why `zap_pregenerated_dir` has any relevance # in including IMClusterCommandHandler or not. # diff --git a/src/app/zap-templates/app-templates.json b/src/app/zap-templates/app-templates.json index 07434029be2120..1d41e127165c01 100644 --- a/src/app/zap-templates/app-templates.json +++ b/src/app/zap-templates/app-templates.json @@ -35,11 +35,6 @@ "name": "CHIP Client Callbacks for Interaction Model", "output": "IMClusterCommandHandler.cpp" }, - { - "path": "templates/app/CHIPClusters.zapt", - "name": "C++ ZCL API Header", - "output": "CHIPClusters.h" - }, { "path": "templates/app/access.zapt", "name": "Matter access definitions", diff --git a/src/app/zap-templates/templates/app/CHIPClusters.zapt b/src/app/zap-templates/templates/app/CHIPClusters.zapt deleted file mode 100644 index 05fab685053834..00000000000000 --- a/src/app/zap-templates/templates/app/CHIPClusters.zapt +++ /dev/null @@ -1,24 +0,0 @@ -{{> header}} -#pragma once - -#include -#include - -#include -#include -#include - -namespace chip { -namespace Controller { - -{{#all_user_clusters side='client'}} -class DLL_EXPORT {{asUpperCamelCase name}}Cluster : public ClusterBase -{ -public: - {{asUpperCamelCase name}}Cluster(Messaging::ExchangeManager & exchangeManager, const SessionHandle & session, EndpointId endpoint) : ClusterBase(exchangeManager, session, endpoint) {} - ~{{asUpperCamelCase name}}Cluster() {} -}; - -{{/all_user_clusters}} -} // namespace Controller -} // namespace chip diff --git a/src/lib/shell/commands/BUILD.gn b/src/lib/shell/commands/BUILD.gn index 05a6a0e2660ff4..d6190feb9ae41f 100644 --- a/src/lib/shell/commands/BUILD.gn +++ b/src/lib/shell/commands/BUILD.gn @@ -56,16 +56,6 @@ source_set("commands") { if (chip_enable_ota_requestor && chip_device_platform != "none" && chip_device_platform != "linux" && chip_device_platform != "darwin") { sources += [ "Ota.cpp" ] - - # TODO: the ota commands in shell should use the interfaces in /src/app/clusters/ota-requestor - # - # Awkward dependencies below say: - # - codegen via zap the CHIPClusters.h (which is the CLIENT SIDE) - # - ensure include path can see zap-generated/CHIPClusters.h - deps = [ "${chip_root}/src/controller/data_model:data_model_zapgen_files" ] - - configs += - [ "${chip_root}/src/controller/data_model:data_model_zapgen_config" ] } if (chip_system_config_provide_statistics) {