Component/bt: add ble link timeout config in menuconfig

- add ble link timeout config in menuconfig
- disable background connection when call gatts_open
This commit is contained in:
zhiweijian
2019-04-16 11:11:08 +08:00
committed by bot
parent 47988e90ea
commit 0ae4eb4f09
7 changed files with 36 additions and 5 deletions

View File

@@ -2006,9 +2006,18 @@ void btm_ble_conn_complete(UINT8 *p, UINT16 evt_len, BOOLEAN enhanced)
btm_ble_disable_resolving_list(BTM_BLE_RL_ADV, TRUE);
#endif
}
}
btm_ble_update_mode_operation(role, bda, status);
BOOLEAN bg_con = btm_ble_update_mode_operation(role, bda, status);
if (status != HCI_SUCCESS && !bg_con) {
// notify connection failed
l2c_link_hci_disc_comp (handle, status);
#if (SMP_INCLUDED == TRUE)
/* Notify security manager */
btm_sec_disconnected (handle, status);
#endif ///SMP_INCLUDED == TRUE
}
}

View File

@@ -4229,8 +4229,9 @@ void btm_ble_update_link_topology_mask(UINT8 link_role, BOOLEAN increase)
** Returns void
**
*******************************************************************************/
void btm_ble_update_mode_operation(UINT8 link_role, BD_ADDR bd_addr, UINT8 status)
BOOLEAN btm_ble_update_mode_operation(UINT8 link_role, BD_ADDR bd_addr, UINT8 status)
{
BOOLEAN bg_con = FALSE;
if (status == HCI_ERR_DIRECTED_ADVERTISING_TIMEOUT) {
btm_cb.ble_ctr_cb.inq_var.adv_mode = BTM_BLE_ADV_DISABLE;
/* make device fall back into undirected adv mode by default */
@@ -4249,8 +4250,10 @@ void btm_ble_update_mode_operation(UINT8 link_role, BD_ADDR bd_addr, UINT8 statu
now in order */
if (btm_ble_get_conn_st() == BLE_CONN_IDLE && status != HCI_ERR_HOST_REJECT_RESOURCES &&
!btm_send_pending_direct_conn()) {
btm_ble_resume_bg_conn();
bg_con = btm_ble_resume_bg_conn();
}
return bg_con;
}
/*******************************************************************************

View File

@@ -449,7 +449,7 @@ BOOLEAN btm_ble_start_auto_conn(BOOLEAN start);
BOOLEAN btm_ble_start_select_conn(BOOLEAN start, tBTM_BLE_SEL_CBACK *p_select_cback);
BOOLEAN btm_ble_renew_bg_conn_params(BOOLEAN add, BD_ADDR bd_addr);
void btm_write_dir_conn_wl(BD_ADDR target_addr);
void btm_ble_update_mode_operation(UINT8 link_role, BD_ADDR bda, UINT8 status);
BOOLEAN btm_ble_update_mode_operation(UINT8 link_role, BD_ADDR bda, UINT8 status);
BOOLEAN btm_execute_wl_dev_operation(void);
void btm_ble_update_link_topology_mask(UINT8 role, BOOLEAN increase);

View File

@@ -66,7 +66,7 @@
#define L2CAP_WAIT_UNPARK_TOUT 2 /* 2 seconds */
#define L2CAP_LINK_INFO_RESP_TOUT 2 /* 2 seconds */
#define L2CAP_UPDATE_CONN_PARAM_TOUT 6 /* 6 seconds */
#define L2CAP_BLE_LINK_CONNECT_TOUT 30 /* 30 seconds */
#define L2CAP_BLE_LINK_CONNECT_TOUT BLE_ESTABLISH_LINK_CONNECTION_TIMEOUT // configed in menuconfig
#define L2CAP_BLE_CONN_PARAM_UPD_TOUT 30 /* 30 seconds */
/* quick timer uses millisecond unit */