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

Commit c9068691 authored by Andre Eisenbach's avatar Andre Eisenbach
Browse files

Serialize remote version query over LE

Some devices (ex. Nexus Player remote) do not take well to having the
remote version queried while a remote feature request is also sent and
subsequently fail encryption.

This patch serializes the query of the remote version and requires both
remote features and the remote version to be read before calling a
connection established.

Bug: 25357767
Change-Id: Ie70eea241b47b81778d8e0df47f3a8f376316932
parent 532a2631
Loading
Loading
Loading
Loading
+12 −8
Original line number Diff line number Diff line
@@ -268,8 +268,8 @@ void btm_acl_created (BD_ADDR bda, DEV_CLASS dc, BD_NAME bdn,
            if (transport == BT_TRANSPORT_BR_EDR)
            {
                btsnd_hcic_read_rmt_clk_offset (p->hci_handle);
            }
                btsnd_hcic_rmt_ver_req (p->hci_handle);
            }
            p_dev_rec = btm_find_dev_by_handle (hci_handle);

#if (BLE_INCLUDED == TRUE)
@@ -911,21 +911,25 @@ void btm_read_remote_version_complete (UINT8 *p)
    UINT16            handle;
    int               xx;
    BTM_TRACE_DEBUG ("btm_read_remote_version_complete");

    STREAM_TO_UINT8  (status, p);
    if (status == HCI_SUCCESS)
    {
    STREAM_TO_UINT16 (handle, p);

    /* Look up the connection by handle and copy features */
    for (xx = 0; xx < MAX_L2CAP_LINKS; xx++, p_acl_cb++)
    {
        if ((p_acl_cb->in_use) && (p_acl_cb->hci_handle == handle))
        {
            if (status == HCI_SUCCESS)
            {
                STREAM_TO_UINT8  (p_acl_cb->lmp_version, p);
                STREAM_TO_UINT16 (p_acl_cb->manufacturer, p);
                STREAM_TO_UINT16 (p_acl_cb->lmp_subversion, p);
                break;
            }

            if (p_acl_cb->transport == BT_TRANSPORT_LE)
                l2cble_notify_le_connection (p_acl_cb->remote_addr);
            break;
        }
    }
}
+1 −2
Original line number Diff line number Diff line
@@ -3215,8 +3215,7 @@ void btm_ble_read_remote_features_complete(UINT8 *p)
            if ((p_acl_cb->in_use) && (p_acl_cb->hci_handle == handle))
            {
                STREAM_TO_ARRAY(p_acl_cb->peer_le_features, p, BD_FEATURES_LEN);
                /*notify link up here */
                l2cble_notify_le_connection (p_acl_cb->remote_addr);
                btsnd_hcic_rmt_ver_req (p_acl_cb->hci_handle);
                break;
            }
        }
+1 −0
Original line number Diff line number Diff line
@@ -190,6 +190,7 @@ void smp_send_app_cback(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
                            (const bt_bdaddr_t *)&p_cb->pairing_bda))
                    {
                        p_cb->loc_auth_req &= ~SMP_KP_SUPPORT_BIT;
                        p_cb->loc_auth_req &= ~SMP_SC_SUPPORT_BIT;
                        p_cb->local_i_key &= ~SMP_SEC_KEY_TYPE_LK;
                        p_cb->local_r_key &= ~SMP_SEC_KEY_TYPE_LK;
                    }