removed retry code for uncommon case in android BLE
authorjihwan.seo <jihwan.seo@samsung.com>
Wed, 25 May 2016 10:48:22 +0000 (19:48 +0900)
committerJon A. Cruz <jon@joncruz.org>
Fri, 3 Jun 2016 08:57:39 +0000 (08:57 +0000)
Change-Id: I9ae6ae4c620c785f608908aa05a3ff3f92a2c3ac
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/8329
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jon A. Cruz <jon@joncruz.org>
resource/csdk/connectivity/src/bt_le_adapter/android/caleclient.c

index 7f0ffd2..6241998 100644 (file)
@@ -4148,51 +4148,20 @@ Java_org_iotivity_ca_CaLeClientInterface_caLeGattConnectionStateChangeCallback(J
             OIC_LOG(ERROR, TAG, "CALEClientGattClose has failed");
         }
 
-        if (GATT_ERROR == status)
+        if (CALECheckConnectionStateValue(status))
         {
-            // when we get GATT ERROR(0x85), gatt connection can be called again.
-            OIC_LOG(INFO, TAG, "retry gatt connect");
-
-            jstring leAddress = CALEClientGetAddressFromGatt(env, gatt);
-            if (!leAddress)
-            {
-                OIC_LOG(ERROR, TAG, "CALEClientGetAddressFromGatt has failed");
-                goto error_exit;
-            }
-
-            jobject btObject = CALEGetRemoteDevice(env, leAddress);
-            if (!btObject)
-            {
-                OIC_LOG(ERROR, TAG, "CALEGetRemoteDevice has failed");
-                goto error_exit;
-            }
-
-            jobject newGatt = CALEClientConnect(env, btObject, JNI_TRUE);
-            if (!newGatt)
-            {
-                OIC_LOG(ERROR, TAG, "CALEClientConnect has failed");
-                goto error_exit;
-            }
-
-            return;
+            // this state is unexpected reason to disconnect
+            // if the reason is suitable, connection logic of the device will be destroyed.
+            OIC_LOG(INFO, TAG, "connection logic destroy");
+            goto error_exit;
         }
         else
         {
-            if (CALECheckConnectionStateValue(status))
-            {
-                // this state is unexpected reason to disconnect
-                // if the reason is suitable, connection logic of the device will be destroyed.
-                OIC_LOG(INFO, TAG, "connection logic destroy");
-                goto error_exit;
-            }
-            else
-            {
-                // other reason except for gatt_success is expected to running
-                // background connection in BT platform.
-                OIC_LOG(INFO, TAG, "unknown status or manual disconnected state");
-                CALEClientUpdateSendCnt(env);
-                return;
-            }
+            // other reason except for gatt_success is expected to running
+            // background connection in BT platform.
+            OIC_LOG(INFO, TAG, "unknown status or manual disconnected state");
+            CALEClientUpdateSendCnt(env);
+            return;
         }
 
         if (g_sendBuffer)