Skip to content

Commit

Permalink
Revert "[app] Add option to disable Read Client (#28050)"
Browse files Browse the repository at this point in the history
This reverts commit a48afe0.
  • Loading branch information
woody-apple authored Jul 19, 2023
1 parent 60faf71 commit 0a6000b
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 23 deletions.
4 changes: 0 additions & 4 deletions config/esp32/components/chip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,6 @@ if(CONFIG_DISABLE_IPV4)
chip_gn_arg_append("chip_inet_config_enable_ipv4" "false")
endif()

if(CONFIG_DISABLE_READ_CLIENT)
chip_gn_arg_append("chip_enable_read_client" "false")
endif()

if(CHIP_CODEGEN_PREGEN_DIR)
chip_gn_arg_append("chip_code_pre_generated_directory" "\"${CHIP_CODEGEN_PREGEN_DIR}\"")
endif()
Expand Down
6 changes: 0 additions & 6 deletions config/esp32/components/chip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,6 @@ menu "CHIP Core"
help
Matter spec is based on IPv6 communication only. Enabling this option may save some flash/ram.

config DISABLE_READ_CLIENT
bool "Disable read client in Interaction Model"
default n
help
Some device types don't require the read client. Enabling this option may save some flash/ram.

config BUILD_CHIP_TESTS
bool "Build CHIP tests"
default n
Expand Down
3 changes: 0 additions & 3 deletions examples/lighting-app/esp32/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,3 @@ CONFIG_RMT_SUPPRESS_DEPRECATE_WARN=y

# Enable HKDF in mbedtls
CONFIG_MBEDTLS_HKDF_C=y

# Disable Read Client
CONFIG_DISABLE_READ_CLIENT=y
7 changes: 1 addition & 6 deletions src/app/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ declare_args() {
chip_im_force_fabric_quota_check = false

enable_eventlist_attribute = true
chip_enable_read_client = true
}

buildconfig_header("app_buildconfig") {
Expand All @@ -58,7 +57,6 @@ buildconfig_header("app_buildconfig") {
"CHIP_CONFIG_PERSIST_SUBSCRIPTIONS=${chip_persist_subscriptions}",
"CHIP_CONFIG_ENABLE_EVENTLIST_ATTRIBUTE=${enable_eventlist_attribute}",
"CHIP_CONFIG_ENABLE_ICD_SERVER=${chip_enable_icd_server}",
"CHIP_CONFIG_ENABLE_READ_CLIENT=${chip_enable_read_client}",
]
}

Expand Down Expand Up @@ -180,6 +178,7 @@ static_library("app") {
"OperationalSessionSetup.cpp",
"OperationalSessionSetup.h",
"OperationalSessionSetupPool.h",
"ReadClient.cpp",
"ReadHandler.cpp",
"RequiredPrivilege.cpp",
"RequiredPrivilege.h",
Expand Down Expand Up @@ -207,10 +206,6 @@ static_library("app") {
]
}

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

public_deps = [
":app_config",
"${chip_root}/src/access",
Expand Down
5 changes: 1 addition & 4 deletions src/app/InteractionModelEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -878,12 +878,10 @@ CHIP_ERROR InteractionModelEngine::OnMessageReceived(Messaging::ExchangeContext
status =
OnReadInitialRequest(apExchangeContext, aPayloadHeader, std::move(aPayload), ReadHandler::InteractionType::Subscribe);
}
#if CHIP_CONFIG_ENABLE_READ_CLIENT
else if (aPayloadHeader.HasMessageType(Protocols::InteractionModel::MsgType::ReportData))
{
status = OnUnsolicitedReportData(apExchangeContext, aPayloadHeader, std::move(aPayload));
}
#endif // CHIP_CONFIG_ENABLE_READ_CLIENT
else if (aPayloadHeader.HasMessageType(MsgType::TimedRequest))
{
OnTimedRequest(apExchangeContext, aPayloadHeader, std::move(aPayload), status);
Expand Down Expand Up @@ -1725,7 +1723,7 @@ void InteractionModelEngine::OnFabricRemoved(const FabricTable & fabricTable, Fa

return Loop::Continue;
});
#if CHIP_CONFIG_ENABLE_READ_CLIENT

for (auto * readClient = mpActiveReadClientList; readClient != nullptr; readClient = readClient->GetNextClient())
{
if (readClient->GetFabricIndex() == fabricIndex)
Expand All @@ -1734,7 +1732,6 @@ void InteractionModelEngine::OnFabricRemoved(const FabricTable & fabricTable, Fa
readClient->Close(CHIP_ERROR_IM_FABRIC_DELETED, false);
}
}
#endif // CHIP_CONFIG_ENABLE_READ_CLIENT

for (auto & handler : mWriteHandlers)
{
Expand Down

0 comments on commit 0a6000b

Please sign in to comment.