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

Commit 5b8dfe09 authored by Subramanian Srinivasan's avatar Subramanian Srinivasan Committed by Andre Eisenbach
Browse files

Use correct transport type for GATT client and server connections

Use correct transport type for GATT client and server connect
API calls. This change uses the transport used while calling
the connect frameworks API instead of relying on the NVRAM to
find the transport on which the connect call needs to be sent
to the BT stack.

Change-Id: Idf5817b8980e848c6ebebf1e9a79dbce61d8cfc8
parent 4ea8ff6b
Loading
Loading
Loading
Loading
+21 −15
Original line number Diff line number Diff line
@@ -1189,6 +1189,11 @@ static void btgattc_handle_event(uint16_t event, char* p_param)
                BTA_DmBleSetBgConnType(BTM_BLE_CONN_AUTO, NULL);
            }

            // Determine transport
            if (p_cb->transport != GATT_TRANSPORT_AUTO)
            {
                transport = p_cb->transport;
            } else {
                switch(device_type)
                {
                    case BT_DEVICE_TYPE_BREDR:
@@ -1206,10 +1211,11 @@ static void btgattc_handle_event(uint16_t event, char* p_param)
                            transport = BTA_GATT_TRANSPORT_BR_EDR;
                        break;
                }
            }

            // Connect!
            BTIF_TRACE_DEBUG ("BTA_GATTC_Open Transport  = %d, dev type = %d",
                                transport, device_type);
            BTIF_TRACE_DEBUG ("%s Transport=%d, device type=%d",
                                __func__, transport, device_type);
            BTA_GATTC_Open(p_cb->client_if, p_cb->bd_addr.address, p_cb->is_direct, transport);
            break;
        }
+23 −17
Original line number Diff line number Diff line
@@ -395,6 +395,11 @@ static void btgatts_handle_event(uint16_t event, char* p_param)
            if (!p_cb->is_direct)
                BTA_DmBleSetBgConnType(BTM_BLE_CONN_AUTO, NULL);

            // Determine transport
            if (p_cb->transport != GATT_TRANSPORT_AUTO)
            {
                transport = p_cb->transport;
            } else {
                switch(device_type)
                {
                    case BT_DEVICE_TYPE_BREDR:
@@ -413,9 +418,10 @@ static void btgatts_handle_event(uint16_t event, char* p_param)
                        break;

                    default:
                    BTIF_TRACE_ERROR (" GATT Open :Invalid device type %d",device_type);
                        BTIF_TRACE_ERROR ("%s: Invalid device type %d", __func__, device_type);
                        return;
                }
            }

            // Connect!
            BTA_GATTS_Open(p_cb->server_if, p_cb->bd_addr.address,