removed unneccessary code to check sending data in BLE
authorjihwan.seo <jihwan.seo@samsung.com>
Wed, 16 Sep 2015 13:28:36 +0000 (22:28 +0900)
committerPatrick Lankswert <patrick.lankswert@intel.com>
Wed, 16 Sep 2015 21:38:06 +0000 (21:38 +0000)
although data is sending,
error message is calling from unnecessary spot.
it have to modify

Change-Id: I4172da1ec18707a12bd02775bd78ee68511a4a52
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/2595
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Patrick Lankswert <patrick.lankswert@intel.com>
resource/csdk/connectivity/src/bt_le_adapter/android/caleclient.c

index 7b9c16c..6742cd1 100644 (file)
@@ -595,13 +595,6 @@ CAResult_t CALEClientSendUnicastMessageImpl(const char* address, const uint8_t*
         (*g_jvm)->DetachCurrentThread(g_jvm);
     }
 
-    ret = CALECheckSendState(address);
-    if(CA_STATUS_OK != ret)
-    {
-        OIC_LOG(ERROR, TAG, "send has failed");
-        goto error_exit;
-    }
-
     // start LE Scan again
     ret = CALEClientStartScan();
     if (CA_STATUS_OK != ret)
@@ -635,6 +628,11 @@ error_exit:
     {
         (*g_jvm)->DetachCurrentThread(g_jvm);
     }
+
+    if (g_clientErrorCallback)
+    {
+        g_clientErrorCallback(address, data, dataLen, CA_SEND_FAILED);
+    }
     ca_mutex_unlock(g_threadSendMutex);
     return CA_SEND_FAILED;
 }
@@ -735,15 +733,6 @@ CAResult_t CALEClientSendMulticastMessageImpl(JNIEnv *env, const uint8_t* data,
             continue;
         }
 
-        res = CALECheckSendState(address);
-        if (CA_STATUS_OK != res)
-        {
-            OIC_LOG_V(INFO, TAG, "multicast : send has failed for this device[%s]", address);
-            g_clientErrorCallback(address, data, dataLen, res);
-            (*env)->ReleaseStringUTFChars(env, jni_address, address);
-            continue;
-        }
-
         (*env)->ReleaseStringUTFChars(env, jni_address, address);
     }
 
@@ -3520,6 +3509,13 @@ Java_org_iotivity_ca_CaLeClientInterface_caLeGattCharacteristicWriteCallback(
         {
             OIC_LOG(ERROR, TAG, "CALEClientUpdateDeviceState has failed");
         }
+
+        if (g_clientErrorCallback)
+        {
+            jint length = (*env)->GetArrayLength(env, data);
+            g_clientErrorCallback(address, data, length, CA_SEND_FAILED);
+        }
+
         CALEClientSendFinish(env, gatt);
     }
     else