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

Commit 4ee48543 authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by Gerrit Code Review
Browse files

Merge "Remove advertise whitelist functionality"

parents 83ef864c 3bf75f08
Loading
Loading
Loading
Loading
+10 −38
Original line number Diff line number Diff line
@@ -1991,42 +1991,16 @@ void bta_gattc_listen(tBTA_GATTC_DATA * p_msg)
    }
    /* mark bg conn record */
    if (bta_gattc_mark_bg_conn(p_msg->api_listen.client_if,
                               (BD_ADDR_PTR) p_msg->api_listen.remote_bda,
                               (BD_ADDR_PTR) NULL,
                               p_msg->api_listen.start,
                               true))
    {
        if (!GATT_Listen(p_msg->api_listen.client_if,
                         p_msg->api_listen.start,
                         p_msg->api_listen.remote_bda))
        {
            APPL_TRACE_ERROR("Listen failure");
            (*p_clreg->p_cback)(BTA_GATTC_LISTEN_EVT, &cb_data);
        }
        else
        {
        GATT_Listen(p_msg->api_listen.start);
        cb_data.status = BTA_GATT_OK;

        (*p_clreg->p_cback)(BTA_GATTC_LISTEN_EVT, &cb_data);

        if (p_msg->api_listen.start)
            {
                /* if listen to a specific target */
                if (p_msg->api_listen.remote_bda != NULL)
                {

                    /* if is a connected remote device */
                    if (L2CA_GetBleConnRole(p_msg->api_listen.remote_bda) == HCI_ROLE_SLAVE &&
                        bta_gattc_find_clcb_by_cif(p_msg->api_listen.client_if,
                                                   p_msg->api_listen.remote_bda,
                                                   BTA_GATT_TRANSPORT_LE) == NULL)
                    {

                        bta_gattc_init_clcb_conn(p_msg->api_listen.client_if,
                                                p_msg->api_listen.remote_bda);
                    }
                }
                /* if listen to all */
                else
        {
            LOG_DEBUG(LOG_TAG, "Listen For All now");
            /* go through all connected device and send
@@ -2035,8 +2009,6 @@ void bta_gattc_listen(tBTA_GATTC_DATA * p_msg)
        }
    }
}
    }
}

/*******************************************************************************
**
+1 −9
Original line number Diff line number Diff line
@@ -726,13 +726,11 @@ void BTA_GATTC_Refresh(const BD_ADDR remote_bda)
**
** Parameters       client_if: server interface.
**                  start: to start or stop listening for connection
**                  remote_bda: remote device BD address, if listen to all device
**                              use NULL.
**
** Returns          void
**
*******************************************************************************/
void BTA_GATTC_Listen(tBTA_GATTC_IF client_if, bool start, BD_ADDR_PTR target_bda)
void BTA_GATTC_Listen(tBTA_GATTC_IF client_if, bool start)
{
    tBTA_GATTC_API_LISTEN *p_buf =
        (tBTA_GATTC_API_LISTEN *)osi_malloc(sizeof(tBTA_GATTC_API_LISTEN) + BD_ADDR_LEN);
@@ -740,12 +738,6 @@ void BTA_GATTC_Listen(tBTA_GATTC_IF client_if, bool start, BD_ADDR_PTR target_bd
    p_buf->hdr.event = BTA_GATTC_API_LISTEN_EVT;
    p_buf->client_if = client_if;
    p_buf->start = start;
    if (target_bda) {
        p_buf->remote_bda = (uint8_t*)(p_buf + 1);
        memcpy(p_buf->remote_bda, target_bda, BD_ADDR_LEN);
    } else {
        p_buf->remote_bda = NULL;
    }

    bta_sys_sendmsg(p_buf);
}
+0 −1
Original line number Diff line number Diff line
@@ -181,7 +181,6 @@ typedef struct
typedef struct
{
    BT_HDR                  hdr;
    BD_ADDR_PTR             remote_bda;
    tBTA_GATTC_IF           client_if;
    bool                 start;
} tBTA_GATTC_API_LISTEN;
+0 −34
Original line number Diff line number Diff line
@@ -582,40 +582,6 @@ void bta_gatts_close (UNUSED_ATTR tBTA_GATTS_CB *p_cb, tBTA_GATTS_DATA * p_msg)
    }

}
/*******************************************************************************
**
** Function         bta_gatts_listen
**
** Description      Start or stop listening for LE connection on a GATT server
**
** Returns          none.
**
*******************************************************************************/
void bta_gatts_listen(UNUSED_ATTR tBTA_GATTS_CB *p_cb, tBTA_GATTS_DATA * p_msg)
{
    tBTA_GATTS_RCB     *p_rcb = bta_gatts_find_app_rcb_by_app_if(p_msg->api_listen.server_if);
    tBTA_GATTS          cb_data;

    cb_data.reg_oper.status = BTA_GATT_OK;
    cb_data.reg_oper.server_if = p_msg->api_listen.server_if;

    if (p_rcb == NULL)
    {
        APPL_TRACE_ERROR("Unknown GATTS application");
        return;
    }

    if (!GATT_Listen(p_msg->api_listen.server_if,
                     p_msg->api_listen.start,
                     p_msg->api_listen.remote_bda))
    {
        cb_data.status = BTA_GATT_ERROR;
        APPL_TRACE_ERROR("bta_gatts_listen Listen failed");
    }

    if (p_rcb->p_cback)
        (*p_rcb->p_cback)(BTA_GATTS_LISTEN_EVT, &cb_data);
}

/*******************************************************************************
**
+0 −33
Original line number Diff line number Diff line
@@ -353,37 +353,4 @@ void BTA_GATTS_Close(uint16_t conn_id)
    bta_sys_sendmsg(p_buf);
}

/*******************************************************************************
**
** Function         BTA_GATTS_Listen
**
** Description      Start advertisement to listen for connection request for a
**                  GATT server
**
** Parameters       server_if: server interface.
**                  start: to start or stop listening for connection
**                  remote_bda: remote device BD address, if listen to all device
**                              use NULL.
**
** Returns          void
**
*******************************************************************************/
void BTA_GATTS_Listen(tBTA_GATTS_IF server_if, bool start, BD_ADDR_PTR target_bda)
{
    tBTA_GATTS_API_LISTEN *p_buf =
        (tBTA_GATTS_API_LISTEN *)osi_malloc(sizeof(tBTA_GATTS_API_LISTEN) + BD_ADDR_LEN);

    p_buf->hdr.event = BTA_GATTS_API_LISTEN_EVT;
    p_buf->server_if = server_if;
    p_buf->start = start;
    if (target_bda) {
        p_buf->remote_bda = (uint8_t *)(p_buf + 1);
        memcpy(p_buf->remote_bda, target_bda, BD_ADDR_LEN);
    } else {
       p_buf->remote_bda = NULL;
    }

    bta_sys_sendmsg(p_buf);
}

#endif /* BTA_GATT_INCLUDED */
Loading