Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5935afe7 authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

Use Bind in BTA_JvL2capCloseLE

Bug: 68359837
Test: compilation test
Change-Id: Ia9349c4f62fc515864518af3fd05e3f3af611cbf
parent 74be540d
Loading
Loading
Loading
Loading
+3 −14
Original line number Diff line number Diff line
@@ -2443,19 +2443,8 @@ out:
  ss->p_cback(BTA_JV_L2CAP_START_EVT, &bta_jv, ss->l2cap_socket_id);
}

/*******************************************************************************
 *
 * Function     bta_jv_l2cap_close_fixed
 *
 * Description  close a fixed channel connection. calls no callbacks. idempotent
 *
 * Returns      void
 *
 ******************************************************************************/
extern void bta_jv_l2cap_close_fixed(tBTA_JV_MSG* p_data) {
  tBTA_JV_API_L2CAP_CLOSE* cc = &(p_data->l2cap_close);
  struct fc_client* t;

  t = fcclient_find_by_id(cc->handle);
/* 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);
  if (t) fcclient_free(t);
}
+1 −8
Original line number Diff line number Diff line
@@ -346,16 +346,9 @@ tBTA_JV_STATUS BTA_JvL2capClose(uint32_t handle) {
 *
 ******************************************************************************/
tBTA_JV_STATUS BTA_JvL2capCloseLE(uint32_t handle) {
  tBTA_JV_API_L2CAP_CLOSE* p_msg =
      (tBTA_JV_API_L2CAP_CLOSE*)osi_malloc(sizeof(tBTA_JV_API_L2CAP_CLOSE));

  APPL_TRACE_API("%s", __func__);

  p_msg->hdr.event = BTA_JV_API_L2CAP_CLOSE_FIXED_EVT;
  p_msg->handle = handle;

  bta_sys_sendmsg(p_msg);

  do_in_bta_thread(FROM_HERE, Bind(&bta_jv_l2cap_close_fixed, handle));
  return BTA_JV_SUCCESS;
}

+1 −10
Original line number Diff line number Diff line
@@ -53,7 +53,6 @@ enum {
  BTA_JV_API_L2CAP_START_SERVER_LE_EVT,
  BTA_JV_API_L2CAP_STOP_SERVER_LE_EVT,
  BTA_JV_API_L2CAP_WRITE_FIXED_EVT,
  BTA_JV_API_L2CAP_CLOSE_FIXED_EVT,
  BTA_JV_MAX_INT_EVT
};

@@ -157,13 +156,6 @@ typedef struct {
  uint32_t l2cap_socket_id;
} tBTA_JV_API_L2CAP_SERVER;

/* data type for BTA_JV_API_L2CAP_CLOSE_EVT */
typedef struct {
  BT_HDR hdr;
  uint32_t handle;
  tBTA_JV_L2C_CB* p_cb;
} tBTA_JV_API_L2CAP_CLOSE;

/* data type for BTA_JV_API_L2CAP_READ_EVT */
typedef struct {
  BT_HDR hdr;
@@ -263,7 +255,6 @@ typedef union {
  tBTA_JV_API_START_DISCOVERY start_discovery;
  tBTA_JV_API_L2CAP_READ l2cap_read;
  tBTA_JV_API_L2CAP_WRITE l2cap_write;
  tBTA_JV_API_L2CAP_CLOSE l2cap_close;
  tBTA_JV_API_L2CAP_SERVER l2cap_server;
  tBTA_JV_API_RFCOMM_CONNECT rfcomm_connect;
  tBTA_JV_API_RFCOMM_WRITE rfcomm_write;
@@ -346,6 +337,6 @@ extern void bta_jv_l2cap_connect_le(uint16_t remote_chan,
extern void bta_jv_l2cap_start_server_le(tBTA_JV_MSG* p_data);
extern void bta_jv_l2cap_stop_server_le(tBTA_JV_MSG* p_data);
extern void bta_jv_l2cap_write_fixed(tBTA_JV_MSG* p_data);
extern void bta_jv_l2cap_close_fixed(tBTA_JV_MSG* p_data);
extern void bta_jv_l2cap_close_fixed(uint32_t handle);

#endif /* BTA_JV_INT_H */
+0 −1
Original line number Diff line number Diff line
@@ -56,7 +56,6 @@ const tBTA_JV_ACTION bta_jv_action[] = {
    bta_jv_l2cap_start_server_le, /* BTA_JV_API_L2CAP_START_SERVER_LE_EVT */
    bta_jv_l2cap_stop_server_le,  /* BTA_JV_API_L2CAP_STOP_SERVER_LE_EVT */
    bta_jv_l2cap_write_fixed,     /* BTA_JV_API_L2CAP_WRITE_FIXED_EVT */
    bta_jv_l2cap_close_fixed,     /*  BTA_JV_API_L2CAP_CLOSE_FIXED_EVT */
};

/*******************************************************************************