From 65474b7fba554d25179d48affacbf1f3c17564c6 Mon Sep 17 00:00:00 2001 From: Astha Verma Date: Wed, 18 Mar 2026 11:44:26 +0530 Subject: [PATCH] fix(nimble): fix missing gatt caching header in examples --- components/bt/host/nimble/nimble | 2 +- examples/bluetooth/nimble/ble_cts/cts_cent/main/main.c | 3 +++ examples/bluetooth/nimble/ble_htp/htp_cent/main/main.c | 3 +++ .../ble_proximity_sensor/proximity_sensor_cent/main/main.c | 6 +++++- .../ble_proximity_sensor/proximity_sensor_prph/main/main.c | 4 ++++ 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/components/bt/host/nimble/nimble b/components/bt/host/nimble/nimble index 6e5bdd8af51..66c4a28aeac 160000 --- a/components/bt/host/nimble/nimble +++ b/components/bt/host/nimble/nimble @@ -1 +1 @@ -Subproject commit 6e5bdd8af51978782e144dcdfac3fa428310026a +Subproject commit 66c4a28aeacd137e042c2a2b1493c7b3d6ce39a4 diff --git a/examples/bluetooth/nimble/ble_cts/cts_cent/main/main.c b/examples/bluetooth/nimble/ble_cts/cts_cent/main/main.c index d8c5840ec8d..bd765009ea2 100644 --- a/examples/bluetooth/nimble/ble_cts/cts_cent/main/main.c +++ b/examples/bluetooth/nimble/ble_cts/cts_cent/main/main.c @@ -15,6 +15,9 @@ #include "services/gap/ble_svc_gap.h" #include "ble_cts_cent.h" #include "services/cts/ble_svc_cts.h" +#if MYNEWT_VAL(BLE_GATT_CACHING) +#include "host/ble_esp_gattc_cache.h" +#endif static const char *tag = "NimBLE_CTS_CENT"; static int ble_cts_cent_gap_event(struct ble_gap_event *event, void *arg); diff --git a/examples/bluetooth/nimble/ble_htp/htp_cent/main/main.c b/examples/bluetooth/nimble/ble_htp/htp_cent/main/main.c index bc2668d5304..fdc49361be5 100644 --- a/examples/bluetooth/nimble/ble_htp/htp_cent/main/main.c +++ b/examples/bluetooth/nimble/ble_htp/htp_cent/main/main.c @@ -14,6 +14,9 @@ #include "console/console.h" #include "services/gap/ble_svc_gap.h" #include "ble_htp_cent.h" +#if MYNEWT_VAL(BLE_GATT_CACHING) +#include "host/ble_esp_gattc_cache.h" +#endif static const char *tag = "NimBLE_HTP_CENT"; static int ble_htp_cent_gap_event(struct ble_gap_event *event, void *arg); diff --git a/examples/bluetooth/nimble/ble_proximity_sensor/proximity_sensor_cent/main/main.c b/examples/bluetooth/nimble/ble_proximity_sensor/proximity_sensor_cent/main/main.c index 4b4bf0d0583..e7029e278d4 100644 --- a/examples/bluetooth/nimble/ble_proximity_sensor/proximity_sensor_cent/main/main.c +++ b/examples/bluetooth/nimble/ble_proximity_sensor/proximity_sensor_cent/main/main.c @@ -14,6 +14,9 @@ #include "console/console.h" #include "services/gap/ble_svc_gap.h" #include "ble_prox_cent.h" +#if MYNEWT_VAL(BLE_GATT_CACHING) +#include "host/ble_esp_gattc_cache.h" +#endif static const char *tag = "NimBLE_PROX_CENT"; static uint8_t link_supervision_timeout; @@ -499,8 +502,9 @@ ble_prox_cent_gap_event(struct ble_gap_event *event, void *arg) /* Connection attempt failed; resume scanning. */ MODLOG_DFLT(ERROR, "Error: Connection failed; status=%d\n", event->connect.status); + + ble_prox_cent_scan(); } - ble_prox_cent_scan(); return 0; case BLE_GAP_EVENT_DISCONNECT: diff --git a/examples/bluetooth/nimble/ble_proximity_sensor/proximity_sensor_prph/main/main.c b/examples/bluetooth/nimble/ble_proximity_sensor/proximity_sensor_prph/main/main.c index 95e5c7d110a..5c6dbf1b150 100644 --- a/examples/bluetooth/nimble/ble_proximity_sensor/proximity_sensor_prph/main/main.c +++ b/examples/bluetooth/nimble/ble_proximity_sensor/proximity_sensor_prph/main/main.c @@ -14,6 +14,7 @@ #include "host/util/util.h" #include "console/console.h" #include "services/gap/ble_svc_gap.h" +#include "services/gatt/ble_svc_gatt.h" #include "ble_prox_prph.h" #if CONFIG_EXAMPLE_EXTENDED_ADV @@ -300,6 +301,9 @@ void app_main(void) ble_hs_cfg.sm_sc = 1; ble_hs_cfg.sm_mitm = 1; + ble_svc_gap_init(); + ble_svc_gatt_init(); + int rc; /* Set the default device name */ rc = ble_svc_gap_device_name_set(device_name);