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:
island 2017-04-18 15:23:38 +08:00
parent 0fe765a977
commit a3717515a2
4 changed files with 9 additions and 6 deletions

View file

@ -687,7 +687,7 @@
/* The maximum number of simultaneous links that L2CAP can support. Up to 7*/
#ifndef MAX_ACL_CONNECTIONS
#define MAX_L2CAP_LINKS 3
#define MAX_L2CAP_LINKS 5
#else
#define MAX_L2CAP_LINKS MAX_ACL_CONNECTIONS
#endif

View file

@ -300,13 +300,15 @@ void btm_acl_created (BD_ADDR bda, DEV_CLASS dc, BD_NAME bdn,
&p->active_remote_addr_type);
#endif
if (HCI_LE_SLAVE_INIT_FEAT_EXC_SUPPORTED(controller_get_interface()->get_features_ble()->as_array)
&& link_role == HCI_ROLE_MASTER) {
if (link_role == HCI_ROLE_MASTER) {
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)
&& 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 {
btm_establish_continue(p);
}

View file

@ -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 ++) {
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)) {
GKI_freebuf (GKI_dequeue (&p_elem->svc_db.svc_buffer));
}

View file

@ -70,7 +70,7 @@ static esp_ble_adv_data_t heart_rate_adv_config = {
.p_manufacturer_data = NULL, //&test_manufacturer[0],
.service_data_len = 0,
.p_service_data = NULL,
.service_uuid_len = 32,
.service_uuid_len = sizeof(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),
};