mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/btdm_a2dp_disconnect_reason' into 'master'
bugfix/btdm_a2dp_disconnect_reason See merge request idf/esp-idf!2914
This commit is contained in:
commit
4f1e8df367
@ -412,6 +412,7 @@ void avdt_l2c_disconnect_ind_cback(UINT16 lcid, BOOLEAN ack_needed)
|
||||
{
|
||||
tAVDT_TC_TBL *p_tbl;
|
||||
UINT16 disc_rsn = AVDT_DISC_RSN_NORMAL;
|
||||
tAVDT_CCB *p_ccb;
|
||||
AVDT_TRACE_DEBUG("avdt_l2c_disconnect_ind_cback lcid: %d, ack_needed: %d\n",
|
||||
lcid, ack_needed);
|
||||
/* look up info for this channel */
|
||||
@ -420,7 +421,13 @@ void avdt_l2c_disconnect_ind_cback(UINT16 lcid, BOOLEAN ack_needed)
|
||||
/* send L2CAP disconnect response */
|
||||
L2CA_DisconnectRsp(lcid);
|
||||
} else {
|
||||
if ((p_ccb = avdt_ccb_by_idx(p_tbl->ccb_idx)) != NULL) {
|
||||
UINT16 rsn = L2CA_GetDisconnectReason(p_ccb->peer_addr, BT_TRANSPORT_BR_EDR);
|
||||
if (rsn != 0 && rsn != HCI_ERR_PEER_USER) {
|
||||
disc_rsn = AVDT_DISC_RSN_ABNORMAL;
|
||||
AVDT_TRACE_EVENT("avdt link disc rsn 0x%x", rsn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
avdt_ad_tc_close_ind(p_tbl, disc_rsn);
|
||||
|
Loading…
Reference in New Issue
Block a user