OSDN Git Service

Fix auto disconnect right after connecting
authorJakub Pawlowski <jpawlowski@google.com>
Wed, 10 Feb 2016 00:20:41 +0000 (16:20 -0800)
committerJakub Pawlowski <jpawlowski@google.com>
Wed, 10 Feb 2016 00:21:10 +0000 (16:21 -0800)
Change-Id: Ia36cd898c21058b9a3ed56a0d300c3ea8384a5cf

stack/gatt/gatt_api.c

index e142cb0..88351dd 100644 (file)
@@ -1285,11 +1285,6 @@ void GATT_Deregister (tGATT_IF gatt_if)
             if (gatt_get_ch_state(p_tcb) != GATT_CH_CLOSE)
             {
                 gatt_update_app_use_link_flag(gatt_if, p_tcb,  FALSE, FALSE);
-                if (!gatt_num_apps_hold_link(p_tcb))
-                {
-                    /* this will disconnect the link or cancel the pending connect request at lower layer*/
-                    gatt_disconnect(p_tcb);
-                }
             }
 
             for (j = 0, p_clcb= &gatt_cb.clcb[j]; j < GATT_CL_MAX_LCB; j++, p_clcb++)
@@ -1506,10 +1501,6 @@ tGATT_STATUS GATT_Disconnect (UINT16 conn_id)
     if (p_tcb)
     {
         gatt_update_app_use_link_flag(gatt_if, p_tcb, FALSE, FALSE);
-        if (!gatt_num_apps_hold_link(p_tcb))
-        {
-            gatt_disconnect(p_tcb);
-        }
         ret = GATT_SUCCESS;
     }
     return ret;