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

Commit fbcb4ccf authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

Remove unnecesary BTA redefinitions for GATT part 4

Test: compilation test
Change-Id: Ibe37a1c6506d567b68497e8c7074d90cd73ddf00
parent 86ad542e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -4607,10 +4607,10 @@ void btm_dm_start_gatt_discovery(const RawAddress& bd_addr) {
  } else {
    if (BTM_IsAclConnectionUp(bd_addr, BT_TRANSPORT_LE)) {
      BTA_GATTC_Open(bta_dm_search_cb.client_if, bd_addr, true,
                     BTA_GATT_TRANSPORT_LE, true);
                     GATT_TRANSPORT_LE, true);
    } else {
      BTA_GATTC_Open(bta_dm_search_cb.client_if, bd_addr, true,
                     BTA_GATT_TRANSPORT_LE, false);
                     GATT_TRANSPORT_LE, false);
    }
  }
}
+4 −4
Original line number Diff line number Diff line
@@ -306,7 +306,7 @@ void bta_gattc_process_api_open_cancel(tBTA_GATTC_DATA* p_msg) {
  if (p_msg->api_cancel_conn.is_direct) {
    p_clcb = bta_gattc_find_clcb_by_cif(p_msg->api_cancel_conn.client_if,
                                        p_msg->api_cancel_conn.remote_bda,
                                        BTA_GATT_TRANSPORT_LE);
                                        GATT_TRANSPORT_LE);
    if (p_clcb != NULL) {
      bta_gattc_sm_execute(p_clcb, event, p_msg);
    } else {
@@ -455,7 +455,7 @@ void bta_gattc_init_bk_conn(tBTA_GATTC_API_OPEN* p_data,
      if (GATT_GetConnIdIfConnected(p_data->client_if, p_data->remote_bda,
                                    &conn_id, p_data->transport)) {
        p_clcb = bta_gattc_find_alloc_clcb(
            p_data->client_if, p_data->remote_bda, BTA_GATT_TRANSPORT_LE);
            p_data->client_if, p_data->remote_bda, GATT_TRANSPORT_LE);
        if (p_clcb != NULL) {
          gattc_data.hdr.layer_specific = p_clcb->bta_conn_id = conn_id;

@@ -470,7 +470,7 @@ void bta_gattc_init_bk_conn(tBTA_GATTC_API_OPEN* p_data,
  /* open failure, report OPEN_EVT */
  if (status != GATT_SUCCESS) {
    bta_gattc_send_open_cback(p_clreg, status, p_data->remote_bda,
                              GATT_INVALID_CONN_ID, BTA_GATT_TRANSPORT_LE, 0);
                              GATT_INVALID_CONN_ID, GATT_TRANSPORT_LE, 0);
  }
}
/*******************************************************************************
@@ -1352,7 +1352,7 @@ static void bta_gattc_conn_cback(tGATT_IF gattc_if, const RawAddress& bdaddr,
 ******************************************************************************/
static void bta_gattc_enc_cmpl_cback(tGATT_IF gattc_if, const RawAddress& bda) {
  tBTA_GATTC_CLCB* p_clcb =
      bta_gattc_find_clcb_by_cif(gattc_if, bda, BTA_GATT_TRANSPORT_LE);
      bta_gattc_find_clcb_by_cif(gattc_if, bda, GATT_TRANSPORT_LE);

  if (p_clcb == NULL) return;

+2 −2
Original line number Diff line number Diff line
@@ -117,7 +117,7 @@ void BTA_GATTC_AppDeregister(tGATT_IF client_if) {
 *
 ******************************************************************************/
void BTA_GATTC_Open(tGATT_IF client_if, const RawAddress& remote_bda,
                    bool is_direct, tBTA_GATT_TRANSPORT transport,
                    bool is_direct, tGATT_TRANSPORT transport,
                    bool opportunistic) {
  uint8_t phy = controller_get_interface()->get_le_all_initiating_phys();
  BTA_GATTC_Open(client_if, remote_bda, is_direct, transport, opportunistic,
@@ -125,7 +125,7 @@ void BTA_GATTC_Open(tGATT_IF client_if, const RawAddress& remote_bda,
}

void BTA_GATTC_Open(tGATT_IF client_if, const RawAddress& remote_bda,
                    bool is_direct, tBTA_GATT_TRANSPORT transport,
                    bool is_direct, tGATT_TRANSPORT transport,
                    bool opportunistic, uint8_t initiating_phys) {
  tBTA_GATTC_API_OPEN* p_buf =
      (tBTA_GATTC_API_OPEN*)osi_malloc(sizeof(tBTA_GATTC_API_OPEN));
+7 −7
Original line number Diff line number Diff line
@@ -101,9 +101,9 @@ static void bta_gatts_nv_save_cback(bool is_add,
static bool bta_gatts_nv_srv_chg_cback(tGATTS_SRV_CHG_CMD cmd,
                                       tGATTS_SRV_CHG_REQ* p_req,
                                       tGATTS_SRV_CHG_RSP* p_rsp) {
  return bta_gatts_co_srv_chg((tBTA_GATTS_SRV_CHG_CMD)cmd,
                              (tBTA_GATTS_SRV_CHG_REQ*)p_req,
                              (tBTA_GATTS_SRV_CHG_RSP*)p_rsp);
  return bta_gatts_co_srv_chg((tGATTS_SRV_CHG_CMD)cmd,
                              (tGATTS_SRV_CHG_REQ*)p_req,
                              (tGATTS_SRV_CHG_RSP*)p_rsp);
}

/*******************************************************************************
@@ -493,7 +493,7 @@ void bta_gatts_close(UNUSED_ATTR tBTA_GATTS_CB* p_cb, tBTA_GATTS_DATA* p_msg) {
  tGATT_STATUS status = GATT_ERROR;
  tGATT_IF gatt_if;
  RawAddress remote_bda;
  tBTA_GATT_TRANSPORT transport;
  tGATT_TRANSPORT transport;

  if (GATT_GetConnectionInfor(p_msg->hdr.layer_specific, &gatt_if, remote_bda,
                              &transport)) {
@@ -532,7 +532,7 @@ static void bta_gatts_send_request_cback(uint16_t conn_id, uint32_t trans_id,
  tBTA_GATTS cb_data;
  tBTA_GATTS_RCB* p_rcb;
  tGATT_IF gatt_if;
  tBTA_GATT_TRANSPORT transport;
  tGATT_TRANSPORT transport;

  memset(&cb_data, 0, sizeof(tBTA_GATTS));

@@ -552,7 +552,7 @@ static void bta_gatts_send_request_cback(uint16_t conn_id, uint32_t trans_id,

      cb_data.req_data.conn_id = conn_id;
      cb_data.req_data.trans_id = trans_id;
      cb_data.req_data.p_data = (tBTA_GATTS_REQ_DATA*)p_data;
      cb_data.req_data.p_data = (tGATTS_DATA*)p_data;

      (*p_rcb->p_cback)(req_type, &cb_data);
    } else {
@@ -662,7 +662,7 @@ static void bta_gatts_conn_update_cback(tGATT_IF gatt_if, uint16_t conn_id,
static void bta_gatts_cong_cback(uint16_t conn_id, bool congested) {
  tBTA_GATTS_RCB* p_rcb;
  tGATT_IF gatt_if;
  tBTA_GATT_TRANSPORT transport;
  tGATT_TRANSPORT transport;
  tBTA_GATTS cb_data;

  if (GATT_GetConnectionInfor(conn_id, &gatt_if, cb_data.req_data.remote_bda,
+5 −5
Original line number Diff line number Diff line
@@ -246,8 +246,8 @@ void BTA_GATTS_HandleValueIndication(uint16_t conn_id, uint16_t attr_id,
 *
 ******************************************************************************/
void BTA_GATTS_SendRsp(uint16_t conn_id, uint32_t trans_id, tGATT_STATUS status,
                       tBTA_GATTS_RSP* p_msg) {
  const size_t len = sizeof(tBTA_GATTS_API_RSP) + sizeof(tBTA_GATTS_RSP);
                       tGATTS_RSP* p_msg) {
  const size_t len = sizeof(tBTA_GATTS_API_RSP) + sizeof(tGATTS_RSP);
  tBTA_GATTS_API_RSP* p_buf = (tBTA_GATTS_API_RSP*)osi_calloc(len);

  p_buf->hdr.event = BTA_GATTS_API_RSP_EVT;
@@ -255,8 +255,8 @@ void BTA_GATTS_SendRsp(uint16_t conn_id, uint32_t trans_id, tGATT_STATUS status,
  p_buf->trans_id = trans_id;
  p_buf->status = status;
  if (p_msg != NULL) {
    p_buf->p_rsp = (tBTA_GATTS_RSP*)(p_buf + 1);
    memcpy(p_buf->p_rsp, p_msg, sizeof(tBTA_GATTS_RSP));
    p_buf->p_rsp = (tGATTS_RSP*)(p_buf + 1);
    memcpy(p_buf->p_rsp, p_msg, sizeof(tGATTS_RSP));
  }

  bta_sys_sendmsg(p_buf);
@@ -279,7 +279,7 @@ void BTA_GATTS_SendRsp(uint16_t conn_id, uint32_t trans_id, tGATT_STATUS status,
 *
 ******************************************************************************/
void BTA_GATTS_Open(tGATT_IF server_if, const RawAddress& remote_bda,
                    bool is_direct, tBTA_GATT_TRANSPORT transport) {
                    bool is_direct, tGATT_TRANSPORT transport) {
  tBTA_GATTS_API_OPEN* p_buf =
      (tBTA_GATTS_API_OPEN*)osi_malloc(sizeof(tBTA_GATTS_API_OPEN));

Loading