From 6c6540807271958ada2cd77ccca227adbce6e9b7 Mon Sep 17 00:00:00 2001 From: Astha Verma Date: Tue, 14 Oct 2025 17:53:14 +0530 Subject: [PATCH] fix(nimble): Support for concatenation of same type UUID during adv data parsing --- components/bt/host/nimble/Kconfig.in | 9 +++++++++ components/bt/host/nimble/port/include/esp_nimble_cfg.h | 6 ++++++ components/esp_hid/src/nimble_hidh.c | 1 + 3 files changed, 16 insertions(+) diff --git a/components/bt/host/nimble/Kconfig.in b/components/bt/host/nimble/Kconfig.in index f084f4b8d4..6c0ef3238c 100644 --- a/components/bt/host/nimble/Kconfig.in +++ b/components/bt/host/nimble/Kconfig.in @@ -1217,6 +1217,15 @@ menu "Extra Features" help This option is used to enable encrypted advertising data. + config BT_NIMBLE_ADV_UUID_CONCAT + bool "concatenate uuids while parsing advertising data" + default n + depends on BT_NIMBLE_ENABLED + help + Enables concatenation of multiple UUIDs of the same type while parsing + advertising data on the central device. When disabled, only the last + parsed UUID of a given type is retained. + config BT_NIMBLE_MAX_EADS int "Maximum number of EAD devices to save across reboots" default 10 diff --git a/components/bt/host/nimble/port/include/esp_nimble_cfg.h b/components/bt/host/nimble/port/include/esp_nimble_cfg.h index cfbf49cfe8..494c358a22 100644 --- a/components/bt/host/nimble/port/include/esp_nimble_cfg.h +++ b/components/bt/host/nimble/port/include/esp_nimble_cfg.h @@ -118,6 +118,12 @@ #define MYNEWT_VAL_ENC_ADV_DATA (CONFIG_BT_NIMBLE_ENC_ADV_DATA) #endif +#ifndef CONFIG_BT_NIMBLE_ADV_UUID_CONCAT +#define MYNEWT_VAL_BLE_ADV_UUID_CONCAT (0) +#else +#define MYNEWT_VAL_BLE_ADV_UUID_CONCAT (CONFIG_BT_NIMBLE_ADV_UUID_CONCAT) +#endif + #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) #define BLE_SCAN_RSP_DATA_MAX_LEN_N (1650) #else diff --git a/components/esp_hid/src/nimble_hidh.c b/components/esp_hid/src/nimble_hidh.c index 22b08cbc37..bfbed8eca2 100644 --- a/components/esp_hid/src/nimble_hidh.c +++ b/components/esp_hid/src/nimble_hidh.c @@ -957,6 +957,7 @@ esp_hidh_dev_t *esp_ble_hidh_dev_open(uint8_t *bda, uint8_t address_type) dev->report_write = esp_ble_hidh_dev_report_write; dev->report_read = esp_ble_hidh_dev_report_read; dev->dump = esp_ble_hidh_dev_dump; + dev->connected = true; /* perform service discovery and fill the report maps */ read_device_services(dev);