fix(nimble): Added api's for fetching gatt cache info and discover included service

This commit is contained in:
Astha Verma
2025-05-27 11:03:20 +05:30
committed by Rahul Tank
parent 606ba21345
commit 6e4a2619ee
5 changed files with 302 additions and 3 deletions
+19
View File
@@ -707,6 +707,19 @@ menuconfig BT_NIMBLE_GATT_CACHING
select BT_NIMBLE_DYNAMIC_SERVICE
help
Enable GATT caching
config BT_NIMBLE_GATT_CACHING_INCLUDE_SERVICES
bool "Include services in GATT caching"
depends on BT_NIMBLE_GATT_CACHING
default n
help
Enable this option to include *included services* (e.g., services referenced by other services)
in the GATT database cache. Disabling this will skip caching of included service entries.
config BT_NIMBLE_INCL_SVC_DISCOVERY
bool "Enable Included service discovery"
default y if BT_NIMBLE_GATT_CACHING_INCLUDE_SERVICES
default n
help
Enable this option to start discovery for included service.
config BT_NIMBLE_GATT_CACHING_MAX_CONNS
int "Maximum connections to be cached"
depends on BT_NIMBLE_GATT_CACHING
@@ -719,6 +732,12 @@ config BT_NIMBLE_GATT_CACHING_MAX_SVCS
default 64
help
Set this option to set the upper limit on number of services per connection to be cached.
config BT_NIMBLE_GATT_CACHING_MAX_INCL_SVCS
int "Maximum number of included services per connection"
depends on BT_NIMBLE_GATT_CACHING
default 64
help
Set this option to set the upper limit on number of included services per connection to be cached.
config BT_NIMBLE_GATT_CACHING_MAX_CHRS
int "Maximum number of characteristics per connection"
depends on BT_NIMBLE_GATT_CACHING
@@ -129,11 +129,27 @@
#define MYNEWT_VAL_BLE_MAX_PERIODIC_ADVERTISER_LIST (CONFIG_BT_NIMBLE_MAX_PERIODIC_ADVERTISER_LIST)
#endif
#ifndef MYNEWT_VAL_BLE_INCL_SVC_DISCOVERY
#ifdef CONFIG_BT_NIMBLE_INCL_SVC_DISCOVERY
#define MYNEWT_VAL_BLE_INCL_SVC_DISCOVERY (CONFIG_BT_NIMBLE_INCL_SVC_DISCOVERY)
#else
#define MYNEWT_VAL_BLE_INCL_SVC_DISCOVERY (0)
#endif
#endif
#ifndef CONFIG_BT_NIMBLE_GATT_CACHING
#define MYNEWT_VAL_BLE_GATT_CACHING (0)
#else
#define MYNEWT_VAL_BLE_GATT_CACHING (CONFIG_BT_NIMBLE_GATT_CACHING)
#ifndef MYNEWT_VAL_BLE_GATT_CACHING_INCLUDE_SERVICES
#ifdef CONFIG_BT_NIMBLE_GATT_CACHING_INCLUDE_SERVICES
#define MYNEWT_VAL_BLE_GATT_CACHING_INCLUDE_SERVICES (CONFIG_BT_NIMBLE_GATT_CACHING_INCLUDE_SERVICES)
#else
#define MYNEWT_VAL_BLE_GATT_CACHING_INCLUDE_SERVICES (0)
#endif
#endif
#ifdef CONFIG_BT_NIMBLE_GATT_CACHING_MAX_CONNS
#define MYNEWT_VAL_BLE_GATT_CACHING_MAX_CONNS (CONFIG_BT_NIMBLE_GATT_CACHING_MAX_CONNS)
#else
@@ -146,6 +162,14 @@
#define MYNEWT_VAL_BLE_GATT_CACHING_MAX_SVCS (0)
#endif
#ifndef MYNEWT_VAL_BLE_GATT_CACHING_MAX_INCL_SVCS
#ifdef CONFIG_BT_NIMBLE_GATT_CACHING_MAX_INCL_SVCS
#define MYNEWT_VAL_BLE_GATT_CACHING_MAX_INCL_SVCS (CONFIG_BT_NIMBLE_GATT_CACHING_MAX_INCL_SVCS)
#else
#define MYNEWT_VAL_BLE_GATT_CACHING_MAX_INCL_SVCS (0)
#endif
#endif
#ifdef CONFIG_BT_NIMBLE_GATT_CACHING_MAX_CHRS
#define MYNEWT_VAL_BLE_GATT_CACHING_MAX_CHRS (CONFIG_BT_NIMBLE_GATT_CACHING_MAX_CHRS)
#else