From 5417940f00fbfb4b5261390d128ae7b2ba36007c Mon Sep 17 00:00:00 2001 From: Hideaki Tai Date: Wed, 15 Nov 2023 17:19:42 +0900 Subject: [PATCH] feat: configurable ble advertising autostart for esp32 (#30482) --- config/esp32/components/chip/Kconfig | 10 ++++++++++ src/platform/ESP32/CHIPDevicePlatformConfig.h | 1 + 2 files changed, 11 insertions(+) diff --git a/config/esp32/components/chip/Kconfig b/config/esp32/components/chip/Kconfig index 43a766b7dbf8dd..b73398bca4c2bf 100644 --- a/config/esp32/components/chip/Kconfig +++ b/config/esp32/components/chip/Kconfig @@ -640,6 +640,16 @@ menu "CHIP Device Layer" When set, WoBLE advertisements will stop while a WoBLE connection is active. + config CHIPOBLE_ENABLE_ADVERTISING_AUTOSTART + int "Enable CHIPoBLE advertising start automatically after device power-up" + range 0 1 + default 0 + depends on ENABLE_CHIPOBLE + help + CHIPs device may start advertising automatically only if its all primary device + functions are within a CHIP network. Device providing unrelated to CHIP functionalities + should not start advertising automatically after power-up. + config USE_BLE_ONLY_FOR_COMMISSIONING bool "Use BLE only for commissioning" default y diff --git a/src/platform/ESP32/CHIPDevicePlatformConfig.h b/src/platform/ESP32/CHIPDevicePlatformConfig.h index ba583b64c8fa0b..0c4f036f5177a4 100644 --- a/src/platform/ESP32/CHIPDevicePlatformConfig.h +++ b/src/platform/ESP32/CHIPDevicePlatformConfig.h @@ -87,6 +87,7 @@ #define CHIP_DEVICE_CONFIG_BLE_SLOW_ADVERTISING_INTERVAL_MIN CONFIG_BLE_SLOW_ADVERTISING_INTERVAL_MIN #define CHIP_DEVICE_CONFIG_BLE_SLOW_ADVERTISING_INTERVAL_MAX CONFIG_BLE_SLOW_ADVERTISING_INTERVAL_MAX #define CHIP_DEVICE_CONFIG_CHIPOBLE_SINGLE_CONNECTION CONFIG_CHIPOBLE_SINGLE_CONNECTION +#define CHIP_DEVICE_CONFIG_CHIPOBLE_ENABLE_ADVERTISING_AUTOSTART CONFIG_CHIPOBLE_ENABLE_ADVERTISING_AUTOSTART #define CHIP_DEVICE_CONFIG_SERVICE_PROVISIONING_ENDPOINT_ID CONFIG_SERVICE_PROVISIONING_ENDPOINT_ID #define CHIP_DEVICE_CONFIG_SERVICE_PROVISIONING_CONNECTIVITY_TIMEOUT CONFIG_SERVICE_PROVISIONING_CONNECTIVITY_TIMEOUT #define CHIP_DEVICE_CONFIG_SERVICE_PROVISIONING_REQUEST_TIMEOUT CONFIG_SERVICE_PROVISIONING_REQUEST_TIMEOUT