From 6395eae95583fe1ee526558bc35ae4536eff35f1 Mon Sep 17 00:00:00 2001 From: Rahul Tank Date: Tue, 16 Mar 2021 19:02:03 +0530 Subject: [PATCH] esp-idf: Added an option in menuconfig to configure maximum gatt services Currently Max GATT services count cannot be configured externally and hence user needs to modify code ,everytime the count is to be modified. Added an option in menuconfig to provide a way to user to set the count. Fixes: https://jira.espressif.com:8443/browse/BT-1508 --- components/bt/host/bluedroid/Kconfig.in | 11 ++++++++++- .../common/include/common/bluedroid_user_config.h | 8 ++++++++ .../host/bluedroid/common/include/common/bt_target.h | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/components/bt/host/bluedroid/Kconfig.in b/components/bt/host/bluedroid/Kconfig.in index 19b00cd335..522a3821b4 100644 --- a/components/bt/host/bluedroid/Kconfig.in +++ b/components/bt/host/bluedroid/Kconfig.in @@ -143,6 +143,16 @@ config BT_BLE_BLUFI_ENABLE help This option can be close when the app does not require blufi function. +config BT_GATT_SR_PROFILES + int "Max GATT Server Profiles" + depends on BT_GATTS_ENABLE && BT_BLUEDROID_ENABLED + range 1 32 + default 8 + help + Maximum GATT Server Profiles Count + + + choice BT_GATTS_SEND_SERVICE_CHANGE_MODE prompt "GATTS Service Change Mode" default BT_GATTS_SEND_SERVICE_CHANGE_AUTO @@ -945,7 +955,6 @@ menu "BT DEBUG LOG LEVEL" endmenu #BT DEBUG LOG LEVEL - config BT_ACL_CONNECTIONS int "BT/BLE MAX ACL CONNECTIONS(1~7)" depends on BT_BLUEDROID_ENABLED diff --git a/components/bt/host/bluedroid/common/include/common/bluedroid_user_config.h b/components/bt/host/bluedroid/common/include/common/bluedroid_user_config.h index 62d474fc6d..a286389fbc 100644 --- a/components/bt/host/bluedroid/common/include/common/bluedroid_user_config.h +++ b/components/bt/host/bluedroid/common/include/common/bluedroid_user_config.h @@ -224,6 +224,14 @@ #define UC_CONFIG_BT_GATTS_PPCP_CHAR_GAP FALSE #endif + +#ifdef CONFIG_BT_GATT_MAX_SR_PROFILES +#define UC_CONFIG_BT_GATT_MAX_SR_PROFILES CONFIG_BT_GATT_MAX_SR_PROFILES +#else +#define UC_CONFIG_BT_GATT_MAX_SR_PROFILES 8 +#endif + + #ifdef CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE #define UC_BT_GATTS_SEND_SERVICE_CHANGE_MODE CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE #else diff --git a/components/bt/host/bluedroid/common/include/common/bt_target.h b/components/bt/host/bluedroid/common/include/common/bt_target.h index 60b5c43ea9..d3b991a7f0 100644 --- a/components/bt/host/bluedroid/common/include/common/bt_target.h +++ b/components/bt/host/bluedroid/common/include/common/bt_target.h @@ -1224,7 +1224,7 @@ #endif #ifndef GATT_MAX_SR_PROFILES -#define GATT_MAX_SR_PROFILES 8 /* max is 32 */ +#define GATT_MAX_SR_PROFILES UC_CONFIG_BT_GATT_MAX_SR_PROFILES #endif #ifndef GATT_MAX_APPS