diff --git a/components/bt/host/bluedroid/Kconfig.in b/components/bt/host/bluedroid/Kconfig.in index 05f1c1a241..46e619041f 100644 --- a/components/bt/host/bluedroid/Kconfig.in +++ b/components/bt/host/bluedroid/Kconfig.in @@ -173,6 +173,13 @@ config BT_GATT_MAX_SR_PROFILES help Maximum GATT Server Profiles Count +config BT_GATT_MAX_SR_ATTRIBUTES + int "Max GATT Service Attributes" + depends on BT_GATTS_ENABLE && BT_BLUEDROID_ENABLED + range 1 500 + default 100 + help + Maximum GATT Service Attributes Count choice BT_GATTS_SEND_SERVICE_CHANGE_MODE @@ -208,6 +215,14 @@ config BT_GATTC_ENABLE help This option can be close when the app work only on gatt server mode +config BT_GATTC_MAX_CACHE_CHAR + int "Max gattc cache characteristic for discover" + depends on BT_GATTC_ENABLE + range 1 500 + default 40 + help + Maximum GATTC cache characteristic count + config BT_GATTC_CACHE_NVS_FLASH bool "Save gattc cache data to nvs flash" depends on BT_GATTC_ENABLE diff --git a/components/bt/host/bluedroid/api/esp_gatts_api.c b/components/bt/host/bluedroid/api/esp_gatts_api.c index 881aec7fe7..10b82a1c7d 100644 --- a/components/bt/host/bluedroid/api/esp_gatts_api.c +++ b/components/bt/host/bluedroid/api/esp_gatts_api.c @@ -85,7 +85,7 @@ esp_err_t esp_ble_gatts_create_service(esp_gatt_if_t gatts_if, esp_err_t esp_ble_gatts_create_attr_tab(const esp_gatts_attr_db_t *gatts_attr_db, esp_gatt_if_t gatts_if, - uint8_t max_nb_attr, + uint16_t max_nb_attr, uint8_t srvc_inst_id) { btc_msg_t msg = {0}; @@ -93,6 +93,11 @@ esp_err_t esp_ble_gatts_create_attr_tab(const esp_gatts_attr_db_t *gatts_attr_db ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED); + if (max_nb_attr > ESP_GATT_ATTR_HANDLE_MAX) { + LOG_ERROR("The number of attribute should not be greater than CONFIG_BT_GATT_MAX_SR_ATTRIBUTES\n"); + return ESP_ERR_INVALID_ARG; + } + msg.sig = BTC_SIG_API_CALL; msg.pid = BTC_PID_GATTS; msg.act = BTC_GATTS_ACT_CREATE_ATTR_TAB; diff --git a/components/bt/host/bluedroid/api/include/api/esp_gatt_defs.h b/components/bt/host/bluedroid/api/include/api/esp_gatt_defs.h index bf9546feba..3e5a9c190f 100644 --- a/components/bt/host/bluedroid/api/include/api/esp_gatt_defs.h +++ b/components/bt/host/bluedroid/api/include/api/esp_gatt_defs.h @@ -18,7 +18,7 @@ extern "C" { /// GATT INVALID HANDLE #define ESP_GATT_ILLEGAL_HANDLE 0 /// GATT attribute max handle -#define ESP_GATT_ATTR_HANDLE_MAX 100 +#define ESP_GATT_ATTR_HANDLE_MAX UC_CONFIG_BT_GATT_MAX_SR_ATTRIBUTES #define ESP_GATT_MAX_READ_MULTI_HANDLES 10 /* Max attributes to read in one request */ diff --git a/components/bt/host/bluedroid/api/include/api/esp_gatts_api.h b/components/bt/host/bluedroid/api/include/api/esp_gatts_api.h index 6215f57f7e..ae1a0245b8 100644 --- a/components/bt/host/bluedroid/api/include/api/esp_gatts_api.h +++ b/components/bt/host/bluedroid/api/include/api/esp_gatts_api.h @@ -351,7 +351,7 @@ esp_err_t esp_ble_gatts_create_service(esp_gatt_if_t gatts_if, */ esp_err_t esp_ble_gatts_create_attr_tab(const esp_gatts_attr_db_t *gatts_attr_db, esp_gatt_if_t gatts_if, - uint8_t max_nb_attr, + uint16_t max_nb_attr, uint8_t srvc_inst_id); /** * @brief This function is called to add an included service. This function have to be called between diff --git a/components/bt/host/bluedroid/bta/gatt/bta_gattc_cache.c b/components/bt/host/bluedroid/bta/gatt/bta_gattc_cache.c index ba232cb1d1..d8af854525 100644 --- a/components/bt/host/bluedroid/bta/gatt/bta_gattc_cache.c +++ b/components/bt/host/bluedroid/bta/gatt/bta_gattc_cache.c @@ -541,7 +541,6 @@ void bta_gattc_start_disc_char_dscp(UINT16 conn_id, tBTA_GATTC_SERV *p_srvc_cb) if (bta_gattc_discover_procedure(conn_id, p_srvc_cb, GATT_DISC_CHAR_DSCPT) != 0) { bta_gattc_char_dscpt_disc_cmpl(conn_id, p_srvc_cb); } - } void bta_gattc_update_include_service(const list_t *services) { @@ -693,7 +692,9 @@ static void bta_gattc_char_dscpt_disc_cmpl(UINT16 conn_id, tBTA_GATTC_SERV *p_sr { tBTA_GATTC_ATTR_REC *p_rec = NULL; - if (--p_srvc_cb->total_char > 0) { + /* Recursive function will cause BTU stack overflow when there are a large number of characteristic + * without descriptor to discover. So replace it with while function */ + while (--p_srvc_cb->total_char > 0) { p_rec = p_srvc_cb->p_srvc_list + (++ p_srvc_cb->cur_char_idx); /* add the next characteristic into cache */ bta_gattc_add_char_to_cache (p_srvc_cb, @@ -701,11 +702,14 @@ static void bta_gattc_char_dscpt_disc_cmpl(UINT16 conn_id, tBTA_GATTC_SERV *p_sr p_rec->s_handle, &p_rec->uuid, p_rec->property); + /* start to discover next characteristic for descriptor */ + if (bta_gattc_discover_procedure(conn_id, p_srvc_cb, GATT_DISC_CHAR_DSCPT) == 0) { + /* send att req and wait for att rsp */ + break; + } + } - /* start discoverying next characteristic for char descriptor */ - bta_gattc_start_disc_char_dscp(conn_id, p_srvc_cb); - } else - /* all characteristic has been explored, start with next service if any */ + if (p_srvc_cb->total_char == 0) /* all characteristic has been explored, start with next service if any */ { #if (defined BTA_GATT_DEBUG && BTA_GATT_DEBUG == TRUE) APPL_TRACE_ERROR("all char has been explored"); @@ -772,7 +776,7 @@ static tBTA_GATT_STATUS bta_gattc_add_srvc_to_list(tBTA_GATTC_SERV *p_srvc_cb, /* allocate bigger buffer ?? */ status = GATT_DB_FULL; - APPL_TRACE_ERROR("service not added, no resources or wrong state"); + APPL_TRACE_ERROR("service not added, no resources or wrong state, see CONFIG_BT_GATTC_MAX_CACHE_CHAR"); } return status; } @@ -814,7 +818,7 @@ static tBTA_GATT_STATUS bta_gattc_add_char_to_list(tBTA_GATTC_SERV *p_srvc_cb, } p_srvc_cb->next_avail_idx ++; } else { - APPL_TRACE_ERROR("char not added, no resources"); + APPL_TRACE_ERROR("char not added, no resources, see CONFIG_BT_GATTC_MAX_CACHE_CHAR"); /* allocate bigger buffer ?? */ status = BTA_GATT_DB_FULL; } diff --git a/components/bt/host/bluedroid/bta/gatt/include/bta_gattc_int.h b/components/bt/host/bluedroid/bta/gatt/include/bta_gattc_int.h index 06a8f5f187..4262f20b70 100644 --- a/components/bt/host/bluedroid/bta/gatt/include/bta_gattc_int.h +++ b/components/bt/host/bluedroid/bta/gatt/include/bta_gattc_int.h @@ -270,7 +270,6 @@ typedef struct { } tBTA_GATTC_ATTR_REC; -#define BTA_GATTC_MAX_CACHE_CHAR 40 #define BTA_GATTC_ATTR_LIST_SIZE (BTA_GATTC_MAX_CACHE_CHAR * sizeof(tBTA_GATTC_ATTR_REC)) #ifndef BTA_GATTC_CACHE_SRVR_SIZE @@ -305,10 +304,10 @@ typedef struct { tBTA_GATTC_ATTR_REC *p_srvc_list; UINT8 cur_srvc_idx; - UINT8 cur_char_idx; - UINT8 next_avail_idx; + UINT16 cur_char_idx; + UINT16 next_avail_idx; UINT8 total_srvc; - UINT8 total_char; + UINT16 total_char; UINT16 total_attr; UINT8 srvc_hdl_chg; /* service handle change indication pending */ UINT16 attr_index; /* cahce NV saving/loading attribute index */ diff --git a/components/bt/host/bluedroid/btc/profile/std/gatt/btc_gatts.c b/components/bt/host/bluedroid/btc/profile/std/gatt/btc_gatts.c index 4f49c8872e..dacf03c92a 100644 --- a/components/bt/host/bluedroid/btc/profile/std/gatt/btc_gatts.c +++ b/components/bt/host/bluedroid/btc/profile/std/gatt/btc_gatts.c @@ -127,7 +127,7 @@ void btc_gatts_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src) break; } case BTC_GATTS_ACT_CREATE_ATTR_TAB: { - uint8_t num_attr = src->create_attr_tab.max_nb_attr; + uint16_t num_attr = src->create_attr_tab.max_nb_attr; if (src->create_attr_tab.gatts_attr_db && (num_attr > 0)) { dst->create_attr_tab.gatts_attr_db = (esp_gatts_attr_db_t *) osi_malloc(sizeof(esp_gatts_attr_db_t) * num_attr); if (dst->create_attr_tab.gatts_attr_db) { @@ -217,7 +217,7 @@ void btc_gatts_arg_deep_free(btc_msg_t *msg) static void btc_gatts_act_create_attr_tab(esp_gatts_attr_db_t *gatts_attr_db, esp_gatt_if_t gatts_if, - uint8_t max_nb_attr, + uint16_t max_nb_attr, uint8_t srvc_inst_id) { uint16_t uuid = 0; @@ -568,24 +568,24 @@ static void btc_gatts_inter_cb(tBTA_GATTS_EVT event, tBTA_GATTS *p_data) //save the service handle to the btc module after used //the attribute table method to creat a service bta_to_btc_uuid(&btc_creat_tab_env.svc_uuid, &p_data->create.uuid); - uint8_t index = btc_creat_tab_env.handle_idx; + uint16_t index = btc_creat_tab_env.handle_idx; btc_creat_tab_env.svc_start_hdl = p_data->create.service_id; btc_creat_tab_env.handles[index] = p_data->create.service_id; break; } case BTA_GATTS_ADD_INCL_SRVC_EVT: { - uint8_t index = btc_creat_tab_env.handle_idx; + uint16_t index = btc_creat_tab_env.handle_idx; btc_creat_tab_env.handles[index] = p_data->add_result.attr_id; break; } case BTA_GATTS_ADD_CHAR_EVT: { - uint8_t index = btc_creat_tab_env.handle_idx; + uint16_t index = btc_creat_tab_env.handle_idx; btc_creat_tab_env.handles[index] = p_data->add_result.attr_id - 1; btc_creat_tab_env.handles[index+1] = p_data->add_result.attr_id; break; } case BTA_GATTS_ADD_CHAR_DESCR_EVT: { - uint8_t index = btc_creat_tab_env.handle_idx; + uint16_t index = btc_creat_tab_env.handle_idx; btc_creat_tab_env.handles[index] = p_data->add_result.attr_id; break; } diff --git a/components/bt/host/bluedroid/btc/profile/std/include/btc_gatts.h b/components/bt/host/bluedroid/btc/profile/std/include/btc_gatts.h index 35a09a5fdd..866495646c 100644 --- a/components/bt/host/bluedroid/btc/profile/std/include/btc_gatts.h +++ b/components/bt/host/bluedroid/btc/profile/std/include/btc_gatts.h @@ -55,7 +55,7 @@ typedef union { struct create_attr_tab_args{ esp_gatt_if_t gatts_if; uint8_t srvc_inst_id; - uint8_t max_nb_attr; + uint16_t max_nb_attr; esp_gatts_attr_db_t *gatts_attr_db; }create_attr_tab; @@ -149,8 +149,8 @@ typedef struct { esp_bt_uuid_t svc_uuid; bool is_tab_creat_svc; bool is_use_svc; - uint8_t num_handle; - uint8_t handle_idx; + uint16_t num_handle; + uint16_t handle_idx; uint16_t handles[ESP_GATT_ATTR_HANDLE_MAX]; } esp_btc_creat_tab_t; diff --git a/components/bt/host/bluedroid/common/include/common/bluedroid_user_config.h b/components/bt/host/bluedroid/common/include/common/bluedroid_user_config.h index e6aae09935..4362cd10fd 100644 --- a/components/bt/host/bluedroid/common/include/common/bluedroid_user_config.h +++ b/components/bt/host/bluedroid/common/include/common/bluedroid_user_config.h @@ -134,6 +134,12 @@ #endif //GATTC CACHE +#ifdef CONFIG_BT_GATTC_MAX_CACHE_CHAR +#define UC_BT_GATTC_MAX_CACHE_CHAR CONFIG_BT_GATTC_MAX_CACHE_CHAR +#else +#define UC_BT_GATTC_MAX_CACHE_CHAR 40 +#endif + #ifdef CONFIG_BT_GATTC_CACHE_NVS_FLASH #define UC_BT_GATTC_CACHE_NVS_FLASH_ENABLED CONFIG_BT_GATTC_CACHE_NVS_FLASH #else @@ -258,6 +264,11 @@ #define UC_CONFIG_BT_GATT_MAX_SR_PROFILES 8 #endif +#ifdef CONFIG_BT_GATT_MAX_SR_ATTRIBUTES +#define UC_CONFIG_BT_GATT_MAX_SR_ATTRIBUTES CONFIG_BT_GATT_MAX_SR_ATTRIBUTES +#else +#define UC_CONFIG_BT_GATT_MAX_SR_ATTRIBUTES 100 +#endif #ifdef CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE #define UC_BT_GATTS_SEND_SERVICE_CHANGE_MODE CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE diff --git a/components/bt/host/bluedroid/common/include/common/bt_target.h b/components/bt/host/bluedroid/common/include/common/bt_target.h index 66688ba13e..83abc9ba8c 100644 --- a/components/bt/host/bluedroid/common/include/common/bt_target.h +++ b/components/bt/host/bluedroid/common/include/common/bt_target.h @@ -21,7 +21,6 @@ #define BT_TARGET_H #include -#include "soc/soc_caps.h" #ifndef BUILDCFG #define BUILDCFG @@ -278,11 +277,6 @@ #define BLE_ESTABLISH_LINK_CONNECTION_TIMEOUT UC_BT_BLE_ESTAB_LINK_CONN_TOUT #endif -#ifdef SOC_BLE_DONT_UPDATE_OWN_RPA -#define BLE_UPDATE_BLE_ADDR_TYPE_RPA FALSE -#else -#define BLE_UPDATE_BLE_ADDR_TYPE_RPA TRUE -#endif //------------------Added from bdroid_buildcfg.h--------------------- #ifndef L2CAP_EXTFEA_SUPPORTED_MASK #define L2CAP_EXTFEA_SUPPORTED_MASK (L2CAP_EXTFEA_ENH_RETRANS | L2CAP_EXTFEA_STREAM_MODE | L2CAP_EXTFEA_NO_CRC | L2CAP_EXTFEA_FIXED_CHNLS) @@ -1203,15 +1197,27 @@ #endif #ifndef BTM_BLE_ADV_TX_POWER +#ifdef CONFIG_IDF_TARGET_ESP32 #define BTM_BLE_ADV_TX_POWER {-12, -9, -6, -3, 0, 3, 6, 9} +#else +#define BTM_BLE_ADV_TX_POWER {-24, -21, -18, -15, -12, -9, -6, -3, 0, 3, 6, 9, 12, 15, 18, 21} +#endif #endif #ifndef BTM_TX_POWER +#ifdef CONFIG_IDF_TARGET_ESP32 #define BTM_TX_POWER {-12, -9, -6, -3, 0, 3, 6, 9} +#else +#define BTM_TX_POWER {-24, -21, -18, -15, -12, -9, -6, -3, 0, 3, 6, 9, 12, 15, 18, 21} +#endif #endif #ifndef BTM_TX_POWER_LEVEL_MAX +#ifdef CONFIG_IDF_TARGET_ESP32 #define BTM_TX_POWER_LEVEL_MAX 7 +#else +#define BTM_TX_POWER_LEVEL_MAX 15 +#endif #endif @@ -2241,6 +2247,10 @@ The maximum number of payload octets that the local device can receive in a sing #define BTA_DM_AVOID_A2DP_ROLESWITCH_ON_INQUIRY FALSE #endif +#ifndef BTA_GATTC_MAX_CACHE_CHAR +#define BTA_GATTC_MAX_CACHE_CHAR UC_BT_GATTC_MAX_CACHE_CHAR +#endif + /****************************************************************************** ** ** Tracing: Include trace header file here. diff --git a/components/bt/host/bluedroid/stack/btm/btm_ble_addr.c b/components/bt/host/bluedroid/stack/btm/btm_ble_addr.c index 52e79692ee..036377c4a5 100644 --- a/components/bt/host/bluedroid/stack/btm/btm_ble_addr.c +++ b/components/bt/host/bluedroid/stack/btm/btm_ble_addr.c @@ -56,8 +56,9 @@ static void btm_gen_resolve_paddr_cmpl(tSMP_ENC *p) p_cb->private_addr[5] = p->param_buf[0]; p_cb->private_addr[4] = p->param_buf[1]; p_cb->private_addr[3] = p->param_buf[2]; + /* set it to controller */ - btsnd_hcic_ble_set_random_addr(p_cb->private_addr); + btm_ble_set_random_addr(p_cb->private_addr); p_cb->exist_addr_bit |= BTM_BLE_GAP_ADDR_BIT_RESOLVABLE; memcpy(p_cb->resolvale_addr, p_cb->private_addr, BD_ADDR_LEN); @@ -66,23 +67,6 @@ static void btm_gen_resolve_paddr_cmpl(tSMP_ENC *p) p_cb->set_local_privacy_cback = NULL; } - if (btm_cb.ble_ctr_cb.inq_var.adv_mode == BTM_BLE_ADV_ENABLE){ - BTM_TRACE_DEBUG("Advertise with new resolvable private address, now."); - /** - * Restart advertising, using new resolvable private address - */ - btm_ble_stop_adv(); - btm_ble_start_adv(); - } - if (btm_cb.ble_ctr_cb.inq_var.state == BTM_BLE_SCANNING){ - BTM_TRACE_DEBUG("Scan with new resolvable private address, now."); - /** - * Restart scaning, using new resolvable private address - */ - btm_ble_stop_scan(); - btm_ble_start_scan(); - } - /* start a periodical timer to refresh random addr */ btu_stop_timer_oneshot(&p_cb->raddr_timer_ent); #if (BTM_BLE_CONFORMANCE_TESTING == TRUE) diff --git a/components/bt/host/bluedroid/stack/btm/btm_ble_gap.c b/components/bt/host/bluedroid/stack/btm/btm_ble_gap.c index 1b96d93773..f8624b3f1b 100644 --- a/components/bt/host/bluedroid/stack/btm/btm_ble_gap.c +++ b/components/bt/host/bluedroid/stack/btm/btm_ble_gap.c @@ -1018,9 +1018,7 @@ uint32_t BTM_BleUpdateOwnType(uint8_t *own_bda_type, tBTM_START_ADV_CMPL_CBACK * } } else if(*own_bda_type == BLE_ADDR_PUBLIC_ID || *own_bda_type == BLE_ADDR_RANDOM_ID) { if((btm_cb.ble_ctr_cb.addr_mgnt_cb.exist_addr_bit & BTM_BLE_GAP_ADDR_BIT_RESOLVABLE) == BTM_BLE_GAP_ADDR_BIT_RESOLVABLE) { -#if (BLE_UPDATE_BLE_ADDR_TYPE_RPA) *own_bda_type = BLE_ADDR_RANDOM; -#endif btm_cb.ble_ctr_cb.addr_mgnt_cb.own_addr_type = BLE_ADDR_RANDOM; memcpy(btm_cb.ble_ctr_cb.addr_mgnt_cb.private_addr, btm_cb.ble_ctr_cb.addr_mgnt_cb.resolvale_addr, BD_ADDR_LEN); btsnd_hcic_ble_set_random_addr(btm_cb.ble_ctr_cb.addr_mgnt_cb.resolvale_addr); @@ -4120,6 +4118,59 @@ tBTM_STATUS btm_ble_stop_adv(void) return rt; } +tBTM_STATUS btm_ble_set_random_addr(BD_ADDR random_bda) +{ + tBTM_STATUS rt = BTM_SUCCESS; + + osi_mutex_lock(&adv_enable_lock, OSI_MUTEX_MAX_TIMEOUT); + osi_mutex_lock(&scan_enable_lock, OSI_MUTEX_MAX_TIMEOUT); + + if (btm_cb.ble_ctr_cb.inq_var.adv_mode == BTM_BLE_ADV_ENABLE) { + if (btsnd_hcic_ble_set_adv_enable (BTM_BLE_ADV_DISABLE)) { + osi_sem_take(&adv_enable_sem, OSI_SEM_MAX_TIMEOUT); + rt = adv_enable_status; + } else { + rt = BTM_BAD_VALUE_RET; + } + } + + if (BTM_BLE_IS_DISCO_ACTIVE(btm_cb.ble_ctr_cb.scan_activity)) { + if (btsnd_hcic_ble_set_scan_enable (BTM_BLE_SCAN_DISABLE, BTM_BLE_SCAN_DUPLICATE_DISABLE)) { + osi_sem_take(&scan_enable_sem, OSI_SEM_MAX_TIMEOUT); + rt = scan_enable_status; + } else { + rt = BTM_BAD_VALUE_RET; + } + } + + if (rt == BTM_SUCCESS) { + btsnd_hcic_ble_set_random_addr(random_bda); + } + + if (btm_cb.ble_ctr_cb.inq_var.adv_mode == BTM_BLE_ADV_ENABLE) { + if (btsnd_hcic_ble_set_adv_enable (BTM_BLE_ADV_ENABLE)) { + osi_sem_take(&adv_enable_sem, OSI_SEM_MAX_TIMEOUT); + rt = adv_enable_status; + } else { + rt = BTM_BAD_VALUE_RET; + } + } + + if (BTM_BLE_IS_DISCO_ACTIVE(btm_cb.ble_ctr_cb.scan_activity)) { + if (btsnd_hcic_ble_set_scan_enable (BTM_BLE_SCAN_ENABLE, btm_cb.ble_ctr_cb.inq_var.scan_duplicate_filter)) { + osi_sem_take(&scan_enable_sem, OSI_SEM_MAX_TIMEOUT); + rt = scan_enable_status; + } else { + rt = BTM_BAD_VALUE_RET; + } + } + + osi_mutex_unlock(&adv_enable_lock); + osi_mutex_unlock(&scan_enable_lock); + + return rt; +} + /******************************************************************************* ** diff --git a/components/bt/host/bluedroid/stack/btm/btm_sec.c b/components/bt/host/bluedroid/stack/btm/btm_sec.c index c52d65a263..cd61d6388d 100644 --- a/components/bt/host/bluedroid/stack/btm/btm_sec.c +++ b/components/bt/host/bluedroid/stack/btm/btm_sec.c @@ -240,12 +240,6 @@ BOOLEAN BTM_SecRegister(tBTM_APPL_INFO *p_cb_info) if (memcmp(btm_cb.devcb.id_keys.ir, &temp_value, sizeof(BT_OCTET16)) == 0) { btm_ble_reset_id(); } -#if (!BLE_UPDATE_BLE_ADDR_TYPE_RPA) - BD_ADDR peer_addr = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; - BT_OCTET16 peer_irk = {0x0}; - /* add local irk to controller */ - btsnd_hcic_ble_add_device_resolving_list (0, peer_addr, peer_irk, btm_cb.devcb.id_keys.irk); -#endif } else { BTM_TRACE_WARNING("%s p_cb_info->p_le_callback == NULL\n", __func__); } diff --git a/components/bt/host/bluedroid/stack/btm/include/btm_ble_int.h b/components/bt/host/bluedroid/stack/btm/include/btm_ble_int.h index 3d33a3566f..12d95f97f3 100644 --- a/components/bt/host/bluedroid/stack/btm/include/btm_ble_int.h +++ b/components/bt/host/bluedroid/stack/btm/include/btm_ble_int.h @@ -419,6 +419,7 @@ tBTM_STATUS btm_ble_stop_adv(void); tBTM_STATUS btm_ble_start_scan(void); void btm_ble_create_ll_conn_complete (UINT8 status); void btm_ble_create_conn_cancel_complete (UINT8 *p); +tBTM_STATUS btm_ble_set_random_addr(BD_ADDR random_bda); /* LE security function from btm_sec.c */ #if SMP_INCLUDED == TRUE diff --git a/components/bt/host/bluedroid/stack/include/stack/btm_ble_api.h b/components/bt/host/bluedroid/stack/include/stack/btm_ble_api.h index b20b861a28..5e4504dd88 100644 --- a/components/bt/host/bluedroid/stack/include/stack/btm_ble_api.h +++ b/components/bt/host/bluedroid/stack/include/stack/btm_ble_api.h @@ -385,7 +385,7 @@ typedef UINT8 tBTM_BLE_AD_TYPE; /* adv tx power level */ #define BTM_BLE_ADV_TX_POWER_MIN 0 /* minimum tx power */ -#define BTM_BLE_ADV_TX_POWER_MAX 7 /* maximum tx power */ +#define BTM_BLE_ADV_TX_POWER_MAX BTM_TX_POWER_LEVEL_MAX /* maximum tx power */ typedef UINT8 tBTM_BLE_ADV_TX_POWER; /* adv tx power in dBm */ diff --git a/components/soc/esp32/include/soc/Kconfig.soc_caps.in b/components/soc/esp32/include/soc/Kconfig.soc_caps.in index 0ebe4788db..885c9244b4 100644 --- a/components/soc/esp32/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32/include/soc/Kconfig.soc_caps.in @@ -703,10 +703,6 @@ config SOC_SDMMC_NUM_SLOTS int default 2 -config SOC_BLE_DONT_UPDATE_OWN_RPA - bool - default y - config SOC_WIFI_HW_TSF bool default n diff --git a/components/soc/esp32/include/soc/soc_caps.h b/components/soc/esp32/include/soc/soc_caps.h index f1c2f30568..f1e3db1c2b 100644 --- a/components/soc/esp32/include/soc/soc_caps.h +++ b/components/soc/esp32/include/soc/soc_caps.h @@ -380,9 +380,6 @@ #define SOC_SDMMC_USE_IOMUX 1 #define SOC_SDMMC_NUM_SLOTS 2 -/*------------------------------ BLE --------------------------------------------*/ -#define SOC_BLE_DONT_UPDATE_OWN_RPA (1) - /*-------------------------- WI-FI HARDWARE CAPS -------------------------------*/ #define SOC_WIFI_HW_TSF (0) /*!< Hardware TSF is not supported */ #define SOC_WIFI_FTM_SUPPORT (0) /*!< FTM is not supported */