From 6a0a0569b1d8c90e737348b6190f26764e494e9d Mon Sep 17 00:00:00 2001 From: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com> Date: Mon, 26 Feb 2024 08:53:11 -0500 Subject: [PATCH] Adjust the default discovery timeout when BLE extend announcement is enabled. (#32300) * add build arg to enable BLE extended advertisement feature * Set a increased based value for the Discovery timeout when BLE extended advertising is set --- src/include/platform/CHIPDeviceConfig.h | 13 ++++++++++++- src/platform/silabs/CHIPDevicePlatformConfig.h | 2 ++ third_party/silabs/efr32_sdk.gni | 4 ++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/include/platform/CHIPDeviceConfig.h b/src/include/platform/CHIPDeviceConfig.h index 88ef78d1005314..9d1f7804da63b4 100644 --- a/src/include/platform/CHIPDeviceConfig.h +++ b/src/include/platform/CHIPDeviceConfig.h @@ -713,8 +713,19 @@ static_assert(CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MIN <= CHIP_DEVICE * Time in seconds that a factory new device will advertise commissionable node discovery. */ #ifndef CHIP_DEVICE_CONFIG_DISCOVERY_TIMEOUT_SECS +#if CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING +/** + * By default, the extended announcement, when enabled, starts its extended advertising 15 mins + * after the standard slow advertisement. Time at which the default discovery time would close the + * commissioning window and stop the BLE. + * Therefore, when CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING is enabled bump the default Discovery timeout + * to the maximum allowed by the spec. 48h. + */ +#define CHIP_DEVICE_CONFIG_DISCOVERY_TIMEOUT_SECS (60 * 60 * 48) +#else #define CHIP_DEVICE_CONFIG_DISCOVERY_TIMEOUT_SECS (15 * 60) -#endif +#endif // CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING +#endif // CHIP_DEVICE_CONFIG_DISCOVERY_TIMEOUT_SECS /** * CHIP_DEVICE_CONFIG_MAX_DISCOVERED_NODES diff --git a/src/platform/silabs/CHIPDevicePlatformConfig.h b/src/platform/silabs/CHIPDevicePlatformConfig.h index fa3a50974f6a50..e8601e5feedaf9 100644 --- a/src/platform/silabs/CHIPDevicePlatformConfig.h +++ b/src/platform/silabs/CHIPDevicePlatformConfig.h @@ -140,6 +140,8 @@ #define CHIP_DEVICE_CONFIG_MAX_EVENT_QUEUE_SIZE 25 +#define CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING SL_MATTER_BLE_EXTENDED_ADV + /* ICD Configuration Defines */ diff --git a/third_party/silabs/efr32_sdk.gni b/third_party/silabs/efr32_sdk.gni index 8510295bf7c2e0..55934ae5128b0f 100644 --- a/third_party/silabs/efr32_sdk.gni +++ b/third_party/silabs/efr32_sdk.gni @@ -46,6 +46,9 @@ declare_args() { # Enable Segger System View use_system_view = false + # Enable the BLE extended advertisement + sl_matter_ble_extended_adv = false + # ICD Openthread Configuration flags sl_ot_idle_interval_ms = 15000 # 15s Idle Intervals sl_ot_active_interval_ms = 200 # 200ms Active Intervals @@ -297,6 +300,7 @@ template("efr32_sdk") { "SL_RAIL_LIB_MULTIPROTOCOL_SUPPORT=1", "SL_RAIL_UTIL_PA_CONFIG_HEADER=", "RADIO_CONFIG_DMP_SUPPORT=1", + "SL_MATTER_BLE_EXTENDED_ADV=${sl_matter_ble_extended_adv}", #"__STACK_SIZE=0", ]