Skip to content

Commit

Permalink
Remove CHIPClusters.h and corresponding .zapt file from the build (
Browse files Browse the repository at this point in the history
…project-chip#32004)

* Completely remove all references to CHIPClusters.h

* Restyle

* Remove references to CHIPClusters.zapt as well

* Use BaseCluster instead of specific clusters

* Fix names and includes
  • Loading branch information
andy31415 authored and erwinpan1 committed Feb 13, 2024
1 parent 8e9cdd9 commit 52d33da
Show file tree
Hide file tree
Showing 15 changed files with 13 additions and 223 deletions.
2 changes: 0 additions & 2 deletions build/chip/chip_codegen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion build/chip/chip_codegen.gni
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion build/chip/esp32/esp32_codegen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
80 changes: 0 additions & 80 deletions examples/thermostat/asr/include/CHIPClusters.h

This file was deleted.

4 changes: 2 additions & 2 deletions examples/tv-app/android/java/TVApp-JNI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@
#include <app/app-platform/ContentAppPlatform.h>
#include <app/server/Dnssd.h>
#include <app/server/java/AndroidAppServerWrapper.h>
#include <controller/CHIPCluster.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
#include <jni.h>
#include <lib/core/CHIPError.h>
#include <lib/support/CHIPJNIError.h>
#include <lib/support/JniReferences.h>
#include <lib/support/JniTypeWrappers.h>
#include <zap-generated/CHIPClusters.h>

using namespace chip;
using namespace chip::app;
Expand Down Expand Up @@ -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);

Expand Down
9 changes: 5 additions & 4 deletions examples/tv-app/tv-common/src/AppTv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,17 @@

#include "AppTv.h"

#include <cstdio>
#include <inttypes.h>

#include <app-common/zap-generated/attributes/Accessors.h>
#include <app-common/zap-generated/ids/Attributes.h>
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/CommandHandler.h>
#include <app/server/Dnssd.h>
#include <app/server/Server.h>
#include <app/util/af.h>
#include <cstdio>
#include <inttypes.h>
#include <controller/CHIPCluster.h>
#include <lib/core/CHIPCore.h>
#include <lib/core/DataModelTypes.h>
#include <lib/support/CHIPArgParser.hpp>
Expand All @@ -38,7 +40,6 @@
#include <lib/support/ZclString.h>
#include <platform/CHIPDeviceLayer.h>
#include <platform/DeviceInstanceInfoProvider.h>
#include <zap-generated/CHIPClusters.h>

#if CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE
#include <controller/CHIPDeviceController.h>
Expand Down Expand Up @@ -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);

Expand Down
1 change: 0 additions & 1 deletion examples/virtual-device-app/android/java/DeviceApp-JNI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include <lib/support/CHIPJNIError.h>
#include <lib/support/JniReferences.h>
#include <lib/support/JniTypeWrappers.h>
#include <zap-generated/CHIPClusters.h>

using namespace chip;
using namespace chip::app;
Expand Down
2 changes: 0 additions & 2 deletions scripts/tools/zap/tests/available_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@
# 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
IMClusterCommandHandler.cpp: outputs/all-clusters-app/app-templates/IMClusterCommandHandler.cpp

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
Expand Down

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion src/app/chip_data_model.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
14 changes: 6 additions & 8 deletions src/app/chip_data_model.gni
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
Expand Down
5 changes: 0 additions & 5 deletions src/app/zap-templates/app-templates.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
24 changes: 0 additions & 24 deletions src/app/zap-templates/templates/app/CHIPClusters.zapt

This file was deleted.

10 changes: 0 additions & 10 deletions src/lib/shell/commands/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 52d33da

Please sign in to comment.