From c2bad08f4560914321c2f7734fba29ea525e7080 Mon Sep 17 00:00:00 2001 From: "jihwan.seo" Date: Wed, 16 Sep 2015 22:28:36 +0900 Subject: [PATCH] removed unneccessary code to check sending data in BLE although data is sending, error message is calling from unnecessary spot. it have to modify Change-Id: I4172da1ec18707a12bd02775bd78ee68511a4a52 Signed-off-by: jihwan.seo Reviewed-on: https://gerrit.iotivity.org/gerrit/2595 Tested-by: jenkins-iotivity Reviewed-by: Patrick Lankswert --- .../src/bt_le_adapter/android/caleclient.c | 28 ++++++++++------------ 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/resource/csdk/connectivity/src/bt_le_adapter/android/caleclient.c b/resource/csdk/connectivity/src/bt_le_adapter/android/caleclient.c index 7b9c16c..6742cd1 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/android/caleclient.c +++ b/resource/csdk/connectivity/src/bt_le_adapter/android/caleclient.c @@ -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 -- 2.7.4