Component/bt: add new api to get connection parameters

This commit is contained in:
zhiweijian
2019-05-23 14:44:16 +08:00
committed by bot
parent 0521296264
commit 76b3a64b76
16 changed files with 160 additions and 6 deletions

View File

@@ -2732,4 +2732,35 @@ void btm_ble_set_keep_rfu_in_auth_req(BOOLEAN keep_rfu)
#endif /* BTM_BLE_CONFORMANCE_TESTING */
/*******************************************************************************
**
** Function btm_get_current_conn_params
**
** Description This function is called to get current connection parameters
** information of the device
**
** Returns TRUE if the information is geted, else FALSE
**
*******************************************************************************/
BOOLEAN btm_get_current_conn_params(BD_ADDR bda, UINT16 *interval, UINT16 *latency, UINT16 *timeout)
{
if( (interval == NULL) || (latency == NULL) || (timeout == NULL) ) {
BTM_TRACE_ERROR("%s invalid parameters ", __func__);
return FALSE;
}
tL2C_LCB *p_lcb = l2cu_find_lcb_by_bd_addr(bda, BT_TRANSPORT_LE);
if(p_lcb != NULL) {
(*interval) = p_lcb->current_used_conn_interval;
(*latency) = p_lcb->current_used_conn_latency;
(*timeout) = p_lcb->current_used_conn_timeout;
return TRUE;
}
BTM_TRACE_WARNING("%s Device is not connected", __func__);
return FALSE;
}
#endif /* BLE_INCLUDED */

View File

@@ -2045,6 +2045,31 @@ void BTM_Recovery_Pre_State(void)
return;
}
/*******************************************************************************
**
** Function BTM_GetCurrentConnParams
**
** Description This function is called to read the current connection parameters
** of the device
**
** Returns TRUE or FALSE
**
*******************************************************************************/
BOOLEAN BTM_GetCurrentConnParams(BD_ADDR bda, uint16_t *interval, uint16_t *latency, uint16_t *timeout)
{
if( (interval == NULL) || (latency == NULL) || (timeout == NULL) ) {
BTM_TRACE_ERROR("%s error ", __func__);
return FALSE;
}
if(btm_get_current_conn_params(bda, interval, latency, timeout)) {
return TRUE;
}
return FALSE;
}
/*******************************************************************************
**
** Function btm_ble_build_adv_data

View File

@@ -506,6 +506,8 @@ void btm_set_random_address(BD_ADDR random_bda);
void btm_ble_set_keep_rfu_in_auth_req(BOOLEAN keep_rfu);
#endif
BOOLEAN btm_get_current_conn_params(BD_ADDR bda, UINT16 *interval, UINT16 *latency, UINT16 *timeout);
/*
#ifdef __cplusplus
}

View File

@@ -2099,6 +2099,19 @@ tBTM_STATUS BTM_SetBleDataLength(BD_ADDR bd_addr, UINT16 tx_pdu_length);
*******************************************************************************/
tBTM_STATUS BTM_UpdateBleDuplicateExceptionalList(uint8_t subcode, uint32_t type, BD_ADDR device_info, tBTM_UPDATE_DUPLICATE_EXCEPTIONAL_LIST_CMPL_CBACK update_exceptional_list_cmp_cb);
/*******************************************************************************
**
** Function BTM_GetCurrentConnParams
**
** Description This function is called to read the current connection parameters
** of the device
**
** Returns TRUE or FALSE
**
*******************************************************************************/
BOOLEAN BTM_GetCurrentConnParams(BD_ADDR bda, uint16_t *interval, uint16_t *latency, uint16_t *timeout);
/*
#ifdef __cplusplus
}