Skip to content

Commit 39115b9

Browse files
Remove CHIPClusters.cpp and various things it called into (project-chip#14581)
* Remove CHIPClusters.cpp, now that it's not used. * Remove CHIPClientCallbacks.cpp now that it's not used. * Remove DeviceControllerInteractionModelDelegate. * Remove im-client-callbacks.cpp. * Remove the callbacks manager.
1 parent 8b503ad commit 39115b9

File tree

139 files changed

+13
-28300
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+13
-28300
lines changed

.gitattributes

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# Same for files in zap-generated folders
44
**/zap-generated/** linguist-generated
55
# And some specific generated files
6-
src/controller/python/chip/clusters/CHIPClusters.cpp linguist-generated
76
src/controller/python/chip/clusters/CHIPClusters.py linguist-generated
87
src/controller/python/chip/clusters/Objects.py linguist-generated
98
src/darwin/Framework/CHIPTests/CHIPClustersTests.m linguist-generated

config/mbed/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,6 @@ if (CONFIG_CHIP_OTA_REQUESTOR)
463463

464464
target_sources(${APP_TARGET} PRIVATE
465465
${CHIP_ROOT}/zzz_generated/ota-requestor-app/zap-generated/callback-stub.cpp
466-
${CHIP_ROOT}/zzz_generated/ota-requestor-app/zap-generated/CHIPClusters.cpp
467466
${CHIP_ROOT}/zzz_generated/ota-requestor-app/zap-generated/IMClusterCommandHandler.cpp
468467

469468
${CHIP_ROOT}/src/app/clusters/ota-requestor/OTARequestor.cpp

examples/all-clusters-app/all-clusters-common/BUILD.gn

-1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,4 @@ chip_data_model("all-clusters-common") {
2222
zap_pregenerated_dir =
2323
"${chip_root}/zzz_generated/all-clusters-app/zap-generated"
2424
is_server = true
25-
use_default_client_callbacks = true
2625
}

examples/all-clusters-app/ameba/chip_main.cmake

-2
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,8 @@ endif (matter_enable_ota_requestor)
125125
list(
126126
APPEND ${list_chip_main_sources}
127127

128-
${chip_dir}/zzz_generated/all-clusters-app/zap-generated/CHIPClientCallbacks.cpp
129128
${chip_dir}/zzz_generated/all-clusters-app/zap-generated/callback-stub.cpp
130129
${chip_dir}/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp
131-
${chip_dir}/zzz_generated/all-clusters-app/zap-generated/CHIPClusters.cpp
132130

133131
${chip_dir}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp
134132
${chip_dir}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp

examples/all-clusters-app/mbed/CMakeLists.txt

-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ target_sources(${APP_TARGET} PRIVATE
5454
${MBED_COMMON}/util/LEDWidget.cpp
5555

5656
${GEN_DIR}/all-clusters-app/zap-generated/callback-stub.cpp
57-
${GEN_DIR}/all-clusters-app/zap-generated/CHIPClientCallbacks.cpp
58-
${GEN_DIR}/all-clusters-app/zap-generated/CHIPClusters.cpp
5957
${GEN_DIR}/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp
6058
${GEN_DIR}/app-common/app-common/zap-generated/attributes/Accessors.cpp
6159
${GEN_DIR}/app-common/app-common/zap-generated/cluster-objects.cpp

examples/chip-tool/commands/pairing/PairingCommand.h

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
#include "../common/CHIPCommand.h"
2222
#include <controller/CommissioningDelegate.h>
23-
#include <zap-generated/CHIPClientCallbacks.h>
2423
#include <zap-generated/CHIPClusters.h>
2524

2625
#include <commands/common/CredentialIssuerCommands.h>

examples/lighting-app/ameba/chip_main.cmake

-2
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,8 @@ endif (matter_enable_ota_requestor)
2323
list(
2424
APPEND ${list_chip_main_sources}
2525

26-
${chip_dir}/zzz_generated/lighting-app/zap-generated/CHIPClientCallbacks.cpp
2726
${chip_dir}/zzz_generated/lighting-app/zap-generated/callback-stub.cpp
2827
${chip_dir}/zzz_generated/lighting-app/zap-generated/IMClusterCommandHandler.cpp
29-
${chip_dir}/zzz_generated/lighting-app/zap-generated/CHIPClusters.cpp
3028

3129
${chip_dir}/examples/lighting-app/lighting-common/color_format/color_format.cpp
3230

examples/lighting-app/mbed/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ target_sources(${APP_TARGET} PRIVATE
5454
)
5555

5656
chip_configure_data_model(${APP_TARGET}
57-
INCLUDE_CLIENT_CALLBACKS
5857
INCLUDE_SERVER
5958
ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../lighting-common/lighting-app.zap
6059
GEN_DIR ${GEN_DIR}/lighting-app/zap-generated

examples/lighting-app/nrfconnect/CMakeLists.txt

-2
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,13 @@ target_sources(app PRIVATE
8888
main/main.cpp
8989
main/ZclCallbacks.cpp
9090
${GEN_DIR}/lighting-app/zap-generated/callback-stub.cpp
91-
${GEN_DIR}/lighting-app/zap-generated/CHIPClusters.cpp
9291
${GEN_DIR}/lighting-app/zap-generated/IMClusterCommandHandler.cpp
9392
${NRFCONNECT_COMMON}/util/LEDWidget.cpp
9493
${NRFCONNECT_COMMON}/util/ThreadUtil.cpp
9594
${CHIP_ROOT}/src/app/clusters/ota-requestor/OTARequestor.cpp
9695
${CHIP_ROOT}/src/app/clusters/ota-requestor/BDXDownloader.cpp)
9796

9897
chip_configure_data_model(app
99-
INCLUDE_CLIENT_CALLBACKS
10098
INCLUDE_SERVER
10199
ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../lighting-common/lighting-app.zap
102100
GEN_DIR ${GEN_DIR}/lighting-app/zap-generated

examples/ota-requestor-app/ameba/chip_main.cmake

-3
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ list(
1515

1616
${chip_dir}/zzz_generated/ota-requestor-app/zap-generated/callback-stub.cpp
1717
${chip_dir}/zzz_generated/ota-requestor-app/zap-generated/IMClusterCommandHandler.cpp
18-
${chip_dir}/zzz_generated/ota-requestor-app/zap-generated/CHIPClusters.cpp
19-
${chip_dir}/zzz_generated/ota-requestor-app/zap-generated/CHIPClientCallbacks.cpp
2018

2119
${chip_dir}/examples/ota-requestor-app/ameba/main/chipinterface.cpp
2220
${chip_dir}/examples/ota-requestor-app/ameba/main/Globals.cpp
@@ -27,7 +25,6 @@ list(
2725
${chip_dir}/src/app/clusters/ota-requestor/BDXDownloader.cpp
2826
${chip_dir}/src/app/clusters/ota-requestor/OTARequestor.cpp
2927
${chip_dir}/src/app/clusters/ota-requestor/ota-requestor-server.cpp
30-
${chip_dir}/src/app/util/im-client-callbacks.cpp
3128
)
3229

3330
add_library(

examples/ota-requestor-app/mbed/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ target_sources(${APP_TARGET} PRIVATE
5959

6060
chip_configure_data_model(${APP_TARGET}
6161
INCLUDE_SERVER
62-
INCLUDE_CLIENT_CALLBACKS
6362
ZAP_FILE ${CHIP_ROOT}/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap
6463
GEN_DIR ${CHIP_ROOT}/zzz_generated/ota-requestor-app/zap-generated
6564
)

examples/ota-requestor-app/ota-requestor-common/BUILD.gn

-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ chip_data_model("ota-requestor-common") {
2626
zap_pregenerated_dir =
2727
"${chip_root}/zzz_generated/ota-requestor-app/zap-generated"
2828

29-
use_default_client_callbacks = true
30-
3129
deps = [ "${chip_root}/src/lib" ]
3230

3331
public_configs = [ ":config" ]

examples/tv-app/tv-common/BUILD.gn

-1
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,4 @@ chip_data_model("tv-common") {
2121

2222
zap_pregenerated_dir = "${chip_root}/zzz_generated/tv-app/zap-generated"
2323
is_server = true
24-
use_default_client_callbacks = true
2524
}

examples/tv-casting-app/linux/main.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ void DeviceEventCallback(const DeviceLayer::ChipDeviceEvent * event, intptr_t ar
230230
.idAllocator = &(server->GetSessionIDAllocator()),
231231
.fabricTable = &(server->GetFabricTable()),
232232
.clientPool = &gCASEClientPool,
233-
.imDelegate = chip::Platform::New<chip::Controller::DeviceControllerInteractionModelDelegate>(),
234233
};
235234

236235
PeerId peerID = fabric->GetPeerIdForNode(tvNodeId);

examples/tv-casting-app/tv-casting-common/BUILD.gn

-1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,4 @@ chip_data_model("tv-casting-common") {
2222
zap_pregenerated_dir =
2323
"${chip_root}/zzz_generated/tv-casting-app/zap-generated"
2424
is_server = true
25-
use_default_client_callbacks = true
2625
}

src/app/BUILD.gn

-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ static_library("app") {
152152
public_deps = [
153153
":app_buildconfig",
154154
"${chip_root}/src/access",
155-
"${chip_root}/src/app/util:device_callbacks_manager",
156155
"${chip_root}/src/lib/support",
157156
"${chip_root}/src/messaging",
158157
"${chip_root}/src/protocols/secure_channel",

src/app/DeviceControllerInteractionModelDelegate.h

-74
This file was deleted.

src/app/DeviceProxy.cpp

-22
Original file line numberDiff line numberDiff line change
@@ -46,26 +46,4 @@ CHIP_ERROR DeviceProxy::SendCommands(app::CommandSender * commandObj, Optional<S
4646
return commandObj->SendCommandRequest(GetSecureSession().Value(), timeout);
4747
}
4848

49-
void DeviceProxy::AddIMResponseHandler(void * commandObj, Callback::Cancelable * onSuccessCallback,
50-
Callback::Cancelable * onFailureCallback, app::TLVDataFilter tlvDataFilter)
51-
{
52-
// Interaction model uses the object instead of a sequence number as the identifier of transactions.
53-
// Since the objects can be identified by its pointer which fits into a uint64 value (the type of NodeId), we use it for the
54-
// "node id" field in callback manager.
55-
static_assert(std::is_same<chip::NodeId, uint64_t>::value, "chip::NodeId is not uint64_t");
56-
chip::NodeId transactionId = reinterpret_cast<chip::NodeId>(commandObj);
57-
mCallbacksMgr.AddResponseCallback(transactionId, 0 /* seqNum, always 0 for IM before #6559 */, onSuccessCallback,
58-
onFailureCallback, tlvDataFilter);
59-
}
60-
61-
void DeviceProxy::CancelIMResponseHandler(void * commandObj)
62-
{
63-
// Interaction model uses the object instead of a sequence number as the identifier of transactions.
64-
// Since the objects can be identified by its pointer which fits into a uint64 value (the type of NodeId), we use it for the
65-
// "node id" field in callback manager.
66-
static_assert(std::is_same<chip::NodeId, uint64_t>::value, "chip::NodeId is not uint64_t");
67-
chip::NodeId transactionId = reinterpret_cast<chip::NodeId>(commandObj);
68-
mCallbacksMgr.CancelResponseCallback(transactionId, 0 /* seqNum, always 0 for IM before #6559 */);
69-
}
70-
7149
} // namespace chip

