OSDN Git Service

Find connection ID on BR/EDR
authorChao Quan <chao.quan@mediatek.com>
Mon, 23 Oct 2017 11:56:16 +0000 (19:56 +0800)
committerJakub Pawlowski <jpawlowski@google.com>
Tue, 5 Dec 2017 12:55:56 +0000 (12:55 +0000)
GATT profile may send service change indication to its
connected client and gatt_profile_find_conn_id_by_bd_addr
function helps gatt profile to find its connected client.
Gatt profile may use a BR/EDR link. So need to check it
also to avoid missing.

Test: manual
Change-Id: Ieb64cf6eab9d94352440c876be69990a7a4eb57f

stack/gatt/gatt_attr.cc

index 07968fe..7a559cf 100644 (file)
@@ -84,6 +84,9 @@ uint16_t gatt_profile_find_conn_id_by_bd_addr(const RawAddress& remote_bda) {
   uint16_t conn_id = GATT_INVALID_CONN_ID;
   GATT_GetConnIdIfConnected(gatt_cb.gatt_if, remote_bda, &conn_id,
                             BT_TRANSPORT_LE);
+  if (conn_id == GATT_INVALID_CONN_ID)
+    GATT_GetConnIdIfConnected(gatt_cb.gatt_if, remote_bda, &conn_id,
+                              BT_TRANSPORT_BR_EDR);
   return conn_id;
 }