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

Commit 7429bd33 authored by Thomas.TT_Lin's avatar Thomas.TT_Lin Committed by Andre Eisenbach
Browse files

Automatically determine transport to used to read RSSI.



Determine the transport to use for BTM_ReadRSSI based on the
device type of the remote device.

Bug: 16694076
Change-Id: I5a591f9d629547b63a750cefd7feb72899922595
Signed-off-by: default avatarThomas.TT_Lin <Thomas.TT_Lin@htc.com>
parent 5fa1ed0f
Loading
Loading
Loading
Loading

system/stack/btm/btm_acl.c

100644 → 100755
+12 −2
Original line number Original line Diff line number Diff line
@@ -2938,7 +2938,11 @@ void btm_qos_setup_complete (UINT8 status, UINT16 handle, FLOW_SPEC *p_flow)
tBTM_STATUS BTM_ReadRSSI (BD_ADDR remote_bda, tBTM_CMPL_CB *p_cb)
tBTM_STATUS BTM_ReadRSSI (BD_ADDR remote_bda, tBTM_CMPL_CB *p_cb)
{
{
    tACL_CONN   *p;
    tACL_CONN   *p;

    tBT_TRANSPORT transport = BT_TRANSPORT_BR_EDR;
#if BLE_INCLUDED == TRUE
    tBT_DEVICE_TYPE dev_type;
    tBLE_ADDR_TYPE  addr_type;
#endif
    BTM_TRACE_API ("BTM_ReadRSSI: RemBdAddr: %02x%02x%02x%02x%02x%02x",
    BTM_TRACE_API ("BTM_ReadRSSI: RemBdAddr: %02x%02x%02x%02x%02x%02x",
                    remote_bda[0], remote_bda[1], remote_bda[2],
                    remote_bda[0], remote_bda[1], remote_bda[2],
                    remote_bda[3], remote_bda[4], remote_bda[5]);
                    remote_bda[3], remote_bda[4], remote_bda[5]);
@@ -2947,7 +2951,13 @@ tBTM_STATUS BTM_ReadRSSI (BD_ADDR remote_bda, tBTM_CMPL_CB *p_cb)
    if (btm_cb.devcb.p_rssi_cmpl_cb)
    if (btm_cb.devcb.p_rssi_cmpl_cb)
        return(BTM_BUSY);
        return(BTM_BUSY);


    p = btm_bda_to_acl(remote_bda, BT_TRANSPORT_BR_EDR);
#if BLE_INCLUDED == TRUE
    BTM_ReadDevInfo(remote_bda, &dev_type, &addr_type);
    if (dev_type == BT_DEVICE_TYPE_BLE)
        transport = BT_TRANSPORT_LE;
#endif

    p = btm_bda_to_acl(remote_bda, transport);
    if (p != (tACL_CONN *)NULL)
    if (p != (tACL_CONN *)NULL)
    {
    {
        btu_start_timer (&btm_cb.devcb.rssi_timer, BTU_TTYPE_BTM_ACL,
        btu_start_timer (&btm_cb.devcb.rssi_timer, BTU_TTYPE_BTM_ACL,