to enable manual disconnect callback for android BLE client
authorjihwan.seo <jihwan.seo@samsung.com>
Mon, 4 Apr 2016 10:29:33 +0000 (19:29 +0900)
committerJon A. Cruz <jon@joncruz.org>
Tue, 5 Apr 2016 06:54:58 +0000 (06:54 +0000)
Change-Id: I7254b9485393957b8b823aeb0d6e19dde10911de
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/7577
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jon A. Cruz <jon@joncruz.org>
resource/csdk/connectivity/util/src/camanager/android/caleconnectionmanager.c

index c4e43e3..b41ded0 100644 (file)
@@ -448,17 +448,20 @@ Java_org_iotivity_ca_CaLeClientInterface_caManagerLeGattConnectionStateChangeCB(
     }
     else if (state_disconnected == newState)// le disconnected
     {
-        if (LINK_LOSS == status || REMOTE_DISCONNECT == status)
-        {
-            OIC_LOG(DEBUG, TAG, "LE is disconnected");
+        OIC_LOG(DEBUG, TAG, "LE is disconnected");
 
+        if (CONNECTION_FAILED_TO_BE_EASTABLISHED != status)
+        {
             if (g_connStateCB)
             {
                 OIC_LOG_V(DEBUG, TAG, "LE Disconnected state is %d, %s", newState, address);
                 g_connStateCB(CA_ADAPTER_GATT_BTLE, address, false);
                 OIC_LOG(DEBUG, TAG, "LE Disconnected state callback is called");
             }
+        }
 
+        if (LINK_LOSS == status || REMOTE_DISCONNECT == status)
+        {
             if (!CAManagerIsMatchedACData(env, jni_address))
             {
                 OIC_LOG_V(DEBUG, TAG, "this[%s] is not target address for Auto Connection",