Revert "[app] Add option to disable Read Client (#28050)" (#28087)
This reverts commit a48afe0439b51f1309a5cb4ace36bb7b7b611bd2.
diff --git a/config/esp32/components/chip/CMakeLists.txt b/config/esp32/components/chip/CMakeLists.txt
index f8c6e83..d35791c 100644
--- a/config/esp32/components/chip/CMakeLists.txt
+++ b/config/esp32/components/chip/CMakeLists.txt
@@ -124,10 +124,6 @@
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()
diff --git a/config/esp32/components/chip/Kconfig b/config/esp32/components/chip/Kconfig
index 5c871c2..99de12a 100644
--- a/config/esp32/components/chip/Kconfig
+++ b/config/esp32/components/chip/Kconfig
@@ -108,12 +108,6 @@
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
diff --git a/examples/lighting-app/esp32/sdkconfig.defaults b/examples/lighting-app/esp32/sdkconfig.defaults
index f87a164..59c0af6 100644
--- a/examples/lighting-app/esp32/sdkconfig.defaults
+++ b/examples/lighting-app/esp32/sdkconfig.defaults
@@ -58,6 +58,3 @@
# Enable HKDF in mbedtls
CONFIG_MBEDTLS_HKDF_C=y
-
-# Disable Read Client
-CONFIG_DISABLE_READ_CLIENT=y
diff --git a/src/app/BUILD.gn b/src/app/BUILD.gn
index 2c8fa44..487c43e 100644
--- a/src/app/BUILD.gn
+++ b/src/app/BUILD.gn
@@ -43,7 +43,6 @@
chip_im_force_fabric_quota_check = false
enable_eventlist_attribute = true
- chip_enable_read_client = true
}
buildconfig_header("app_buildconfig") {
@@ -58,7 +57,6 @@
"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}",
]
}
@@ -180,6 +178,7 @@
"OperationalSessionSetup.cpp",
"OperationalSessionSetup.h",
"OperationalSessionSetupPool.h",
+ "ReadClient.cpp",
"ReadHandler.cpp",
"RequiredPrivilege.cpp",
"RequiredPrivilege.h",
@@ -207,10 +206,6 @@
]
}
- if (chip_enable_read_client) {
- sources += [ "ReadClient.cpp" ]
- }
-
public_deps = [
":app_config",
"${chip_root}/src/access",
diff --git a/src/app/InteractionModelEngine.cpp b/src/app/InteractionModelEngine.cpp
index 32d7a2c..6c32952 100644
--- a/src/app/InteractionModelEngine.cpp
+++ b/src/app/InteractionModelEngine.cpp
@@ -878,12 +878,10 @@
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);
@@ -1725,7 +1723,7 @@
return Loop::Continue;
});
-#if CHIP_CONFIG_ENABLE_READ_CLIENT
+
for (auto * readClient = mpActiveReadClientList; readClient != nullptr; readClient = readClient->GetNextClient())
{
if (readClient->GetFabricIndex() == fabricIndex)
@@ -1734,7 +1732,6 @@
readClient->Close(CHIP_ERROR_IM_FABRIC_DELETED, false);
}
}
-#endif // CHIP_CONFIG_ENABLE_READ_CLIENT
for (auto & handler : mWriteHandlers)
{