fix(nimble): Migrate to NimBLE 1.9.0

This commit is contained in:
Rahul Tank
2026-07-27 14:14:35 +05:30
parent eaa88e26dc
commit e08609e451
37 changed files with 484 additions and 65 deletions
@@ -54,7 +54,9 @@ static void print_conn_desc(struct ble_gap_conn_desc *desc) {
static void start_advertising(void) {
/* Local variables */
int rc = 0;
#if CONFIG_BT_NIMBLE_GAP_SERVICE
const char *name;
#endif
struct ble_hs_adv_fields adv_fields = {0};
struct ble_hs_adv_fields rsp_fields = {0};
struct ble_gap_adv_params adv_params = {0};
@@ -62,6 +64,7 @@ static void start_advertising(void) {
/* Set advertising flags */
adv_fields.flags = BLE_HS_ADV_F_DISC_GEN | BLE_HS_ADV_F_BREDR_UNSUP;
#if CONFIG_BT_NIMBLE_GAP_SERVICE
/* Set device name */
name = ble_svc_gap_device_name();
if (name == NULL) {
@@ -70,6 +73,7 @@ static void start_advertising(void) {
adv_fields.name = (uint8_t *)name;
adv_fields.name_len = strlen(name);
adv_fields.name_is_complete = 1;
#endif
/* Set device tx power */
adv_fields.tx_pwr_lvl = BLE_HS_ADV_TX_PWR_LVL_AUTO;
@@ -257,7 +261,7 @@ int gap_init(void) {
/* Local variables */
int rc = 0;
#if CONFIG_BT_NIMBLE_GAP_SERVICE
/* Initialize GAP service */
ble_svc_gap_init();
@@ -275,5 +279,6 @@ int gap_init(void) {
ESP_LOGE(TAG, "failed to set device appearance, error code: %d", rc);
return rc;
}
#endif
return rc;
}