OSDN Git Service

Cancel the link idle timer during gatt_connect
authorPradeep Panigrahi <pradeepp@codeaurora.org>
Wed, 22 Mar 2017 06:02:40 +0000 (11:32 +0530)
committerGerrit - the friendly Code Review server <code-review@localhost>
Wed, 22 Mar 2017 08:28:17 +0000 (01:28 -0700)
When app use link count becomes zero, we start an link idle
timeout of 1 sec, post which we send disconnection. Meanwhile
if we get connect request from app to hold the link before
the 1 sec timer expiration, we should cancel the link idle
timer, other wise the link will get disconnected irrespective
of app use link count being greater than zero. Add change to
cancel the link idle timer while updating app's link hold count

CRs-Fixed: 2018001

Change-Id: I41682be1476d4c1c4ee58061407b94cfd2a2657a

stack/gatt/gatt_main.c

index 7b871ee..f2e58ff 100644 (file)
@@ -400,7 +400,7 @@ BOOLEAN gatt_act_connect (tGATT_REG *p_reg, BD_ADDR bd_addr,
     if (ret)
     {
         if (!opportunistic)
-            gatt_update_app_use_link_flag(p_reg->gatt_if, p_tcb, TRUE, FALSE);
+            gatt_update_app_use_link_flag(p_reg->gatt_if, p_tcb, TRUE, TRUE);
         else
             GATT_TRACE_DEBUG("%s: connection is opportunistic, not updating app usage",
                             __func__);