From 99a0ebf3ece9223b5a13072b4d4332a9312fa595 Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Tue, 22 Sep 2020 22:32:27 -0700 Subject: [PATCH] AVCT: Move L2cap disconnect logic together Bug: 159815595 Tag: #refactor Test: compile & verify basic functions working Change-Id: Idfb4d668e49d18b993adbdd622edbcc147badfa5 --- stack/avct/avct_int.h | 1 + stack/avct/avct_l2c.cc | 17 ++++------------- stack/avct/avct_lcb_act.cc | 2 +- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/stack/avct/avct_int.h b/stack/avct/avct_int.h index 8cc495777..b07b2bc8b 100644 --- a/stack/avct/avct_int.h +++ b/stack/avct/avct_int.h @@ -220,6 +220,7 @@ extern tAVCT_CB avct_cb; extern const tL2CAP_APPL_INFO avct_l2c_appl; extern const tL2CAP_APPL_INFO avct_l2c_br_appl; +void avct_l2c_disconnect(uint16_t lcid, uint16_t result); void avct_l2c_br_disconnect(uint16_t lcid, uint16_t result); #endif /* AVCT_INT_H */ diff --git a/stack/avct/avct_l2c.cc b/stack/avct/avct_l2c.cc index 6c68c783f..e80c57cf2 100644 --- a/stack/avct/avct_l2c.cc +++ b/stack/avct/avct_l2c.cc @@ -43,7 +43,6 @@ void avct_l2c_connect_cfm_cback(uint16_t lcid, uint16_t result); void avct_l2c_config_cfm_cback(uint16_t lcid, tL2CAP_CFG_INFO* p_cfg); void avct_l2c_config_ind_cback(uint16_t lcid, tL2CAP_CFG_INFO* p_cfg); void avct_l2c_disconnect_ind_cback(uint16_t lcid, bool ack_needed); -void avct_l2c_disconnect_cfm_cback(uint16_t lcid, uint16_t result); void avct_l2c_congestion_ind_cback(uint16_t lcid, bool is_congested); void avct_l2c_data_ind_cback(uint16_t lcid, BT_HDR* p_buf); @@ -53,7 +52,7 @@ const tL2CAP_APPL_INFO avct_l2c_appl = {avct_l2c_connect_ind_cback, avct_l2c_config_ind_cback, avct_l2c_config_cfm_cback, avct_l2c_disconnect_ind_cback, - avct_l2c_disconnect_cfm_cback, + NULL, avct_l2c_data_ind_cback, avct_l2c_congestion_ind_cback, NULL, @@ -333,17 +332,9 @@ void avct_l2c_disconnect_ind_cback(uint16_t lcid, bool ack_needed) { } } -/******************************************************************************* - * - * Function avct_l2c_disconnect_cfm_cback - * - * Description This is the L2CAP disconnect confirm callback function. - * - * - * Returns void - * - ******************************************************************************/ -void avct_l2c_disconnect_cfm_cback(uint16_t lcid, uint16_t result) { +void avct_l2c_disconnect(uint16_t lcid, uint16_t result) { + L2CA_DisconnectReq(lcid); + tAVCT_LCB* p_lcb; uint16_t res; diff --git a/stack/avct/avct_lcb_act.cc b/stack/avct/avct_lcb_act.cc index 6e4dd4ba9..94ec10933 100644 --- a/stack/avct/avct_lcb_act.cc +++ b/stack/avct/avct_lcb_act.cc @@ -389,7 +389,7 @@ void avct_lcb_chk_disc(tAVCT_LCB* p_lcb, tAVCT_LCB_EVT* p_data) { * ******************************************************************************/ void avct_lcb_chnl_disc(tAVCT_LCB* p_lcb, UNUSED_ATTR tAVCT_LCB_EVT* p_data) { - L2CA_DisconnectReq(p_lcb->ch_lcid); + avct_l2c_disconnect(p_lcb->ch_lcid, 0); } /******************************************************************************* -- 2.11.0