From c38b21c47da331b81b601ac3eedebd583a7a56eb Mon Sep 17 00:00:00 2001 From: WanqQixiang Date: Fri, 8 Dec 2023 15:50:49 +0800 Subject: [PATCH 1/2] ESP32: Add a menuconfig option to enable/disable persist subscription --- config/esp32/components/chip/CMakeLists.txt | 6 ++++++ config/esp32/components/chip/Kconfig | 7 +++++++ src/platform/device.gni | 4 ++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/config/esp32/components/chip/CMakeLists.txt b/config/esp32/components/chip/CMakeLists.txt index 0ce9cb54933bed..026a17bee075b8 100644 --- a/config/esp32/components/chip/CMakeLists.txt +++ b/config/esp32/components/chip/CMakeLists.txt @@ -185,6 +185,12 @@ if ((CONFIG_BT_ENABLED) AND (CONFIG_ENABLE_CHIPOBLE)) endif() endif() +if (CONFIG_ENABLE_PERSIST_SUBSCRIPTIONS) + chip_gn_arg_append("chip_persist_subscriptions" "true") +else() + chip_gn_arg_append("chip_persist_subscriptions" "false") +endif() + if (CONFIG_ENABLE_ESP32_BLE_CONTROLLER) chip_gn_arg_append("chip_enable_ble_controller" "true") endif() diff --git a/config/esp32/components/chip/Kconfig b/config/esp32/components/chip/Kconfig index ec2ab1a6b26d64..b398b77dee3505 100644 --- a/config/esp32/components/chip/Kconfig +++ b/config/esp32/components/chip/Kconfig @@ -130,6 +130,13 @@ menu "CHIP Core" help Some device types don't require the read client. Enabling this option may save some flash/ram. + config ENABLE_PERSIST_SUBSCRIPTIONS + bool "Enable persist subscriptions" + default n + help + Enable persist subscriptions to make the device resume the subscriptions from the persist + subscriptions information after reboot. + config BUILD_CHIP_TESTS bool "Build CHIP tests" default n diff --git a/src/platform/device.gni b/src/platform/device.gni index 9afb252ca0b809..dfeec5d73c982d 100644 --- a/src/platform/device.gni +++ b/src/platform/device.gni @@ -108,8 +108,8 @@ declare_args() { # Enable Subscription persistence / resumption for CI and supported platforms if (chip_device_platform == "darwin" || chip_device_platform == "linux" || - chip_device_platform == "esp32" || chip_device_platform == "fake" || - chip_device_platform == "efr32" || chip_device_platform == "SiWx917") { + chip_device_platform == "fake" || chip_device_platform == "efr32" || + chip_device_platform == "SiWx917") { chip_persist_subscriptions = true } else { chip_persist_subscriptions = false From bedcaa23463703809776b4332f069c06f370a170 Mon Sep 17 00:00:00 2001 From: WanqQixiang Date: Tue, 12 Dec 2023 10:40:02 +0800 Subject: [PATCH 2/2] enable persistent subscription by default --- config/esp32/components/chip/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/esp32/components/chip/Kconfig b/config/esp32/components/chip/Kconfig index b398b77dee3505..3fa59077f73ece 100644 --- a/config/esp32/components/chip/Kconfig +++ b/config/esp32/components/chip/Kconfig @@ -132,7 +132,7 @@ menu "CHIP Core" config ENABLE_PERSIST_SUBSCRIPTIONS bool "Enable persist subscriptions" - default n + default y help Enable persist subscriptions to make the device resume the subscriptions from the persist subscriptions information after reboot.