From 3c88ae2745887f2c7049665b69eb7e06194331a8 Mon Sep 17 00:00:00 2001 From: Astha Verma Date: Wed, 12 Aug 2026 16:24:29 +0530 Subject: [PATCH] fix(nimble): Fix build when gatt client disabled --- nimble/host/src/ble_gattc_cache_conn.c | 2 +- nimble/host/src/ble_gatts.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/nimble/host/src/ble_gattc_cache_conn.c b/nimble/host/src/ble_gattc_cache_conn.c index 3aa4d61a3..8699306cd 100644 --- a/nimble/host/src/ble_gattc_cache_conn.c +++ b/nimble/host/src/ble_gattc_cache_conn.c @@ -2336,7 +2336,6 @@ ble_gattc_cache_conn_update(uint16_t conn_handle, uint16_t start_handle, uint16_ peer->cache_state = CACHE_INVALID; } } -#endif int ble_gattc_cache_refresh(ble_addr_t peer_addr) { @@ -2496,6 +2495,7 @@ int ble_gattc_cache_clean(ble_addr_t peer_addr) return 0; } +#endif uint16_t ble_gattc_cache_conn_get_svc_changed_handle(uint16_t conn_handle) diff --git a/nimble/host/src/ble_gatts.c b/nimble/host/src/ble_gatts.c index bc66ae6a7..633acead0 100644 --- a/nimble/host/src/ble_gatts.c +++ b/nimble/host/src/ble_gatts.c @@ -2125,6 +2125,7 @@ ble_gatts_start(void) #if MYNEWT_VAL(BLE_GATT_CACHING) #if MYNEWT_VAL(BLE_STATIC_TO_DYNAMIC) +#if MYNEWT_VAL(BLE_STORE_MAX_BONDS) if (ble_gatts_conn_aware_states == NULL) { ble_gatts_conn_aware_states = nimble_platform_mem_calloc(1, sizeof(struct ble_gatts_aware_state) * MYNEWT_VAL(BLE_STORE_MAX_BONDS)); if (ble_gatts_conn_aware_states == NULL) { @@ -2132,6 +2133,7 @@ ble_gatts_start(void) goto done; } } +#endif #else memset(ble_gatts_conn_aware_states, 0, sizeof ble_gatts_conn_aware_states); #endif @@ -2288,6 +2290,7 @@ ble_gatts_conn_can_alloc(void) #endif return ble_gatts_num_cfgable_chrs == 0 || + ble_gatts_clt_cfg_pool.mp_num_blocks == 0 || ble_gatts_clt_cfg_pool.mp_num_free > 0; }