mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
component/bt: Fix memory leakage, connection fail bugs
- Fix memory leakage while deregisting gatt app - Fix Android connection failed problem - Fix service_uuid_len error in adv data
This commit is contained in:
parent
0fe765a977
commit
a3717515a2
@ -687,7 +687,7 @@
|
|||||||
|
|
||||||
/* The maximum number of simultaneous links that L2CAP can support. Up to 7*/
|
/* The maximum number of simultaneous links that L2CAP can support. Up to 7*/
|
||||||
#ifndef MAX_ACL_CONNECTIONS
|
#ifndef MAX_ACL_CONNECTIONS
|
||||||
#define MAX_L2CAP_LINKS 3
|
#define MAX_L2CAP_LINKS 5
|
||||||
#else
|
#else
|
||||||
#define MAX_L2CAP_LINKS MAX_ACL_CONNECTIONS
|
#define MAX_L2CAP_LINKS MAX_ACL_CONNECTIONS
|
||||||
#endif
|
#endif
|
||||||
|
@ -300,13 +300,15 @@ void btm_acl_created (BD_ADDR bda, DEV_CLASS dc, BD_NAME bdn,
|
|||||||
&p->active_remote_addr_type);
|
&p->active_remote_addr_type);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (HCI_LE_SLAVE_INIT_FEAT_EXC_SUPPORTED(controller_get_interface()->get_features_ble()->as_array)
|
if (link_role == HCI_ROLE_MASTER) {
|
||||||
&& link_role == HCI_ROLE_MASTER) {
|
|
||||||
|
|
||||||
btsnd_hcic_ble_read_remote_feat(p->hci_handle);
|
btsnd_hcic_ble_read_remote_feat(p->hci_handle);
|
||||||
} else if (HCI_LE_SLAVE_INIT_FEAT_EXC_SUPPORTED(controller_get_interface()->get_features_ble()->as_array)
|
} else if (HCI_LE_SLAVE_INIT_FEAT_EXC_SUPPORTED(controller_get_interface()->get_features_ble()->as_array)
|
||||||
&& link_role == HCI_ROLE_SLAVE) {
|
&& link_role == HCI_ROLE_SLAVE) {
|
||||||
//do nothing in this case for fix the android7.0 cann't sent security request issue
|
/* In the original Bluedroid version, slave need to send LL_SLAVE_FEATURE_REQ(call btsnd_hcic_ble_read_remote_feat)
|
||||||
|
* to remote device if it has not received ll_feature_req.
|
||||||
|
* Delete it to resolve Android 7.0 incompatible problem. But it may cause that slave
|
||||||
|
* can't get remote device's feature if it doesn't receive ll_feature_req.*/
|
||||||
|
l2cble_notify_le_connection(bda);
|
||||||
} else {
|
} else {
|
||||||
btm_establish_continue(p);
|
btm_establish_continue(p);
|
||||||
}
|
}
|
||||||
|
@ -458,6 +458,7 @@ void gatt_free_srvc_db_buffer_app_id(tBT_UUID *p_app_id)
|
|||||||
|
|
||||||
for (i = 0; i < GATT_MAX_SR_PROFILES; i ++, p_elem ++) {
|
for (i = 0; i < GATT_MAX_SR_PROFILES; i ++, p_elem ++) {
|
||||||
if (memcmp(p_app_id, &p_elem->asgn_range.app_uuid128, sizeof(tBT_UUID)) == 0) {
|
if (memcmp(p_app_id, &p_elem->asgn_range.app_uuid128, sizeof(tBT_UUID)) == 0) {
|
||||||
|
gatt_free_attr_value_buffer(p_elem);
|
||||||
while (!GKI_queue_is_empty(&p_elem->svc_db.svc_buffer)) {
|
while (!GKI_queue_is_empty(&p_elem->svc_db.svc_buffer)) {
|
||||||
GKI_freebuf (GKI_dequeue (&p_elem->svc_db.svc_buffer));
|
GKI_freebuf (GKI_dequeue (&p_elem->svc_db.svc_buffer));
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ static esp_ble_adv_data_t heart_rate_adv_config = {
|
|||||||
.p_manufacturer_data = NULL, //&test_manufacturer[0],
|
.p_manufacturer_data = NULL, //&test_manufacturer[0],
|
||||||
.service_data_len = 0,
|
.service_data_len = 0,
|
||||||
.p_service_data = NULL,
|
.p_service_data = NULL,
|
||||||
.service_uuid_len = 32,
|
.service_uuid_len = sizeof(heart_rate_service_uuid),
|
||||||
.p_service_uuid = heart_rate_service_uuid,
|
.p_service_uuid = heart_rate_service_uuid,
|
||||||
.flag = (ESP_BLE_ADV_FLAG_GEN_DISC | ESP_BLE_ADV_FLAG_BREDR_NOT_SPT),
|
.flag = (ESP_BLE_ADV_FLAG_GEN_DISC | ESP_BLE_ADV_FLAG_BREDR_NOT_SPT),
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user