mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
feat(ble/bluedroid): Supported BLE bluedroid host pawr connection
This commit is contained in:
@@ -379,6 +379,11 @@ typedef struct t_l2c_linkcb {
|
||||
BOOLEAN in_use; /* TRUE when in use, FALSE when not */
|
||||
tL2C_LINK_STATE link_state;
|
||||
BOOLEAN is_aux; /* This variable used for BLE 5.0 or higher version when do auxiliary connection */
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
BOOLEAN is_pawr_synced;
|
||||
UINT8 adv_handle;
|
||||
UINT8 subevent;
|
||||
#endif // (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
TIMER_LIST_ENT timer_entry; /* Timer list entry for timeout evt */
|
||||
UINT16 handle; /* The handle used with LM */
|
||||
|
||||
|
||||
@@ -1649,7 +1649,8 @@ BOOLEAN L2CA_RegisterFixedChannel (UINT16 fixed_cid, tL2CAP_FIXED_CHNL_REG *p_f
|
||||
** Return value: TRUE if connection started
|
||||
**
|
||||
*******************************************************************************/
|
||||
BOOLEAN L2CA_ConnectFixedChnl (UINT16 fixed_cid, BD_ADDR rem_bda, tBLE_ADDR_TYPE bd_addr_type, BOOLEAN is_aux)
|
||||
BOOLEAN L2CA_ConnectFixedChnl (UINT16 fixed_cid, BD_ADDR rem_bda, tBLE_ADDR_TYPE bd_addr_type, BOOLEAN is_aux,
|
||||
BOOLEAN is_pawr_synced, UINT8 adv_handle, UINT8 subevent)
|
||||
{
|
||||
tL2C_LCB *p_lcb;
|
||||
tBT_TRANSPORT transport = BT_TRANSPORT_BR_EDR;
|
||||
@@ -1738,6 +1739,11 @@ BOOLEAN L2CA_ConnectFixedChnl (UINT16 fixed_cid, BD_ADDR rem_bda, tBLE_ADDR_TYPE
|
||||
#if (BLE_INCLUDED == TRUE)
|
||||
p_lcb->is_aux = is_aux;
|
||||
p_lcb->open_addr_type = bd_addr_type;
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
p_lcb->is_pawr_synced = is_pawr_synced;
|
||||
p_lcb->adv_handle = adv_handle;
|
||||
p_lcb->subevent = subevent;
|
||||
#endif // (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
#endif
|
||||
if (!l2cu_create_conn(p_lcb, transport)) {
|
||||
L2CAP_TRACE_WARNING ("%s() - create_conn failed", __func__);
|
||||
|
||||
@@ -1020,6 +1020,10 @@ BOOLEAN l2cble_init_direct_conn (tL2C_LCB *p_lcb)
|
||||
}
|
||||
|
||||
tHCI_CreatExtConn aux_conn = {0};
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
aux_conn.adv_handle = p_lcb->adv_handle;
|
||||
aux_conn.subevent = p_lcb->subevent;
|
||||
#endif // (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
aux_conn.filter_policy = FALSE;
|
||||
aux_conn.own_addr_type = own_addr_type;
|
||||
aux_conn.peer_addr_type = peer_addr_type;
|
||||
@@ -1041,9 +1045,19 @@ BOOLEAN l2cble_init_direct_conn (tL2C_LCB *p_lcb)
|
||||
memcpy (l2cb.ble_connecting_bda, p_lcb->remote_bd_addr, BD_ADDR_LEN);
|
||||
btu_start_timer (&p_lcb->timer_entry, BTU_TTYPE_L2CAP_LINK, link_timeout);
|
||||
btm_ble_set_conn_st (BLE_DIR_CONN);
|
||||
if(!btsnd_hcic_ble_create_ext_conn(&aux_conn)) {
|
||||
l2cu_release_lcb (p_lcb);
|
||||
L2CAP_TRACE_ERROR("initiate Aux connection failed, no resources");
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
if (p_lcb->is_pawr_synced) {
|
||||
if(!btsnd_hcic_ble_create_ext_conn_v2(&aux_conn)) {
|
||||
l2cu_release_lcb (p_lcb);
|
||||
L2CAP_TRACE_ERROR("initiate pawr sync connection failed, no resources");
|
||||
}
|
||||
} else
|
||||
#endif // (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
{
|
||||
if(!btsnd_hcic_ble_create_ext_conn(&aux_conn)) {
|
||||
l2cu_release_lcb (p_lcb);
|
||||
L2CAP_TRACE_ERROR("initiate Aux connection failed, no resources");
|
||||
}
|
||||
}
|
||||
#else
|
||||
L2CAP_TRACE_ERROR("BLE 5.0 not support!\n");
|
||||
|
||||
Reference in New Issue
Block a user