return (true);
}
-/*******************************************************************************
- *
- * Function L2CA_DisconnectRsp
- *
- * Description Higher layers call this function to acknowledge the
- * disconnection of a channel.
- *
- * Returns void
- *
- ******************************************************************************/
-bool L2CA_DisconnectRsp(uint16_t cid) {
- if (bluetooth::shim::is_gd_shim_enabled()) {
- return bluetooth::shim::L2CA_DisconnectRsp(cid);
- }
-
- tL2C_CCB* p_ccb;
-
- L2CAP_TRACE_API("L2CA_DisconnectRsp() CID: 0x%04x", cid);
-
- /* Find the channel control block. We don't know the link it is on. */
- p_ccb = l2cu_find_ccb_by_cid(NULL, cid);
- if (p_ccb == NULL) {
- L2CAP_TRACE_WARNING("L2CAP - no CCB for L2CA_disc_rsp, CID: %d", cid);
- return (false);
- }
-
- l2c_csm_execute(p_ccb, L2CEVT_L2CA_DISCONNECT_RSP, NULL);
-
- return (true);
-}
-
bool L2CA_GetRemoteCid(uint16_t lcid, uint16_t* rcid) {
if (bluetooth::shim::is_gd_shim_enabled()) {
return bluetooth::shim::L2CA_GetRemoteCid(lcid, rcid);
l2c_csm_execute(p_ccb, L2CEVT_L2CA_CONFIG_RSP, &config);
}
+static void l2c_csm_send_disconnect_rsp(tL2C_CCB* p_ccb) {
+ l2c_csm_execute(p_ccb, L2CEVT_L2CA_DISCONNECT_RSP, NULL);
+}
+
/*******************************************************************************
*
* Function l2c_csm_execute
"L2CAP - Calling Disconnect_Ind_Cb(), CID: 0x%04x Conf Needed",
p_ccb->local_cid);
(*p_ccb->p_rcb->api.pL2CA_DisconnectInd_Cb)(p_ccb->local_cid, true);
- L2CA_DisconnectRsp(p_ccb->local_cid);
+ l2c_csm_send_disconnect_rsp(p_ccb);
break;
case L2CEVT_L2CA_CONFIG_REQ: /* Upper layer config req */
"L2CAP - Calling Disconnect_Ind_Cb(), CID: 0x%04x Conf Needed",
p_ccb->local_cid);
(*p_ccb->p_rcb->api.pL2CA_DisconnectInd_Cb)(p_ccb->local_cid, true);
- L2CA_DisconnectRsp(p_ccb->local_cid);
+ l2c_csm_send_disconnect_rsp(p_ccb);
break;
case L2CEVT_L2CAP_DATA: /* Peer data packet rcvd */
extern bool l2cu_create_conn_le(tL2C_LCB* p_lcb, uint8_t initiating_phys);
extern void l2cu_create_conn_after_switch(tL2C_LCB* p_lcb);
extern void l2cu_adjust_out_mps(tL2C_CCB* p_ccb);
-extern bool L2CA_DisconnectRsp(uint16_t cid);
/* Functions provided by l2c_link.cc
***********************************