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

Commit bc05da06 authored by Brian Carlstrom's avatar Brian Carlstrom
Browse files

Resetting system/bt

git reset --hard d06cfb98^^
git reset --soft aosp/master
git commit -a

Change-Id: I2939d9bbd825110a42a71008e5255945e38a77e1
parent d06cfb98
Loading
Loading
Loading
Loading
+2 −20
Original line number Diff line number Diff line
@@ -4607,30 +4607,12 @@ void bta_dm_ble_set_conn_params (tBTA_DM_MSG *p_data)
**
** Function         bta_dm_ble_set_scan_params
**
** Description      This function sets BLE scan parameters.
**
** Parameters:
**
*******************************************************************************/
void bta_dm_ble_set_scan_params(tBTA_DM_MSG *p_data)
{
    BTM_BleSetScanParams(p_data->ble_set_scan_params.client_if,
                         p_data->ble_set_scan_params.scan_int,
                         p_data->ble_set_scan_params.scan_window,
                         p_data->ble_set_scan_params.scan_mode,
                         p_data->ble_set_scan_params.scan_param_setup_cback);
}

/*******************************************************************************
**
** Function         bta_dm_ble_set_conn_scan_params
**
** Description      This function set the preferred connection scan parameters.
**
** Parameters:
**
*******************************************************************************/
void bta_dm_ble_set_conn_scan_params (tBTA_DM_MSG *p_data)
void bta_dm_ble_set_scan_params (tBTA_DM_MSG *p_data)
{
    BTM_BleSetConnScanParams(p_data->ble_set_scan_params.scan_int,
                             p_data->ble_set_scan_params.scan_window);
@@ -4707,7 +4689,7 @@ void bta_dm_ble_observe (tBTA_DM_MSG *p_data)
}
/*******************************************************************************
**
** Function         bta_dm_ble_set_adv_params
** Function         bta_dm_ble_set_scan_params
**
** Description      This function set the adv parameters.
**
+11 −40
Original line number Diff line number Diff line
@@ -903,52 +903,23 @@ void BTA_DmSetBlePrefConnParams(BD_ADDR bd_addr,
** Returns          void
**
*******************************************************************************/
void BTA_DmSetBleConnScanParams(UINT32 scan_interval, UINT32 scan_window)
{
    tBTA_DM_API_BLE_SCAN_PARAMS  *p_msg;
    if ((p_msg = (tBTA_DM_API_BLE_SCAN_PARAMS *)GKI_getbuf(sizeof(tBTA_DM_API_BLE_SCAN_PARAMS))) != NULL)
    {
        memset(p_msg, 0, sizeof(tBTA_DM_API_BLE_SCAN_PARAMS));
        p_msg->hdr.event = BTA_DM_API_BLE_CONN_SCAN_PARAM_EVT;
        p_msg->scan_int         = scan_interval;
        p_msg->scan_window      = scan_window;
        bta_sys_sendmsg(p_msg);
    }
}

/*******************************************************************************
**
** Function         BTA_DmSetBleScanParams
**
** Description      This function is called to set scan parameters
**
** Parameters:      client_if - Client IF
**                  scan_interval - scan interval
**                  scan_window - scan window
**                  scan_mode - scan mode
**                  scan_param_setup_status_cback - Set scan param status callback
**
** Returns          void
**
*******************************************************************************/
void BTA_DmSetBleScanParams(tGATT_IF client_if, UINT32 scan_interval,
                            UINT32 scan_window, tBLE_SCAN_MODE scan_mode,
                            tBLE_SCAN_PARAM_SETUP_CBACK scan_param_setup_cback)
void BTA_DmSetBleConnScanParams(UINT16 scan_interval, UINT16 scan_window )
{
#if BLE_INCLUDED == TRUE
    tBTA_DM_API_BLE_SCAN_PARAMS    *p_msg;

    if ((p_msg = (tBTA_DM_API_BLE_SCAN_PARAMS *) GKI_getbuf(sizeof(tBTA_DM_API_BLE_SCAN_PARAMS))) != NULL)
    {
        memset(p_msg, 0, sizeof(tBTA_DM_API_BLE_SCAN_PARAMS));

        p_msg->hdr.event = BTA_DM_API_BLE_SCAN_PARAM_EVT;
        p_msg->client_if = client_if;

        p_msg->scan_int         = scan_interval;
        p_msg->scan_window      = scan_window;
        p_msg->scan_mode = scan_mode;
        p_msg->scan_param_setup_cback = scan_param_setup_cback;

        bta_sys_sendmsg(p_msg);
    }
#endif
}

