From 0a6000b27243500b6a756603a3e58b2b2b7f8dcf Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Wed, 19 Jul 2023 12:18:22 -0700 Subject: [PATCH] Revert "[app] Add option to disable Read Client (#28050)" This reverts commit a48afe0439b51f1309a5cb4ace36bb7b7b611bd2. --- config/esp32/components/chip/CMakeLists.txt | 4 ---- config/esp32/components/chip/Kconfig | 6 ------ examples/lighting-app/esp32/sdkconfig.defaults | 3 --- src/app/BUILD.gn | 7 +------ src/app/InteractionModelEngine.cpp | 5 +---- 5 files changed, 2 insertions(+), 23 deletions(-) diff --git a/config/esp32/components/chip/CMakeLists.txt b/config/esp32/components/chip/CMakeLists.txt index f8c6e839bffbb5..d35791cf1ed3c0 100644 --- a/config/esp32/components/chip/CMakeLists.txt +++ b/config/esp32/components/chip/CMakeLists.txt @@ -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() diff --git a/config/esp32/components/chip/Kconfig b/config/esp32/components/chip/Kconfig index 5c871c2d043a30..99de12afa97e6e 100644 --- a/config/esp32/components/chip/Kconfig +++ b/config/esp32/components/chip/Kconfig @@ -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 diff --git a/examples/lighting-app/esp32/sdkconfig.defaults b/examples/lighting-app/esp32/sdkconfig.defaults index f87a164ae41dd2..59c0af656896f0 100644 --- a/examples/lighting-app/esp32/sdkconfig.defaults +++ b/examples/lighting-app/esp32/sdkconfig.defaults @@ -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 diff --git a/src/app/BUILD.gn b/src/app/BUILD.gn index 2c8fa4453f3688..487c43e3182a5b 100644 --- a/src/app/BUILD.gn +++ b/src/app/BUILD.gn @@ -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") { @@ -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}", ] } @@ -180,6 +178,7 @@ static_library("app") { "OperationalSessionSetup.cpp", "OperationalSessionSetup.h", "OperationalSessionSetupPool.h", + "ReadClient.cpp", "ReadHandler.cpp", "RequiredPrivilege.cpp", "RequiredPrivilege.h", @@ -207,10 +206,6 @@ static_library("app") { ] } - 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 32d7a2c721a8e7..6c32952135c902 100644 --- a/src/app/InteractionModelEngine.cpp +++ b/src/app/InteractionModelEngine.cpp @@ -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); @@ -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) @@ -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) {