From 1415406ea5046fd02bd93a08333bd4ce8afef1ca Mon Sep 17 00:00:00 2001 From: Sweety Date: Thu, 21 Oct 2021 01:49:29 +0530 Subject: [PATCH] ESP32: Enable extended advertising feature. (#10523) --- config/esp32/components/chip/Kconfig | 18 ++++++++++++++++++ src/include/platform/ConfigurationManager.h | 2 +- .../GenericConfigurationManagerImpl.cpp | 6 +++++- src/platform/ESP32/CHIPDevicePlatformConfig.h | 3 +++ 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/config/esp32/components/chip/Kconfig b/config/esp32/components/chip/Kconfig index 77f7cd34cb7caa..10d4e9e219664e 100644 --- a/config/esp32/components/chip/Kconfig +++ b/config/esp32/components/chip/Kconfig @@ -367,6 +367,18 @@ menu "CHIP Device Layer" help The size (in bytes) of the service directory cache. This limits the maximum size of the directory that can be returned in response to a service directory query. + + config ENABLE_EXTENDED_DISCOVERY + bool "Enable Extended discovery Support" + default n + help + Enables support for Extended Discovery. + + config ENABLE_COMMISSIONABLE_DEVICE_TYPE + bool "Enable Device type in commissionable node discovery." + default n + help + Enables or Disables the support for Commissionable Device Type. endmenu @@ -409,6 +421,12 @@ menu "CHIP Device Layer" help A string identifying the firmware revision running on the device. + config DEVICE_TYPE + int "Default Device type" + default 0 + help + The default device type. + endmenu menu "WiFi Station Options" diff --git a/src/include/platform/ConfigurationManager.h b/src/include/platform/ConfigurationManager.h index 4f3e846ae3a34f..647e66bfd0e4a4 100644 --- a/src/include/platform/ConfigurationManager.h +++ b/src/include/platform/ConfigurationManager.h @@ -415,7 +415,7 @@ inline void ConfigurationManager::LogDeviceConfig() */ inline bool ConfigurationManager::IsCommissionableDeviceTypeEnabled() { - return static_cast(this)->_IsCommissionableDeviceNameEnabled(); + return static_cast(this)->_IsCommissionableDeviceTypeEnabled(); } /** diff --git a/src/include/platform/internal/GenericConfigurationManagerImpl.cpp b/src/include/platform/internal/GenericConfigurationManagerImpl.cpp index 719b8b951635e5..9759591431a51a 100644 --- a/src/include/platform/internal/GenericConfigurationManagerImpl.cpp +++ b/src/include/platform/internal/GenericConfigurationManagerImpl.cpp @@ -403,7 +403,11 @@ bool GenericConfigurationManagerImpl::_IsFullyProvisioned() template bool GenericConfigurationManagerImpl::_IsCommissionableDeviceTypeEnabled() { - return CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_TYPE == 1; +#if CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_TYPE + return true; +#else + return false; +#endif } template diff --git a/src/platform/ESP32/CHIPDevicePlatformConfig.h b/src/platform/ESP32/CHIPDevicePlatformConfig.h index d60770091449fb..cfd4b321ad3fb2 100644 --- a/src/platform/ESP32/CHIPDevicePlatformConfig.h +++ b/src/platform/ESP32/CHIPDevicePlatformConfig.h @@ -39,6 +39,7 @@ #define CHIP_DEVICE_CONFIG_MAX_EVENT_QUEUE_SIZE CONFIG_MAX_EVENT_QUEUE_SIZE #define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID CONFIG_DEVICE_VENDOR_ID #define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID CONFIG_DEVICE_PRODUCT_ID +#define CHIP_DEVICE_CONFIG_DEVICE_TYPE CONFIG_DEVICE_TYPE #define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_PRODUCT_REVISION CONFIG_DEFAULT_DEVICE_PRODUCT_REVISION #define CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING CONFIG_DEVICE_FIRMWARE_REVISION @@ -62,6 +63,8 @@ #endif // CONFIG_IDF_TARGET_ESP32H2 #define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE CONFIG_ENABLE_CHIPOBLE +#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY CONFIG_ENABLE_EXTENDED_DISCOVERY +#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_TYPE CONFIG_ENABLE_COMMISSIONABLE_DEVICE_TYPE #define CHIP_DEVICE_CONFIG_BLE_DEVICE_NAME_PREFIX CONFIG_BLE_DEVICE_NAME_PREFIX #define CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_INTERVAL_MIN CONFIG_BLE_FAST_ADVERTISING_INTERVAL_MIN #define CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_INTERVAL_MAX CONFIG_BLE_FAST_ADVERTISING_INTERVAL_MAX