fix BLE MTU nego issue in writeDescriptor logic
authorjihwan.seo <jihwan.seo@samsung.com>
Wed, 25 Jan 2017 05:30:58 +0000 (14:30 +0900)
committerAshok Babu Channa <ashok.channa@samsung.com>
Fri, 27 Jan 2017 11:31:57 +0000 (11:31 +0000)
Change-Id: I84fa340afda3ecdee0a1f85bf0f63073c26d2a59
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/16755
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Jaehong Jo <jaehong.jo@samsung.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
resource/csdk/connectivity/src/bt_le_adapter/android/caleclient.c

index 8a00013..fef544b 100644 (file)
@@ -4926,14 +4926,11 @@ Java_org_iotivity_ca_CaLeClientInterface_caLeGattDescriptorWriteCallback(JNIEnv
         goto error_exit;
     }
 
-    if (g_sendBuffer)
+    res = CALEClientRequestMTU(env, gatt, CA_SUPPORTED_BLE_MTU_SIZE);
+    if (CA_STATUS_OK != res)
     {
-        CAResult_t res = CALEClientWriteCharacteristic(env, gatt);
-        if (CA_STATUS_OK != res)
-        {
-            OIC_LOG(ERROR, TAG, "CALEClientWriteCharacteristic has failed");
-            goto error_exit;
-        }
+        OIC_LOG(ERROR, TAG, "CALEClientRequestMTU has failed");
+        goto error_exit;
     }
     return;