Skip to content

Commit

Permalink
Remove dependency between DataModel::Provider and CommandHandlerInter…
Browse files Browse the repository at this point in the history
…face (project-chip#37747)

This splits out the CHI to be separate from command handlers and
keep the command handler as a stand-alone item.
  • Loading branch information
andy31415 authored Feb 24, 2025
1 parent d09d176 commit d618ccb
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/app/AttributePathExpandIterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <lib/core/DataModelTypes.h>
#include <lib/support/LinkedList.h>
#include <lib/support/Span.h>
#include <messaging/ExchangeContext.h>

#include <limits>

Expand Down
19 changes: 18 additions & 1 deletion src/app/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -362,20 +362,37 @@ source_set("status-response") {
]
}

source_set("command-handler-interface") {
source_set("command-handler") {
sources = [
"CommandHandler.cpp",
"CommandHandler.h",
]

public_deps = [
":paths",
"${chip_root}/src/access:types",
"${chip_root}/src/app/data-model",
"${chip_root}/src/lib/core",
"${chip_root}/src/lib/support",
"${chip_root}/src/messaging",
"${chip_root}/src/protocols/interaction_model",
]
}

source_set("command-handler-interface") {
sources = [
"CommandHandlerExchangeInterface.h",
"CommandHandlerInterface.h",
"CommandHandlerInterfaceRegistry.cpp",
"CommandHandlerInterfaceRegistry.h",
]

public_deps = [
":command-handler",
":paths",
"${chip_root}/src/access:types",
"${chip_root}/src/app/data-model",
"${chip_root}/src/app/data-model-provider",
"${chip_root}/src/lib/core",
"${chip_root}/src/lib/support",
"${chip_root}/src/messaging",
Expand Down
3 changes: 2 additions & 1 deletion src/app/CommandHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@
*/
#pragma once

#include <app/CommandHandlerExchangeInterface.h>
#include <access/SubjectDescriptor.h>
#include <app/ConcreteCommandPath.h>
#include <app/data-model/EncodableToTLV.h>
#include <app/data-model/Encode.h>
#include <lib/core/CHIPCore.h>
#include <lib/support/CodeUtils.h>
#include <lib/support/IntrusiveList.h>
#include <lib/support/logging/CHIPLogging.h>
#include <messaging/ExchangeContext.h>
#include <protocols/interaction_model/StatusCode.h>

namespace chip {
Expand Down
2 changes: 2 additions & 0 deletions src/app/CommandHandlerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

#include <app/CommandHandler.h>

#include <app/CommandHandlerExchangeInterface.h>
#include <app/CommandHandlerInterface.h>
#include <app/CommandPathRegistry.h>
#include <app/MessageDef/InvokeRequestMessage.h>
#include <app/MessageDef/InvokeResponseMessage.h>
Expand Down
2 changes: 1 addition & 1 deletion src/app/data-model-provider/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ source_set("data-model-provider") {
public_deps = [
":metadata",
"${chip_root}/src/app:attribute-access",
"${chip_root}/src/app:command-handler-interface",
"${chip_root}/src/app:command-handler",
"${chip_root}/src/app:events",
"${chip_root}/src/app:paths",
"${chip_root}/src/app/MessageDef",
Expand Down

0 comments on commit d618ccb

Please sign in to comment.