Skip to content

Commit

Permalink
Merge branch 'bugfix/fix_bleqabr23_222_v5.1' into 'release/v5.1'
Browse files Browse the repository at this point in the history
Revert "bluedroid: report disconnect event after BLE link closed" (backport 5.1)

See merge request espressif/esp-idf!24036
  • Loading branch information
jack0c committed Jun 3, 2023
2 parents 4259255 + c5e580e commit 4bc7626
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 44 deletions.
2 changes: 1 addition & 1 deletion components/bt/host/bluedroid/bta/dm/bta_dm_act.c
Original file line number Diff line number Diff line change
Expand Up @@ -5102,7 +5102,7 @@ void bta_dm_ble_update_conn_params (tBTA_DM_MSG *p_data)
*******************************************************************************/
void bta_dm_ble_disconnect (tBTA_DM_MSG *p_data)
{
L2CA_BleDisconnect(p_data->ble_disconnect.remote_bda);
L2CA_RemoveFixedChnl(L2CAP_ATT_CID, p_data->ble_disconnect.remote_bda);
}

/*******************************************************************************
Expand Down
13 changes: 0 additions & 13 deletions components/bt/host/bluedroid/stack/include/stack/l2c_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -1215,19 +1215,6 @@ extern BOOLEAN L2CA_EnableUpdateBleConnParams (BD_ADDR rem_bda, BOOLEAN enable);
**
*******************************************************************************/
extern UINT8 L2CA_GetBleConnRole (BD_ADDR bd_addr);

/*******************************************************************************
**
** Function L2CA_BleDisconnect
**
** Description This function use to disconnect LE connection.
**
** Parameters BD Address of remote
**
** Returns TRUE if disconnect successfully.
**
*******************************************************************************/
extern BOOLEAN L2CA_BleDisconnect (BD_ADDR rem_bda);
#endif /* (BLE_INCLUDED == TRUE) */

/*******************************************************************************
Expand Down
30 changes: 0 additions & 30 deletions components/bt/host/bluedroid/stack/l2cap/l2c_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1949,36 +1949,6 @@ BOOLEAN L2CA_RemoveFixedChnl (UINT16 fixed_cid, BD_ADDR rem_bda)
return (TRUE);
}

#if BLE_INCLUDED == TRUE
BOOLEAN L2CA_BleDisconnect (BD_ADDR rem_bda)
{
tL2C_LCB *p_lcb;
tGATT_TCB *p_tcb;

p_lcb = l2cu_find_lcb_by_bd_addr (rem_bda, BT_TRANSPORT_LE);
if (p_lcb == NULL) {
return FALSE;
}

if (p_lcb->link_state != LST_CONNECTED) {
return FALSE;
}

p_lcb->disc_reason = HCI_ERR_CONN_CAUSE_LOCAL_HOST;
p_lcb->link_state = LST_DISCONNECTING;
btsnd_hcic_disconnect (p_lcb->handle, HCI_ERR_PEER_USER);

p_tcb = gatt_find_tcb_by_addr(rem_bda, BT_TRANSPORT_LE);
if (p_tcb == NULL) {
return FALSE;
}

gatt_set_ch_state(p_tcb, GATT_CH_CLOSING);

return TRUE;
}
#endif

/*******************************************************************************
**
** Function L2CA_SetFixedChannelTout
Expand Down

0 comments on commit 4bc7626

Please sign in to comment.