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

Commit c29d94ab authored by Nitin Arora's avatar Nitin Arora
Browse files

Bluetooth: Changes to enable features on KWD

This patch contains changes needed to enable features,
multiple advertisment, packet content filtering and
privacy mode on kwd branch

Change-Id: If95bfb38eafe26f16db20e7650865c2f19553548
parent 9f12e211
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -430,10 +430,12 @@ tBTM_STATUS BTM_BleBroadcast(BOOLEAN start)
*******************************************************************************/
static void btm_ble_vendor_capability_vsc_cmpl_cback (tBTM_VSC_CMPL *p_vcs_cplt_params)
{
    BTM_TRACE_EVENT0 ("btm_ble_vendor_capability_vsc_cmpl_cback");
    UINT8  status = 0xFF, *p;
    UINT8  rpa_offloading, max_irk_list_sz, filtering_support, max_filter;
    UINT16 scan_result_storage;

    tBTM_BLE_VENDOR_CB  *p_vcb = &btm_ble_vendor_cb;
    max_irk_list_sz = 0;
    /* Check status of command complete event */
    if((p_vcs_cplt_params->opcode == HCI_BLE_VENDOR_CAP_OCF)
        &&(p_vcs_cplt_params->param_len > 0 ))
@@ -451,6 +453,8 @@ static void btm_ble_vendor_capability_vsc_cmpl_cback (tBTM_VSC_CMPL *p_vcs_cplt_
        STREAM_TO_UINT8  (filtering_support, p);
        STREAM_TO_UINT8  (max_filter, p);
    }
    p_vcb->irk_avail_size = max_irk_list_sz;
    BTM_TRACE_EVENT3 ("btm_ble_vendor_capability_vsc_cmpl_cback:%d, status=%d, max_irk_size=%d", btm_multi_adv_cb.adv_inst_max, status,btm_ble_vendor_cb.irk_avail_size);
}

/*******************************************************************************
@@ -464,6 +468,8 @@ static void btm_ble_vendor_capability_vsc_cmpl_cback (tBTM_VSC_CMPL *p_vcs_cplt_
*******************************************************************************/
void btm_ble_vendor_capability_init(void)
{
    BTM_TRACE_ERROR0("btm_ble_vendor_capability_init");
    memset(&btm_ble_vendor_cb, 0, sizeof(tBTM_BLE_VENDOR_CB));
    if ( BTM_VendorSpecificCommand (HCI_BLE_VENDOR_CAP_OCF,
                                    0,
                                    NULL,
+2 −0
Original line number Diff line number Diff line
@@ -671,6 +671,8 @@ void btm_reset_complete (void)
     btm_cb.ble_ctr_cb.p_select_cback = NULL;
     memset(&btm_cb.ble_ctr_cb.bg_dev_list, 0, (sizeof(tBTM_LE_BG_CONN_DEV)*BTM_BLE_MAX_BG_CONN_DEV_NUM));
     gatt_reset_bgdev_list();
     btm_ble_multi_adv_init();
     btm_ble_vendor_capability_init();
#endif
    }
}
+1 −0
Original line number Diff line number Diff line
@@ -784,6 +784,7 @@ BTM_API extern void BTM_BleSetPrefConnParams (BD_ADDR bd_addr,
**
*******************************************************************************/
BTM_API extern  void BTM_BleSetConnScanParams (UINT16 scan_interval, UINT16 scan_window);
BTM_API extern  void btm_ble_vendor_capability_init(void);

/*******************************************************************************
**
+1 −1
Original line number Diff line number Diff line
@@ -630,7 +630,7 @@ BOOLEAN l2cble_init_direct_conn (tL2C_LCB *p_lcb)
    if (p_dev_rec->ble.active_addr_type == BTM_BLE_ADDR_RRA)
    {
        init_addr_type = BLE_ADDR_RANDOM;
        memcpy(init_addr, p_dev_rec->ble.cur_rand_addr, BD_ADDR_LEN);
        //memcpy(init_addr, p_dev_rec->ble.cur_rand_addr, BD_ADDR_LEN);
    }
    /* if privacy is on and current do not consider using reconnection address */
    if (btm_cb.ble_ctr_cb.privacy ) /* && p_dev_rec->ble.use_reconn_addr */
+10 −6
Original line number Diff line number Diff line
@@ -105,7 +105,6 @@ void btm_ble_vendor_scan_pf_cmpl_cback(tBTM_VSC_CMPL *p_params)
        return;
    }
    op_subcode   = *p ++;

        switch (op_subcode)
        {
        case BTM_BLE_META_PF_LOCAL_NAME:
@@ -530,7 +529,7 @@ tBTM_STATUS btm_ble_update_uuid_filter(tBTM_BLE_SCAN_COND_OP action,
{
    UINT8       param[BTM_BLE_META_UUID_LEN + BTM_BLE_META_HDR_LENGTH],
                * p= param,
                len = BTM_BLE_META_HDR_LENGTH + 7;
                len = BTM_BLE_META_HDR_LENGTH;
    tBTM_STATUS st = BTM_ILLEGAL_VALUE;
    tBTM_BLE_PF_UUID_COND *p_uuid_cond;
    UINT8           evt_type;
@@ -1153,14 +1152,19 @@ void btm_ble_vendor_irk_vsc_op_cmpl (tBTM_VSC_CMPL *p_params)

    evt_len--;

    /*if (evt_len < 2 )
    {
        BTM_TRACE_ERROR0("can not interpret IRK  VSC cmpl callback");
        return;
    }*/
    op_subcode   = *p ++;
    BTM_TRACE_DEBUG1("btm_ble_vendor_irk_vsc_op_cmpl op_subcode = %d", op_subcode);
    if (evt_len < 2 )
    {
        BTM_TRACE_ERROR0("can not interpret IRK  VSC cmpl callback");
        return;
    }
    op_subcode   = *p ++;

    BTM_TRACE_DEBUG1("btm_ble_vendor_irk_vsc_op_cmpl op_subcode = %d", op_subcode);

    if (op_subcode == BTM_BLE_META_CLEAR_IRK_LIST)
    {
@@ -1386,7 +1390,7 @@ BOOLEAN btm_ble_vendor_irk_list_load_dev(tBTM_SEC_DEV_REC *p_dev_rec)
    tBTM_BLE_VENDOR_CB  *p_cb = &btm_ble_vendor_cb;
    BOOLEAN         rt = FALSE;
    tBTM_BLE_IRK_ENTRY  *p_irk_entry = NULL;

    BTM_TRACE_DEBUG1 ("btm_ble_vendor_irk_list_load_dev:max_irk_size=%d", p_cb->irk_avail_size);
    memset(param, 0, 40);

    if (p_dev_rec != NULL && /* RPA is being used and PID is known */
@@ -1523,7 +1527,7 @@ tBTM_STATUS BTM_BleEnableIRKFeature(BOOLEAN enable)
*******************************************************************************/
void btm_ble_vendor_init(void)
{
    memset(&btm_ble_vendor_cb, 0, sizeof(tBTM_BLE_VENDOR_CB));
    //memset(&btm_ble_vendor_cb, 0, sizeof(tBTM_BLE_VENDOR_CB));

    if (!HCI_LE_HOST_SUPPORTED(btm_cb.devcb.local_lmp_features[HCI_EXT_FEATURES_PAGE_1]))
        return;
Loading