src/app/DeviceProxy.h

-12
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@
2727
#pragma once
2828

2929
#include <app/CommandSender.h>
30-
#include <app/DeviceControllerInteractionModelDelegate.h>
3130
#include <app/InteractionModelEngine.h>
32-
#include <app/util/CHIPDeviceCallbacksMgr.h>
3331
#include <lib/core/CHIPCallback.h>
3432
#include <lib/core/CHIPCore.h>
3533
#include <lib/support/DLLUtil.h>
@@ -55,14 +53,6 @@ class DLL_EXPORT DeviceProxy
5553

5654
virtual CHIP_ERROR SendCommands(app::CommandSender * commandObj, chip::Optional<System::Clock::Timeout> timeout = NullOptional);
5755

58-
// Interaction model uses the object and callback interface instead of sequence number to mark different transactions.
59-
virtual void AddIMResponseHandler(void * commandObj, Callback::Cancelable * onSuccessCallback,
60-
Callback::Cancelable * onFailureCallback, app::TLVDataFilter tlvDataFilter = nullptr);
61-
62-
virtual void CancelIMResponseHandler(void * commandObj);
63-
64-
virtual Controller::DeviceControllerInteractionModelDelegate * GetInteractionModelDelegate() = 0;
65-
6656
virtual Messaging::ExchangeManager * GetExchangeManager() const = 0;
6757

