Skip to content

Commit

Permalink
Remove the callbacks manager.
Browse files Browse the repository at this point in the history
  • Loading branch information
bzbarsky-apple committed Jan 30, 2022
1 parent 7ffd00c commit 1a480da
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 665 deletions.
1 change: 0 additions & 1 deletion src/app/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ static_library("app") {
public_deps = [
":app_buildconfig",
"${chip_root}/src/access",
"${chip_root}/src/app/util:device_callbacks_manager",
"${chip_root}/src/lib/support",
"${chip_root}/src/messaging",
"${chip_root}/src/protocols/secure_channel",
Expand Down
22 changes: 0 additions & 22 deletions src/app/DeviceProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,4 @@ CHIP_ERROR DeviceProxy::SendCommands(app::CommandSender * commandObj, Optional<S
return commandObj->SendCommandRequest(GetSecureSession().Value(), timeout);
}

void DeviceProxy::AddIMResponseHandler(void * commandObj, Callback::Cancelable * onSuccessCallback,
Callback::Cancelable * onFailureCallback, app::TLVDataFilter tlvDataFilter)
{
// Interaction model uses the object instead of a sequence number as the identifier of transactions.
// Since the objects can be identified by its pointer which fits into a uint64 value (the type of NodeId), we use it for the
// "node id" field in callback manager.
static_assert(std::is_same<chip::NodeId, uint64_t>::value, "chip::NodeId is not uint64_t");
chip::NodeId transactionId = reinterpret_cast<chip::NodeId>(commandObj);
mCallbacksMgr.AddResponseCallback(transactionId, 0 /* seqNum, always 0 for IM before #6559 */, onSuccessCallback,
onFailureCallback, tlvDataFilter);
}

void DeviceProxy::CancelIMResponseHandler(void * commandObj)
{
// Interaction model uses the object instead of a sequence number as the identifier of transactions.
// Since the objects can be identified by its pointer which fits into a uint64 value (the type of NodeId), we use it for the
// "node id" field in callback manager.
static_assert(std::is_same<chip::NodeId, uint64_t>::value, "chip::NodeId is not uint64_t");
chip::NodeId transactionId = reinterpret_cast<chip::NodeId>(commandObj);
mCallbacksMgr.CancelResponseCallback(transactionId, 0 /* seqNum, always 0 for IM before #6559 */);
}

} // namespace chip
9 changes: 0 additions & 9 deletions src/app/DeviceProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

#include <app/CommandSender.h>
#include <app/InteractionModelEngine.h>
#include <app/util/CHIPDeviceCallbacksMgr.h>
#include <lib/core/CHIPCallback.h>
#include <lib/core/CHIPCore.h>
#include <lib/support/DLLUtil.h>
Expand All @@ -54,12 +53,6 @@ class DLL_EXPORT DeviceProxy

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

// Interaction model uses the object and callback interface instead of sequence number to mark different transactions.
virtual void AddIMResponseHandler(void * commandObj, Callback::Cancelable * onSuccessCallback,
Callback::Cancelable * onFailureCallback, app::TLVDataFilter tlvDataFilter = nullptr);

virtual void CancelIMResponseHandler(void * commandObj);

virtual Messaging::ExchangeManager * GetExchangeManager() const = 0;

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

virtual uint8_t GetNextSequenceNumber() = 0;

app::CHIPDeviceCallbacksMgr & mCallbacksMgr = app::CHIPDeviceCallbacksMgr::GetInstance();

ReliableMessageProtocolConfig mMRPConfig = gDefaultMRPConfig;
};

Expand Down
2 changes: 0 additions & 2 deletions src/app/tests/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ chip_test_suite("tests") {
"TestAttributePathExpandIterator.cpp",
"TestAttributeValueEncoder.cpp",
"TestBuilderParser.cpp",
"TestCHIPDeviceCallbacksMgr.cpp",
"TestClusterInfo.cpp",
"TestCommandInteraction.cpp",
"TestCommandPathParams.cpp",
Expand Down Expand Up @@ -77,7 +76,6 @@ chip_test_suite("tests") {
"${chip_root}/src/app",
"${chip_root}/src/app/common:cluster-objects",
"${chip_root}/src/app/tests:helpers",
"${chip_root}/src/app/util:device_callbacks_manager",
"${chip_root}/src/app/util/mock:mock_ember",
"${chip_root}/src/lib/core",
"${nlunit_test_root}:nlunit-test",
Expand Down
Loading

0 comments on commit 1a480da

Please sign in to comment.