Loading system/stack/rfcomm/port_int.h +1 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ #include "internal_include/bt_target.h" #include "osi/include/alarm.h" #include "osi/include/fixed_queue.h" #include "stack/include/l2c_api.h" #include "stack/include/l2cap_types.h" #include "stack/include/port_api.h" #include "stack/include/rfcdefs.h" #include "stack/rfcomm/rfc_state.h" Loading system/stack/rfcomm/rfc_int.h +2 −2 Original line number Diff line number Diff line Loading @@ -31,10 +31,10 @@ #include "stack/include/bt_hdr.h" #include "stack/include/btm_status.h" #include "stack/include/l2c_api.h" #include "stack/include/l2cap_interface.h" #include "stack/rfcomm/port_int.h" #include "stack/rfcomm/rfc_event.h" #include "stack/rfcomm/rfc_state.h" #include "types/bt_transport.h" #include "types/raw_address.h" /* Loading system/stack/rfcomm/rfc_l2cap_if.cc +6 −5 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ #include "osi/include/allocator.h" #include "stack/include/bt_hdr.h" #include "stack/include/bt_psm_types.h" #include "stack/include/l2c_api.h" #include "stack/include/l2cap_interface.h" #include "stack/include/l2cdefs.h" #include "stack/rfcomm/port_int.h" #include "stack/rfcomm/rfc_int.h" Loading Loading @@ -72,8 +72,9 @@ void rfcomm_l2cap_if_init(void) { p_l2c->pL2CA_TxComplete_Cb = NULL; p_l2c->pL2CA_Error_Cb = rfc_on_l2cap_error; if (!L2CA_Register(BT_PSM_RFCOMM, rfc_cb.rfc.reg_info, true /* enable_snoop */, nullptr, L2CAP_MTU_SIZE, 0, 0)) { if (!stack::l2cap::get_interface().L2CA_Register(BT_PSM_RFCOMM, rfc_cb.rfc.reg_info, true /* enable_snoop */, nullptr, L2CAP_MTU_SIZE, 0, 0)) { log::error("Unable to register with L2CAP profile RFCOMM psm:{}", BT_PSM_RFCOMM); } } Loading Loading @@ -118,7 +119,7 @@ void RFCOMM_ConnectInd(const RawAddress& bd_addr, uint16_t lcid, uint16_t /* psm } if (p_mcb == nullptr) { if (!L2CA_DisconnectReq(lcid)) { if (!stack::l2cap::get_interface().L2CA_DisconnectReq(lcid)) { log::warn("Unable to disconnect L2CAP cid:{}", lcid); } return; Loading Loading @@ -155,7 +156,7 @@ void RFCOMM_ConnectCnf(uint16_t lcid, tL2CAP_CONN result) { /* Peer gave up its connection request, make sure cleaning up L2CAP * channel */ if (!L2CA_DisconnectReq(p_mcb->pending_lcid)) { if (!stack::l2cap::get_interface().L2CA_DisconnectReq(p_mcb->pending_lcid)) { log::warn("Unable to send L2CAP disconnect request peer:{} cid:{}", p_mcb->bd_addr, p_mcb->lcid); } Loading system/stack/rfcomm/rfc_mx_fsm.cc +17 −16 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ #include "osi/include/allocator.h" #include "stack/include/bt_hdr.h" #include "stack/include/bt_psm_types.h" #include "stack/include/l2c_api.h" #include "stack/include/l2cap_interface.h" #include "stack/include/l2cdefs.h" #include "stack/rfcomm/port_int.h" #include "stack/rfcomm/rfc_int.h" Loading Loading @@ -122,7 +122,7 @@ void rfc_mx_sm_state_idle(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* /* p_data /* Initialize L2CAP MTU */ p_mcb->peer_l2cap_mtu = L2CAP_DEFAULT_MTU - RFCOMM_MIN_OFFSET - 1; uint16_t lcid = L2CA_ConnectReq(BT_PSM_RFCOMM, p_mcb->bd_addr); uint16_t lcid = stack::l2cap::get_interface().L2CA_ConnectReq(BT_PSM_RFCOMM, p_mcb->bd_addr); if (lcid == 0) { log::error("failed to open L2CAP channel for {}", p_mcb->bd_addr); rfc_save_lcid_mcb(nullptr, p_mcb->lcid); Loading Loading @@ -210,8 +210,8 @@ void rfc_mx_sm_state_wait_conn_cnf(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* p case RFC_MX_EVENT_TIMEOUT: p_mcb->state = RFC_MX_STATE_IDLE; if (!L2CA_DisconnectReq(p_mcb->lcid)) { log::warn("Unable to send L2CAP disconnect request peer:{} cid:{}", p_mcb->bd_addr, if (!stack::l2cap::get_interface().L2CA_DisconnectReq(p_mcb->lcid)) { log::warn("Unable to send L2CAP disonnect request peer:{} cid:{}", p_mcb->bd_addr, p_mcb->lcid); } Loading Loading @@ -287,8 +287,8 @@ void rfc_mx_sm_state_configure(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* p_dat case RFC_MX_EVENT_TIMEOUT: log::error("L2CAP configuration timeout for {}", p_mcb->bd_addr); p_mcb->state = RFC_MX_STATE_IDLE; if (!L2CA_DisconnectReq(p_mcb->lcid)) { log::warn("Unable to send L2CAP disconnect request peer:{} cid:{}", p_mcb->bd_addr, if (!stack::l2cap::get_interface().L2CA_DisconnectReq(p_mcb->lcid)) { log::warn("Unable to send L2CAP disonnect request peer:{} cid:{}", p_mcb->bd_addr, p_mcb->lcid); } Loading Loading @@ -352,8 +352,8 @@ void rfc_mx_sm_sabme_wait_ua(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* /* p_da case RFC_MX_EVENT_CONF_CNF: /* workaround: we don't support reconfig */ case RFC_MX_EVENT_TIMEOUT: p_mcb->state = RFC_MX_STATE_IDLE; if (!L2CA_DisconnectReq(p_mcb->lcid)) { log::warn("Unable to send L2CAP disconnect request peer:{} cid:{}", p_mcb->bd_addr, if (!stack::l2cap::get_interface().L2CA_DisconnectReq(p_mcb->lcid)) { log::warn("Unable to send L2CAP disonnect request peer:{} cid:{}", p_mcb->bd_addr, p_mcb->lcid); } Loading Loading @@ -420,8 +420,8 @@ void rfc_mx_sm_state_wait_sabme(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* p_da case RFC_MX_EVENT_CONF_CNF: /* workaround: we don't support reconfig */ case RFC_MX_EVENT_TIMEOUT: p_mcb->state = RFC_MX_STATE_IDLE; if (!L2CA_DisconnectReq(p_mcb->lcid)) { log::warn("Unable to send L2CAP disconnect request peer:{} cid:{}", p_mcb->bd_addr, if (!stack::l2cap::get_interface().L2CA_DisconnectReq(p_mcb->lcid)) { log::warn("Unable to send L2CAP disonnect request peer:{} cid:{}", p_mcb->bd_addr, p_mcb->lcid); } Loading Loading @@ -465,8 +465,8 @@ void rfc_mx_sm_state_connected(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* /* p_ /* If server wait for some time if client decide to reinitiate channel */ rfc_send_ua(p_mcb, RFCOMM_MX_DLCI); if (p_mcb->is_initiator) { if (!L2CA_DisconnectReq(p_mcb->lcid)) { log::warn("Unable to send L2CAP disconnect request peer:{} cid:{}", p_mcb->bd_addr, if (!stack::l2cap::get_interface().L2CA_DisconnectReq(p_mcb->lcid)) { log::warn("Unable to send L2CAP disonnect request peer:{} cid:{}", p_mcb->bd_addr, p_mcb->lcid); } } Loading Loading @@ -497,14 +497,15 @@ void rfc_mx_sm_state_disc_wait_ua(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* p_ case RFC_MX_EVENT_UA: case RFC_MX_EVENT_DM: case RFC_MX_EVENT_TIMEOUT: if (!L2CA_DisconnectReq(p_mcb->lcid)) { log::warn("Unable to send L2CAP disconnect request peer:{} cid:{}", p_mcb->bd_addr, if (!stack::l2cap::get_interface().L2CA_DisconnectReq(p_mcb->lcid)) { log::warn("Unable to send L2CAP disonnect request peer:{} cid:{}", p_mcb->bd_addr, p_mcb->lcid); } if (p_mcb->restart_required) { /* Start Request was received while disconnecting. Execute it again */ uint16_t lcid = L2CA_ConnectReq(BT_PSM_RFCOMM, p_mcb->bd_addr); uint16_t lcid = stack::l2cap::get_interface().L2CA_ConnectReq(BT_PSM_RFCOMM, p_mcb->bd_addr); if (lcid == 0) { rfc_save_lcid_mcb(NULL, p_mcb->lcid); p_mcb->lcid = 0; Loading Loading @@ -614,7 +615,7 @@ void rfc_on_l2cap_error(uint16_t lcid, uint16_t result) { if (p_mcb->is_initiator) { log::error("disconnect L2CAP due to config failure for {}", p_mcb->bd_addr); PORT_StartCnf(p_mcb, static_cast<uint16_t>(result)); if (!L2CA_DisconnectReq(p_mcb->lcid)) { if (!stack::l2cap::get_interface().L2CA_DisconnectReq(p_mcb->lcid)) { log::warn("Unable to send L2CAP disconnect request peer:{} cid:{}", p_mcb->bd_addr, p_mcb->lcid); } Loading system/stack/rfcomm/rfc_ts_frames.cc +2 −1 Original line number Diff line number Diff line Loading @@ -199,7 +199,8 @@ void rfc_send_buf_uih(tRFC_MCB* p_mcb, uint8_t dlci, BT_HDR* p_buf) { if (dlci == RFCOMM_MX_DLCI) { rfc_check_send_cmd(p_mcb, p_buf); } else { if (L2CA_DataWrite(p_mcb->lcid, p_buf) != tL2CAP_DW_RESULT::SUCCESS) { if (stack::l2cap::get_interface().L2CA_DataWrite(p_mcb->lcid, p_buf) != tL2CAP_DW_RESULT::SUCCESS) { log::warn("Unable to write L2CAP data peer:{} cid:{} len:{}", p_mcb->bd_addr, p_mcb->lcid, p_buf->len); } Loading Loading
system/stack/rfcomm/port_int.h +1 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ #include "internal_include/bt_target.h" #include "osi/include/alarm.h" #include "osi/include/fixed_queue.h" #include "stack/include/l2c_api.h" #include "stack/include/l2cap_types.h" #include "stack/include/port_api.h" #include "stack/include/rfcdefs.h" #include "stack/rfcomm/rfc_state.h" Loading
system/stack/rfcomm/rfc_int.h +2 −2 Original line number Diff line number Diff line Loading @@ -31,10 +31,10 @@ #include "stack/include/bt_hdr.h" #include "stack/include/btm_status.h" #include "stack/include/l2c_api.h" #include "stack/include/l2cap_interface.h" #include "stack/rfcomm/port_int.h" #include "stack/rfcomm/rfc_event.h" #include "stack/rfcomm/rfc_state.h" #include "types/bt_transport.h" #include "types/raw_address.h" /* Loading
system/stack/rfcomm/rfc_l2cap_if.cc +6 −5 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ #include "osi/include/allocator.h" #include "stack/include/bt_hdr.h" #include "stack/include/bt_psm_types.h" #include "stack/include/l2c_api.h" #include "stack/include/l2cap_interface.h" #include "stack/include/l2cdefs.h" #include "stack/rfcomm/port_int.h" #include "stack/rfcomm/rfc_int.h" Loading Loading @@ -72,8 +72,9 @@ void rfcomm_l2cap_if_init(void) { p_l2c->pL2CA_TxComplete_Cb = NULL; p_l2c->pL2CA_Error_Cb = rfc_on_l2cap_error; if (!L2CA_Register(BT_PSM_RFCOMM, rfc_cb.rfc.reg_info, true /* enable_snoop */, nullptr, L2CAP_MTU_SIZE, 0, 0)) { if (!stack::l2cap::get_interface().L2CA_Register(BT_PSM_RFCOMM, rfc_cb.rfc.reg_info, true /* enable_snoop */, nullptr, L2CAP_MTU_SIZE, 0, 0)) { log::error("Unable to register with L2CAP profile RFCOMM psm:{}", BT_PSM_RFCOMM); } } Loading Loading @@ -118,7 +119,7 @@ void RFCOMM_ConnectInd(const RawAddress& bd_addr, uint16_t lcid, uint16_t /* psm } if (p_mcb == nullptr) { if (!L2CA_DisconnectReq(lcid)) { if (!stack::l2cap::get_interface().L2CA_DisconnectReq(lcid)) { log::warn("Unable to disconnect L2CAP cid:{}", lcid); } return; Loading Loading @@ -155,7 +156,7 @@ void RFCOMM_ConnectCnf(uint16_t lcid, tL2CAP_CONN result) { /* Peer gave up its connection request, make sure cleaning up L2CAP * channel */ if (!L2CA_DisconnectReq(p_mcb->pending_lcid)) { if (!stack::l2cap::get_interface().L2CA_DisconnectReq(p_mcb->pending_lcid)) { log::warn("Unable to send L2CAP disconnect request peer:{} cid:{}", p_mcb->bd_addr, p_mcb->lcid); } Loading
system/stack/rfcomm/rfc_mx_fsm.cc +17 −16 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ #include "osi/include/allocator.h" #include "stack/include/bt_hdr.h" #include "stack/include/bt_psm_types.h" #include "stack/include/l2c_api.h" #include "stack/include/l2cap_interface.h" #include "stack/include/l2cdefs.h" #include "stack/rfcomm/port_int.h" #include "stack/rfcomm/rfc_int.h" Loading Loading @@ -122,7 +122,7 @@ void rfc_mx_sm_state_idle(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* /* p_data /* Initialize L2CAP MTU */ p_mcb->peer_l2cap_mtu = L2CAP_DEFAULT_MTU - RFCOMM_MIN_OFFSET - 1; uint16_t lcid = L2CA_ConnectReq(BT_PSM_RFCOMM, p_mcb->bd_addr); uint16_t lcid = stack::l2cap::get_interface().L2CA_ConnectReq(BT_PSM_RFCOMM, p_mcb->bd_addr); if (lcid == 0) { log::error("failed to open L2CAP channel for {}", p_mcb->bd_addr); rfc_save_lcid_mcb(nullptr, p_mcb->lcid); Loading Loading @@ -210,8 +210,8 @@ void rfc_mx_sm_state_wait_conn_cnf(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* p case RFC_MX_EVENT_TIMEOUT: p_mcb->state = RFC_MX_STATE_IDLE; if (!L2CA_DisconnectReq(p_mcb->lcid)) { log::warn("Unable to send L2CAP disconnect request peer:{} cid:{}", p_mcb->bd_addr, if (!stack::l2cap::get_interface().L2CA_DisconnectReq(p_mcb->lcid)) { log::warn("Unable to send L2CAP disonnect request peer:{} cid:{}", p_mcb->bd_addr, p_mcb->lcid); } Loading Loading @@ -287,8 +287,8 @@ void rfc_mx_sm_state_configure(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* p_dat case RFC_MX_EVENT_TIMEOUT: log::error("L2CAP configuration timeout for {}", p_mcb->bd_addr); p_mcb->state = RFC_MX_STATE_IDLE; if (!L2CA_DisconnectReq(p_mcb->lcid)) { log::warn("Unable to send L2CAP disconnect request peer:{} cid:{}", p_mcb->bd_addr, if (!stack::l2cap::get_interface().L2CA_DisconnectReq(p_mcb->lcid)) { log::warn("Unable to send L2CAP disonnect request peer:{} cid:{}", p_mcb->bd_addr, p_mcb->lcid); } Loading Loading @@ -352,8 +352,8 @@ void rfc_mx_sm_sabme_wait_ua(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* /* p_da case RFC_MX_EVENT_CONF_CNF: /* workaround: we don't support reconfig */ case RFC_MX_EVENT_TIMEOUT: p_mcb->state = RFC_MX_STATE_IDLE; if (!L2CA_DisconnectReq(p_mcb->lcid)) { log::warn("Unable to send L2CAP disconnect request peer:{} cid:{}", p_mcb->bd_addr, if (!stack::l2cap::get_interface().L2CA_DisconnectReq(p_mcb->lcid)) { log::warn("Unable to send L2CAP disonnect request peer:{} cid:{}", p_mcb->bd_addr, p_mcb->lcid); } Loading Loading @@ -420,8 +420,8 @@ void rfc_mx_sm_state_wait_sabme(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* p_da case RFC_MX_EVENT_CONF_CNF: /* workaround: we don't support reconfig */ case RFC_MX_EVENT_TIMEOUT: p_mcb->state = RFC_MX_STATE_IDLE; if (!L2CA_DisconnectReq(p_mcb->lcid)) { log::warn("Unable to send L2CAP disconnect request peer:{} cid:{}", p_mcb->bd_addr, if (!stack::l2cap::get_interface().L2CA_DisconnectReq(p_mcb->lcid)) { log::warn("Unable to send L2CAP disonnect request peer:{} cid:{}", p_mcb->bd_addr, p_mcb->lcid); } Loading Loading @@ -465,8 +465,8 @@ void rfc_mx_sm_state_connected(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* /* p_ /* If server wait for some time if client decide to reinitiate channel */ rfc_send_ua(p_mcb, RFCOMM_MX_DLCI); if (p_mcb->is_initiator) { if (!L2CA_DisconnectReq(p_mcb->lcid)) { log::warn("Unable to send L2CAP disconnect request peer:{} cid:{}", p_mcb->bd_addr, if (!stack::l2cap::get_interface().L2CA_DisconnectReq(p_mcb->lcid)) { log::warn("Unable to send L2CAP disonnect request peer:{} cid:{}", p_mcb->bd_addr, p_mcb->lcid); } } Loading Loading @@ -497,14 +497,15 @@ void rfc_mx_sm_state_disc_wait_ua(tRFC_MCB* p_mcb, tRFC_MX_EVENT event, void* p_ case RFC_MX_EVENT_UA: case RFC_MX_EVENT_DM: case RFC_MX_EVENT_TIMEOUT: if (!L2CA_DisconnectReq(p_mcb->lcid)) { log::warn("Unable to send L2CAP disconnect request peer:{} cid:{}", p_mcb->bd_addr, if (!stack::l2cap::get_interface().L2CA_DisconnectReq(p_mcb->lcid)) { log::warn("Unable to send L2CAP disonnect request peer:{} cid:{}", p_mcb->bd_addr, p_mcb->lcid); } if (p_mcb->restart_required) { /* Start Request was received while disconnecting. Execute it again */ uint16_t lcid = L2CA_ConnectReq(BT_PSM_RFCOMM, p_mcb->bd_addr); uint16_t lcid = stack::l2cap::get_interface().L2CA_ConnectReq(BT_PSM_RFCOMM, p_mcb->bd_addr); if (lcid == 0) { rfc_save_lcid_mcb(NULL, p_mcb->lcid); p_mcb->lcid = 0; Loading Loading @@ -614,7 +615,7 @@ void rfc_on_l2cap_error(uint16_t lcid, uint16_t result) { if (p_mcb->is_initiator) { log::error("disconnect L2CAP due to config failure for {}", p_mcb->bd_addr); PORT_StartCnf(p_mcb, static_cast<uint16_t>(result)); if (!L2CA_DisconnectReq(p_mcb->lcid)) { if (!stack::l2cap::get_interface().L2CA_DisconnectReq(p_mcb->lcid)) { log::warn("Unable to send L2CAP disconnect request peer:{} cid:{}", p_mcb->bd_addr, p_mcb->lcid); } Loading
system/stack/rfcomm/rfc_ts_frames.cc +2 −1 Original line number Diff line number Diff line Loading @@ -199,7 +199,8 @@ void rfc_send_buf_uih(tRFC_MCB* p_mcb, uint8_t dlci, BT_HDR* p_buf) { if (dlci == RFCOMM_MX_DLCI) { rfc_check_send_cmd(p_mcb, p_buf); } else { if (L2CA_DataWrite(p_mcb->lcid, p_buf) != tL2CAP_DW_RESULT::SUCCESS) { if (stack::l2cap::get_interface().L2CA_DataWrite(p_mcb->lcid, p_buf) != tL2CAP_DW_RESULT::SUCCESS) { log::warn("Unable to write L2CAP data peer:{} cid:{} len:{}", p_mcb->bd_addr, p_mcb->lcid, p_buf->len); } Loading