conn.reg_info.pL2CA_ConfigInd_Cb = gap_config_ind;
conn.reg_info.pL2CA_ConfigCfm_Cb = gap_config_cfm;
conn.reg_info.pL2CA_DisconnectInd_Cb = gap_disconnect_ind;
- conn.reg_info.pL2CA_DisconnectCfm_Cb = NULL;
conn.reg_info.pL2CA_DataInd_Cb = gap_data_ind;
conn.reg_info.pL2CA_CongestionStatus_Cb = gap_congestion_ind;
conn.reg_info.pL2CA_TxComplete_Cb = gap_tx_complete_ind;
tL2CAP_CFG_INFO* p_cfg);
static void gatt_l2cif_disconnect_ind_cback(uint16_t l2cap_cid,
bool ack_needed);
-static void gatt_l2cif_disconnect_cfm_cback(uint16_t l2cap_cid,
- uint16_t result);
+static void gatt_l2cif_disconnect(uint16_t l2cap_cid);
static void gatt_l2cif_data_ind_cback(uint16_t l2cap_cid, BT_HDR* p_msg);
static void gatt_send_conn_cback(tGATT_TCB* p_tcb);
static void gatt_l2cif_congest_cback(uint16_t cid, bool congested);
gatt_l2cif_config_ind_cback,
gatt_l2cif_config_cfm_cback,
gatt_l2cif_disconnect_ind_cback,
- gatt_l2cif_disconnect_cfm_cback,
+ NULL,
gatt_l2cif_data_ind_cback,
gatt_l2cif_congest_cback,
NULL};
}
gatt_set_ch_state(p_tcb, GATT_CH_CLOSING);
} else {
- if ((ch_state == GATT_CH_OPEN) || (ch_state == GATT_CH_CFG))
- ret = L2CA_DisconnectReq(p_tcb->att_lcid);
- else
+ if ((ch_state == GATT_CH_OPEN) || (ch_state == GATT_CH_CFG)) {
+ gatt_l2cif_disconnect(p_tcb->att_lcid);
+ return true;
+ } else {
VLOG(1) << __func__ << " gatt_disconnect channel not opened";
+ }
}
return ret;
if (result == L2CAP_CONN_OK) {
/* just in case the peer also accepts our connection - Send L2CAP
* disconnect req */
- L2CA_DisconnectReq(lcid);
+ gatt_l2cif_disconnect(lcid);
}
}
}
/* if result not successful */
if (p_cfg->result != L2CAP_CFG_OK) {
/* Send L2CAP disconnect req */
- L2CA_DisconnectReq(lcid);
+ gatt_l2cif_disconnect(lcid);
return;
}
gatt_cleanup_upon_disc(p_tcb->peer_bda, reason, BT_TRANSPORT_BR_EDR);
}
-/** This is the L2CAP disconnect confirm callback function */
-static void gatt_l2cif_disconnect_cfm_cback(uint16_t lcid,
- UNUSED_ATTR uint16_t result) {
+static void gatt_l2cif_disconnect(uint16_t lcid) {
+ L2CA_DisconnectReq(lcid);
/* look up clcb for this channel */
tGATT_TCB* p_tcb = gatt_find_tcb_by_cid(lcid);