/*******************************************************************************
*
- * Function BTA_JvL2capStartServerLE
- *
- * Description This function starts an LE L2CAP server and listens for an
- * L2CAP connection from a remote Bluetooth device on a fixed
- * channel over an LE link. When the server
- * is started successfully, tBTA_JV_L2CAP_CBACK is called with
- * BTA_JV_L2CAP_START_EVT. When the connection is established,
- * tBTA_JV_L2CAP_CBACK is called with BTA_JV_L2CAP_OPEN_EVT.
- *
- * Returns void
- *
- ******************************************************************************/
-void BTA_JvL2capStartServerLE(uint16_t local_chan, tBTA_JV_L2CAP_CBACK* p_cback,
- uint32_t l2cap_socket_id);
-
-/*******************************************************************************
- *
* Function BTA_JvL2capStopServerLE
*
* Description This function stops the LE L2CAP server. If the server has
}
}
-/** starts an LE L2CAP server */
-void bta_jv_l2cap_start_server_le(uint16_t local_chan,
- tBTA_JV_L2CAP_CBACK* p_cback,
- uint32_t l2cap_socket_id) {
- tBTA_JV_L2CAP_START evt_data;
- evt_data.handle = GAP_INVALID_HANDLE;
- evt_data.status = BTA_JV_FAILURE;
-
- struct fc_client* t = fcclient_alloc(local_chan, true, NULL);
- if (!t) goto out;
-
- t->p_cback = p_cback;
- t->l2cap_socket_id = l2cap_socket_id;
-
- // if we got here, we're registered...
- evt_data.status = BTA_JV_SUCCESS;
- evt_data.handle = t->id;
- evt_data.sec_id = t->sec_id;
-
-out:
- tBTA_JV bta_jv;
- bta_jv.l2c_start = evt_data;
- p_cback(BTA_JV_L2CAP_START_EVT, &bta_jv, l2cap_socket_id);
-}
-
/* close a fixed channel connection. calls no callbacks. idempotent */
extern void bta_jv_l2cap_close_fixed(uint32_t handle) {
struct fc_client* t = fcclient_find_by_id(handle);
/*******************************************************************************
*
- * Function BTA_JvL2capStartServerLE
- *
- * Description This function starts an LE L2CAP server and listens for an
- * L2CAP connection from a remote Bluetooth device. When the
- * server is started successfully, tBTA_JV_L2CAP_CBACK is
- * called with BTA_JV_L2CAP_START_EVT. When the connection is
- * established, tBTA_JV_L2CAP_CBACK is called with
- * BTA_JV_L2CAP_OPEN_EVT.
- *
- * Returns void
- *
- ******************************************************************************/
-void BTA_JvL2capStartServerLE(uint16_t local_chan, tBTA_JV_L2CAP_CBACK* p_cback,
- uint32_t l2cap_socket_id) {
- VLOG(2) << __func__;
- CHECK(p_cback);
- do_in_main_thread(FROM_HERE, Bind(&bta_jv_l2cap_start_server_le, local_chan,
- p_cback, l2cap_socket_id));
-}
-
-/*******************************************************************************
- *
* Function BTA_JvL2capStopServer
*
* Description This function stops the L2CAP server. If the server has an
extern void bta_jv_set_pm_profile(uint32_t handle, tBTA_JV_PM_ID app_id,
tBTA_JV_CONN_STATE init_st);
-extern void bta_jv_l2cap_start_server_le(uint16_t local_chan,
- tBTA_JV_L2CAP_CBACK* p_cback,
- uint32_t l2cap_socket_id);
extern void bta_jv_l2cap_stop_server_le(uint16_t local_chan);
extern void bta_jv_l2cap_write_fixed(uint16_t channel, const RawAddress& addr,
uint32_t req_id, BT_HDR* msg,
<< ", channel: " << sock->channel
<< ", is_le_coc: " << sock->is_le_coc;
- if (sock->fixed_chan) {
- BTA_JvL2capStartServerLE(sock->channel, btsock_l2cap_cbk, sock->id);
- return;
- }
-
int connection_type =
sock->is_le_coc ? BTA_JV_CONN_TYPE_L2CAP_LE : BTA_JV_CONN_TYPE_L2CAP;