Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ead3bbab authored by Hansong Zhang's avatar Hansong Zhang
Browse files

AVCT: Move L2cap disconnect logic together

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Idfb4d668e49d18b993adbdd622edbcc147badfa5
parent 8b064d80
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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 */
+4 −13
Original line number Diff line number Diff line
@@ -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;

+1 −1
Original line number Diff line number Diff line
@@ -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);
}

/*******************************************************************************