Skip to content

Commit

Permalink
Move CommandSender and PendingResponseTracker to IM. (#32227)
Browse files Browse the repository at this point in the history
* Move CommandSender and PendingResponseTracker to IM.

Previous location of these files was `app` however this created
apparent circular dependencies for includes.

* Restyle

* CommandSender is now tracked

* Move read and write clients to interactionmodel as well

* Also pull in interactionmodelhelper .... this is a very poorly named file

---------

Co-authored-by: Andrei Litvin <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Mar 13, 2024
1 parent d13679f commit 2570450
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 25 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,11 @@ jobs:
--known-failure app/att-storage.h \
--known-failure app/CommandHandler.h \
--known-failure app/CommandHandlerInterface.h \
--known-failure app/CommandSender.h \
--known-failure app/CommandSenderLegacyCallback.h \
--known-failure app/CompatEnumNames.h \
--known-failure app/data-model/ListLargeSystemExtensions.h \
--known-failure app/EventHeader.h \
--known-failure app/EventLoggingTypes.h \
--known-failure app/InteractionModelHelper.h \
--known-failure app/ReadClient.h \
--known-failure app/ReadHandler.h \
--known-failure app/ReadPrepareParams.h \
--known-failure app/reporting/tests/MockReportScheduler.cpp \
Expand Down Expand Up @@ -132,7 +129,6 @@ jobs:
--known-failure app/util/odd-sized-integers.h \
--known-failure app/util/util.cpp \
--known-failure app/util/util.h \
--known-failure app/WriteClient.h \
--known-failure app/WriteHandler.h \
--known-failure lib/core/CHIPVendorIdentifiers.hpp \
--known-failure platform/DeviceSafeQueue.cpp \
Expand Down
30 changes: 16 additions & 14 deletions src/app/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -140,23 +140,35 @@ static_library("interaction-model") {
"CASEClientPool.h",
"CASESessionManager.cpp",
"CASESessionManager.h",
"CommandSender.cpp",
"CommandSender.h",
"DeviceProxy.cpp",
"DeviceProxy.h",
"InteractionModelDelegatePointers.cpp",
"InteractionModelDelegatePointers.h",
"InteractionModelEngine.cpp",
"InteractionModelEngine.h",
"InteractionModelHelper.h",
"InteractionModelTimeout.h",
"OperationalSessionSetup.cpp",
"OperationalSessionSetup.h",
"OperationalSessionSetupPool.h",
"PendingResponseTracker.h",
"PendingResponseTrackerImpl.cpp",
"PendingResponseTrackerImpl.h",
"ReadClient.h", # TODO: cpp is only included conditionally. Needs logic
# fixing
"RequiredPrivilege.cpp",
"RequiredPrivilege.h",
"StatusResponse.cpp",
"StatusResponse.h",
"SubscriptionResumptionStorage.h",
"TimedHandler.cpp",
"TimedHandler.h",
"TimedRequest.cpp",
"TimedRequest.h",
"WriteClient.cpp",
"WriteClient.h",
"reporting/Engine.cpp",
"reporting/Engine.h",
"reporting/ReportScheduler.h",
Expand Down Expand Up @@ -184,6 +196,10 @@ static_library("interaction-model") {

public_configs = [ "${chip_root}/src:includes" ]

if (chip_enable_read_client) {
sources += [ "ReadClient.cpp" ]
}

if (chip_persist_subscriptions) {
sources += [
"SimpleSubscriptionResumptionStorage.cpp",
Expand Down Expand Up @@ -228,7 +244,6 @@ static_library("app") {
"CommandResponseHelper.h",
"CommandResponseSender.cpp",
"CommandResponseSender.h",
"CommandSender.cpp",
"DefaultAttributePersistenceProvider.cpp",
"DefaultAttributePersistenceProvider.h",
"DeferredAttributePersistenceProvider.cpp",
Expand All @@ -240,26 +255,17 @@ static_library("app") {
"FailSafeContext.cpp",
"FailSafeContext.h",
"OTAUserConsentCommon.h",
"PendingResponseTracker.h",
"PendingResponseTrackerImpl.cpp",
"PendingResponseTrackerImpl.h",
"ReadHandler.cpp",
"SafeAttributePersistenceProvider.h",
"TimedRequest.cpp",
"TimedRequest.h",
"TimerDelegates.cpp",
"TimerDelegates.h",
"WriteClient.cpp",
"WriteHandler.cpp",

# TODO: the following items cannot be included due to interaction-model circularity
# (app depending on im and im including these headers):
# Name with _ so that linter does not recognize it
# "CommandHandler._h"
# "CommandSender._h",
# "ReadClient._h",
# "ReadHandler._h",
# "WriteClient._h",
# "WriteHandler._h"

# TODO: the following items cannot be included due to platform includes not being
Expand Down Expand Up @@ -288,10 +294,6 @@ static_library("app") {
"BufferedReadCallback.h",
"ClusterStateCache.cpp",
"ClusterStateCache.h",
"ReadClient.cpp",

# TODO: cannot include "ReadClient._h" because interaction-model backreference
# Name with _ so that linter does not recognize it
]
}

Expand Down
8 changes: 1 addition & 7 deletions src/app/CommandSender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,9 @@
* limitations under the License.
*/

/**
* @file
* This file defines objects for a CHIP IM Invoke Command Sender
*
*/

#include "CommandSender.h"
#include "InteractionModelEngine.h"
#include "StatusResponse.h"
#include <app/InteractionModelTimeout.h>
#include <app/TimedRequest.h>
#include <platform/LockTracker.h>
#include <protocols/Protocols.h>
Expand Down

0 comments on commit 2570450

Please sign in to comment.