constexpr uint16_t kConnectionSuccess = 0;
constexpr uint16_t kInvalidConnectionInterfaceDescriptor = 0;
constexpr uint8_t kUnusedId = 0;
-constexpr uint16_t kUnusedResult = 0;
} // namespace
bool bluetooth::shim::legacy::PsmManager::IsPsmRegistered(uint16_t psm) const {
}
if (cid_closing_set_.count(cid) == 1) {
cid_closing_set_.erase(cid);
- do_in_main_thread(
- FROM_HERE,
- base::Bind(
- classic_.Callbacks(CidToPsm(cid)).pL2CA_DisconnectCfm_Cb, cid,
- kUnusedResult));
-
} else {
do_in_main_thread(
FROM_HERE,
avct_l2c_config_ind_cback,
avct_l2c_config_cfm_cback,
avct_l2c_disconnect_ind_cback,
- NULL,
avct_l2c_data_ind_cback,
avct_l2c_congestion_ind_cback,
NULL,
avct_l2c_br_config_ind_cback,
avct_l2c_br_config_cfm_cback,
avct_l2c_br_disconnect_ind_cback,
- NULL,
avct_l2c_br_data_ind_cback,
avct_l2c_br_congestion_ind_cback,
NULL,
avdt_l2c_config_ind_cback,
avdt_l2c_config_cfm_cback,
avdt_l2c_disconnect_ind_cback,
- NULL,
avdt_l2c_data_ind_cback,
avdt_l2c_congestion_ind_cback,
NULL,
gatt_l2cif_config_ind_cback,
gatt_l2cif_config_cfm_cback,
gatt_l2cif_disconnect_ind_cback,
- NULL,
gatt_l2cif_data_ind_cback,
gatt_l2cif_congest_cback,
NULL};
static void hidd_l2cif_cong_ind(uint16_t cid, bool congested);
static const tL2CAP_APPL_INFO dev_reg_info = {
- hidd_l2cif_connect_ind, hidd_l2cif_connect_cfm, hidd_l2cif_config_ind,
- hidd_l2cif_config_cfm, hidd_l2cif_disconnect_ind, NULL,
- hidd_l2cif_data_ind, hidd_l2cif_cong_ind, NULL};
+ hidd_l2cif_connect_ind, hidd_l2cif_connect_cfm,
+ hidd_l2cif_config_ind, hidd_l2cif_config_cfm,
+ hidd_l2cif_disconnect_ind, hidd_l2cif_data_ind,
+ hidd_l2cif_cong_ind, NULL};
/*******************************************************************************
*
static void hidh_l2cif_cong_ind(uint16_t l2cap_cid, bool congested);
static const tL2CAP_APPL_INFO hst_reg_info = {
- hidh_l2cif_connect_ind, hidh_l2cif_connect_cfm, hidh_l2cif_config_ind,
- hidh_l2cif_config_cfm, hidh_l2cif_disconnect_ind, NULL,
- hidh_l2cif_data_ind, hidh_l2cif_cong_ind, NULL,
+ hidh_l2cif_connect_ind, hidh_l2cif_connect_cfm,
+ hidh_l2cif_config_ind, hidh_l2cif_config_cfm,
+ hidh_l2cif_disconnect_ind, hidh_l2cif_data_ind,
+ hidh_l2cif_cong_ind, NULL,
/* tL2CA_TX_COMPLETE_CB */};
/*******************************************************************************
tL2CA_CONFIG_IND_CB* pL2CA_ConfigInd_Cb;
tL2CA_CONFIG_CFM_CB* pL2CA_ConfigCfm_Cb;
tL2CA_DISCONNECT_IND_CB* pL2CA_DisconnectInd_Cb;
- tL2CA_DISCONNECT_CFM_CB* pL2CA_DisconnectCfm_Cb;
tL2CA_DATA_IND_CB* pL2CA_DataInd_Cb;
tL2CA_CONGESTION_STATUS_CB* pL2CA_CongestionStatus_Cb;
tL2CA_TX_COMPLETE_CB* pL2CA_TxComplete_Cb;
L2CAP_CHNL_DISCONNECT_TIMEOUT_MS,
l2c_ccb_timer_timeout, p_ccb);
} else {
- tL2CA_DISCONNECT_CFM_CB* disconnect_cfm =
- p_ccb->p_rcb->api.pL2CA_DisconnectCfm_Cb;
l2cu_release_ccb(p_ccb);
- if (disconnect_cfm) {
- L2CAP_TRACE_API("%s: L2CAP - Calling DisconnectCfm_Cb(), CID: 0x%04x",
- __func__, local_cid);
- (*disconnect_cfm)(local_cid, L2CAP_CONN_NO_LINK);
- }
}
break;
******************************************************************************/
static void l2c_csm_w4_l2cap_disconnect_rsp(tL2C_CCB* p_ccb, uint16_t event,
void* p_data) {
- tL2CA_DISCONNECT_CFM_CB* disconnect_cfm =
- p_ccb->p_rcb->api.pL2CA_DisconnectCfm_Cb;
- uint16_t local_cid = p_ccb->local_cid;
-
L2CAP_TRACE_EVENT("L2CAP - LCID: 0x%04x st: W4_L2CAP_DISC_RSP evt: %s",
p_ccb->local_cid, l2c_csm_get_event_name(event));
switch (event) {
case L2CEVT_L2CAP_DISCONNECT_RSP: /* Peer disconnect response */
l2cu_release_ccb(p_ccb);
- if (disconnect_cfm) {
- L2CAP_TRACE_API("L2CAP - Calling DisconnectCfm_Cb(), CID: 0x%04x",
- local_cid);
- (*disconnect_cfm)(local_cid, L2CAP_DISC_OK);
- }
break;
case L2CEVT_L2CAP_DISCONNECT_REQ: /* Peer disconnect request */
l2cu_send_peer_disc_rsp(p_ccb->p_lcb, p_ccb->remote_id, p_ccb->local_cid,
p_ccb->remote_cid);
l2cu_release_ccb(p_ccb);
- if (disconnect_cfm) {
- L2CAP_TRACE_API("L2CAP - Calling DisconnectCfm_Cb(), CID: 0x%04x",
- local_cid);
- (*disconnect_cfm)(local_cid, L2CAP_DISC_OK);
- }
break;
case L2CEVT_LP_DISCONNECT_IND: /* Link was disconnected */
case L2CEVT_TIMEOUT: /* Timeout */
l2cu_release_ccb(p_ccb);
- if (disconnect_cfm) {
- L2CAP_TRACE_API("L2CAP - Calling DisconnectCfm_Cb(), CID: 0x%04x",
- local_cid);
- (*disconnect_cfm)(local_cid, L2CAP_DISC_TIMEOUT);
- }
break;
case L2CEVT_L2CAP_DATA: /* Peer data packet rcvd */
p_l2c->pL2CA_ConfigInd_Cb = RFCOMM_ConfigInd;
p_l2c->pL2CA_ConfigCfm_Cb = RFCOMM_ConfigCnf;
p_l2c->pL2CA_DisconnectInd_Cb = RFCOMM_DisconnectInd;
- p_l2c->pL2CA_DisconnectCfm_Cb = NULL;
p_l2c->pL2CA_DataInd_Cb = RFCOMM_BufDataInd;
p_l2c->pL2CA_CongestionStatus_Cb = RFCOMM_CongestionStatusInd;
p_l2c->pL2CA_TxComplete_Cb = NULL;