6858
virtual chip::Optional<SessionHandle> GetSecureSession() const = 0;
@@ -78,8 +68,6 @@ class DLL_EXPORT DeviceProxy
7868

7969
virtual uint8_t GetNextSequenceNumber() = 0;
8070

81-
app::CHIPDeviceCallbacksMgr & mCallbacksMgr = app::CHIPDeviceCallbacksMgr::GetInstance();
82-
8371
ReliableMessageProtocolConfig mMRPConfig = gDefaultMRPConfig;
8472
};
8573

src/app/InteractionModelEngine.h

-2
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,6 @@ class InteractionModelEngine : public Messaging::ExchangeDelegate, public Comman
304304

305305
void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, chip::TLV::TLVReader & aReader,
306306
CommandHandler * apCommandObj);
307-
void DispatchSingleClusterResponseCommand(const ConcreteCommandPath & aCommandPath, chip::TLV::TLVReader & aReader,
308-
CommandSender * apCommandObj);
309307

310308
/**
311309
* Check whether the given cluster exists on the given endpoint and supports the given command.

src/app/OperationalDeviceProxy.h

-4
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ struct DeviceProxyInitParams
5555
FabricTable * fabricTable = nullptr;
5656
CASEClientPoolDelegate * clientPool = nullptr;
5757

58-
Controller::DeviceControllerInteractionModelDelegate * imDelegate = nullptr;
59-
6058
Optional<ReliableMessageProtocolConfig> mrpLocalConfig = Optional<ReliableMessageProtocolConfig>::Missing();
6159

6260
CHIP_ERROR Validate() const
@@ -170,8 +168,6 @@ class DLL_EXPORT OperationalDeviceProxy : public DeviceProxy, SessionReleaseDele
170168

171169
CHIP_ERROR ShutdownSubscriptions() override;
172170

173-
Controller::DeviceControllerInteractionModelDelegate * GetInteractionModelDelegate() override { return mInitParams.imDelegate; }
174-
175171
Messaging::ExchangeManager * GetExchangeManager() const override { return mInitParams.exchangeMgr; }
176172

177173
chip::Optional<SessionHandle> GetSecureSession() const override { return mSecureSession.ToOptional(); }

src/app/chip_data_model.cmake

+1-8
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,7 @@ endfunction()
5454
# supported by the application.
5555
#
5656
function(chip_configure_data_model APP_TARGET)
57-
cmake_parse_arguments(ARG "INCLUDE_CLIENT_CALLBACKS;INCLUDE_SERVER" "ZAP_FILE;GEN_DIR" "" ${ARGN})
58-
59-
if (ARG_INCLUDE_CLIENT_CALLBACKS)
60-
target_sources(${APP_TARGET} PRIVATE
61-
${CHIP_APP_BASE_DIR}/util/im-client-callbacks.cpp
62-
${ARG_GEN_DIR}/CHIPClientCallbacks.cpp
63-
)
64-
endif()
57+
cmake_parse_arguments(ARG "INCLUDE_SERVER" "ZAP_FILE;GEN_DIR" "" ${ARGN})
6558

6659
if (ARG_INCLUDE_SERVER)
6760
target_sources(${APP_TARGET} PRIVATE

src/app/chip_data_model.gni

+1-19
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ _zap_cluster_list_script = get_path_info("zap_cluster_list.py", "abspath")
3535
# Names of the clusters directories to compile.
3636
# Deprecated, specify zap_file instead.
3737
#
38-
# use_default_client_callbacks
39-
# Include CHIPClientCallbacks.cpp.
40-
#
4138
# Forwards all the remaining variables to the source_set.
4239
#
4340
template("chip_data_model") {
@@ -56,18 +53,13 @@ template("chip_data_model") {
5653

5754
_use_tests_apis = defined(invoker.use_tests_apis) && invoker.use_tests_apis
5855

59-
_use_default_client_callbacks =
60-
defined(invoker.use_default_client_callbacks) &&
61-
invoker.use_default_client_callbacks
62-
6356
source_set(_data_model_name) {
6457
forward_variables_from(invoker,
6558
"*",
6659
[
6760
"zap_pregenerated_dir",
6861
"cluster_sources",
6962
"zap_file",
70-
"use_default_client_callbacks",
7163
"is_server",
7264
])
7365

@@ -166,17 +158,7 @@ template("chip_data_model") {
166158
sources += [ "${invoker.zap_pregenerated_dir}/callback-stub.cpp" ]
167159

168160
if (chip_controller) {
169-
sources += [
170-
"${invoker.zap_pregenerated_dir}/CHIPClusters.cpp",
171-
"${invoker.zap_pregenerated_dir}/CHIPClusters.h",
172-
]
173-
}
174-
175-
if (_use_default_client_callbacks) {
176-
sources += [
177-
"${_app_root}/util/im-client-callbacks.cpp",
178-
"${invoker.zap_pregenerated_dir}/CHIPClientCallbacks.cpp",
179-
]
161+
sources += [ "${invoker.zap_pregenerated_dir}/CHIPClusters.h" ]
180162
}
181163

182164
if (_use_default_im_dispatch) {

src/app/server/Server.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ Server::Server() :
8787
.idAllocator = &mSessionIDAllocator,
8888
.fabricTable = &mFabrics,
8989
.clientPool = &mCASEClientPool,
90-
.imDelegate = nullptr,
9190
},
9291
.dnsCache = nullptr,
9392
.devicePool = &mDevicePool,

src/app/tests/BUILD.gn

-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ chip_test_suite("tests") {
4444
"TestAttributePathExpandIterator.cpp",
4545
"TestAttributeValueEncoder.cpp",
4646
"TestBuilderParser.cpp",
47-
"TestCHIPDeviceCallbacksMgr.cpp",
4847
"TestClusterInfo.cpp",
4948
"TestCommandInteraction.cpp",
5049
"TestCommandPathParams.cpp",
@@ -77,7 +76,6 @@ chip_test_suite("tests") {
7776
"${chip_root}/src/app",
7877
"${chip_root}/src/app/common:cluster-objects",
7978
"${chip_root}/src/app/tests:helpers",
80-
"${chip_root}/src/app/util:device_callbacks_manager",
8179
"${chip_root}/src/app/util/mock:mock_ember",
8280
"${chip_root}/src/lib/core",
8381
"${nlunit_test_root}:nlunit-test",

0 commit comments

Comments
 (0)