/*******************************************************************************
@@ -1113,7 +1084,7 @@ extern void BTA_DmBleSetStorageParams(UINT8 batch_scan_full_max,
** Returns          None
**
*******************************************************************************/
extern void BTA_DmBleEnableBatchScan(tBTA_BLE_BATCH_SCAN_MODE scan_mode,
extern void BTA_DmBleEnableBatchScan(tBTA_BLE_SCAN_MODE scan_mode,
                                         UINT32 scan_interval, UINT32 scan_window,
                                         tBTA_BLE_DISCARD_RULE discard_rule,
                                         tBLE_ADDR_TYPE        addr_type,
@@ -1170,7 +1141,7 @@ extern void BTA_DmBleDisableBatchScan(tBTA_DM_BLE_REF_VALUE ref_value)
** Returns          None
**
*******************************************************************************/
extern void BTA_DmBleReadScanReports(tBTA_BLE_BATCH_SCAN_MODE scan_type,
extern void BTA_DmBleReadScanReports(tBTA_BLE_SCAN_MODE scan_type,
                                             tBTA_DM_BLE_REF_VALUE ref_value)
{
    tBTA_DM_API_READ_SCAN_REPORTS  *p_msg;
+5 −10
Original line number Diff line number Diff line
@@ -90,7 +90,6 @@ enum
    BTA_DM_API_BLE_SET_BG_CONN_TYPE,
    BTA_DM_API_BLE_CONN_PARAM_EVT,
    BTA_DM_API_BLE_SCAN_PARAM_EVT,
    BTA_DM_API_BLE_CONN_SCAN_PARAM_EVT,
    BTA_DM_API_BLE_OBSERVE_EVT,
    BTA_DM_API_UPDATE_CONN_PARAM_EVT,
#if BLE_PRIVACY_SPT == TRUE
@@ -455,11 +454,8 @@ typedef struct
typedef struct
{
    BT_HDR                  hdr;
    tBTA_GATTC_IF client_if;
    UINT32 scan_int;
    UINT32 scan_window;
    tBLE_SCAN_MODE scan_mode;
    tBLE_SCAN_PARAM_SETUP_CBACK scan_param_setup_cback;
    UINT16                  scan_int;
    UINT16                  scan_window;
}tBTA_DM_API_BLE_SCAN_PARAMS;

/* Data type for start/stop observe */
@@ -548,7 +544,7 @@ typedef struct
typedef struct
{
    BT_HDR                  hdr;
    tBTA_BLE_BATCH_SCAN_MODE  scan_mode;
    tBTA_BLE_SCAN_MODE      scan_mode;
    UINT32                  scan_int;
    UINT32                  scan_window;
    tBTA_BLE_DISCARD_RULE   discard_rule;
@@ -565,7 +561,7 @@ typedef struct
typedef struct
{
    BT_HDR                  hdr;
    tBTA_BLE_BATCH_SCAN_MODE scan_type;
    tBTA_BLE_SCAN_MODE scan_type;
    tBTA_DM_BLE_REF_VALUE    ref_value;
} tBTA_DM_API_READ_SCAN_REPORTS;

@@ -1063,7 +1059,6 @@ extern void bta_dm_security_grant (tBTA_DM_MSG *p_data);
extern void bta_dm_ble_set_bg_conn_type (tBTA_DM_MSG *p_data);
extern void bta_dm_ble_set_conn_params (tBTA_DM_MSG *p_data);
extern void bta_dm_ble_set_scan_params (tBTA_DM_MSG *p_data);
extern void bta_dm_ble_set_conn_scan_params (tBTA_DM_MSG *p_data);
extern void bta_dm_close_gatt_conn(tBTA_DM_MSG *p_data);
extern void bta_dm_ble_observe (tBTA_DM_MSG *p_data);
extern void bta_dm_ble_update_conn_params (tBTA_DM_MSG *p_data);
+3 −4
Original line number Diff line number Diff line
@@ -87,13 +87,12 @@ const tBTA_DM_ACTION bta_dm_action[] =
    bta_dm_ble_set_bg_conn_type,
    bta_dm_ble_set_conn_params,      /* BTA_DM_API_BLE_CONN_PARAM_EVT */
    bta_dm_ble_set_scan_params,      /* BTA_DM_API_BLE_SCAN_PARAM_EVT */
    bta_dm_ble_set_conn_scan_params,  /* BTA_DM_API_BLE_CONN_SCAN_PARAM_EVT */
    bta_dm_ble_observe,
    bta_dm_ble_update_conn_params,   /* BTA_DM_API_UPDATE_CONN_PARAM_EVT */
#if BLE_PRIVACY_SPT == TRUE
    bta_dm_ble_config_local_privacy,   /* BTA_DM_API_LOCAL_PRIVACY_EVT */
#endif
    bta_dm_ble_set_adv_params,     /* BTA_DM_API_BLE_ADV_PARAM_EVT */
    bta_dm_ble_set_adv_params,     /* BTA_DM_API_BLE_SCAN_PARAM_EVT */
    bta_dm_ble_set_adv_config,     /* BTA_DM_API_BLE_SET_ADV_CONFIG_EVT */
    bta_dm_ble_set_scan_rsp,       /* BTA_DM_API_BLE_SET_SCAN_RSP_EVT */
    bta_dm_ble_broadcast,          /* BTA_DM_API_BLE_BROADCAST_EVT */
+16 −19
Original line number Diff line number Diff line
@@ -90,8 +90,6 @@ UINT32 service_index = 0;
BOOLEAN service_availability = TRUE;
/* helper functions for handling AT commands queueing */

static void bta_hf_client_handle_ok();

static void bta_hf_client_clear_queued_at(void)
{
    tBTA_HF_CLIENT_AT_QCMD *cur = bta_hf_client_cb.scb.at_cb.queued_cmd;
@@ -181,15 +179,6 @@ static void bta_hf_client_send_at(tBTA_HF_CLIENT_AT_CMD cmd, char *buf, UINT16 b
#endif

        bta_hf_client_cb.scb.at_cb.current_cmd = cmd;
        /* Generate fake responses for these because they won't reliably work */
        if (!service_availability &&
                (cmd == BTA_HF_CLIENT_AT_CNUM || cmd == BTA_HF_CLIENT_AT_COPS))
        {
            APPL_TRACE_WARNING("%s: No service, skipping %d command", __FUNCTION__, cmd);
            bta_hf_client_handle_ok();
            return;
        }

        PORT_WriteData(bta_hf_client_cb.scb.conn_handle, buf, buf_len, &len);

        bta_hf_client_start_at_resp_timer();
@@ -203,16 +192,19 @@ static void bta_hf_client_send_at(tBTA_HF_CLIENT_AT_CMD cmd, char *buf, UINT16 b
static void bta_hf_client_send_queued_at(void)
{
    tBTA_HF_CLIENT_AT_QCMD *cur = bta_hf_client_cb.scb.at_cb.queued_cmd;
    tBTA_HF_CLIENT_AT_QCMD *next;

    APPL_TRACE_DEBUG("%s", __FUNCTION__);

    if (cur != NULL)
    {
        bta_hf_client_cb.scb.at_cb.queued_cmd = cur->next;
        next = cur->next;

        bta_hf_client_send_at(cur->cmd, cur->buf, cur->buf_len);

        GKI_freebuf(cur);

        bta_hf_client_cb.scb.at_cb.queued_cmd = next;
    }
}

@@ -437,16 +429,11 @@ static void bta_hf_client_handle_ciev(UINT32 index, UINT32 value)

    APPL_TRACE_DEBUG("%s index: %u value: %u", __FUNCTION__, index, value);

    if(index == 0 || index > BTA_HF_CLIENT_AT_INDICATOR_COUNT)
    if(index == 0 || index >= BTA_HF_CLIENT_AT_INDICATOR_COUNT)
    {
        return;
    }

    if (service_index == index - 1)
    {
        service_availability = value == 0 ? FALSE : TRUE;
    }

    realind = bta_hf_client_cb.scb.at_cb.indicator_lookup[index - 1];

    if(realind >= 0 && realind < BTA_HF_CLIENT_AT_SUPPORTED_INDICATOR_COUNT)
@@ -1588,6 +1575,11 @@ void bta_hf_client_send_at_cops(BOOLEAN query)

    APPL_TRACE_DEBUG("%s", __FUNCTION__);

    if (!service_availability)
    {
        APPL_TRACE_DEBUG("Skip AT+COPS no service");
        return;
    }
    if (query)
        buf = "AT+COPS?\r";
    else
@@ -1745,6 +1737,11 @@ void bta_hf_client_send_at_cnum(void)

    APPL_TRACE_DEBUG("%s", __FUNCTION__);

    if (!service_availability)
    {
        APPL_TRACE_DEBUG("Skip AT+CNUM no Service");
        return;
    }
    buf = "AT+CNUM\r";

    bta_hf_client_send_at(BTA_HF_CLIENT_AT_CNUM, buf, strlen(buf));
@@ -1758,7 +1755,7 @@ void bta_hf_client_send_at_nrec(void)

    if (!(bta_hf_client_cb.scb.peer_features & BTA_HF_CLIENT_PEER_FEAT_ECNR))
    {
        APPL_TRACE_ERROR("%s: Remote does not support NREC.", __FUNCTION__);
        APPL_TRACE_DEBUG("Remote does not support NREC.");
        return;
    }

Loading