OSDN Git Service

Update GATT channel state to closing during disconnection
authorNitin Arora <niarora@codeaurora.org>
Thu, 14 May 2015 01:39:50 +0000 (18:39 -0700)
committerAndre Eisenbach <eisenbach@google.com>
Fri, 14 Oct 2016 20:13:04 +0000 (20:13 +0000)
This change ensures that the GATT channel state is
moved to CLOSING state while GATT disconnect is
requested by the host, specifically when the GATT
state is OPEN.
This is needed to prevent any furthur GATT operations,
once GATT disconnect is issued.

Change-Id: I8511caa477881de4f4eaf18b84f23530e1958fe9

stack/gatt/gatt_main.c

index f12fd25..d935710 100644 (file)
@@ -244,9 +244,9 @@ bool    gatt_disconnect (tGATT_TCB *p_tcb)
                 }
                 else
                 {
-                    gatt_set_ch_state(p_tcb, GATT_CH_CLOSING);
                     ret = L2CA_CancelBleConnectReq (p_tcb->peer_bda);
                 }
+                gatt_set_ch_state(p_tcb, GATT_CH_CLOSING);
             }
             else
             {