Apply print log method in Android EDR adapter. 53/14953/2
authorjihwan.seo <jihwan.seo@samsung.com>
Wed, 30 Nov 2016 06:48:58 +0000 (15:48 +0900)
committerAshok Babu Channa <ashok.channa@samsung.com>
Mon, 5 Dec 2016 07:22:06 +0000 (07:22 +0000)
Change-Id: I7d88f7f140781ea23db02d0bfbf00f66cd145a13
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/14953
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: byonggon chun <bg.chun@samsung.com>
Reviewed-by: Jaehong Jo <jaehong.jo@samsung.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
Reviewed-by: Larry Sachs <larry.j.sachs@intel.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
resource/csdk/connectivity/src/bt_edr_adapter/android/caedrclient.c

index cc7a58b..d29de99 100644 (file)
@@ -854,6 +854,7 @@ CAResult_t CAEDRNativeSendData(JNIEnv *env, const char *address, const uint8_t *
             if ((*env)->ExceptionCheck(env))
             {
                 OIC_LOG(ERROR, TAG, "Failed to write data in outputStram");
+                CALogSendStateInfo(CA_ADAPTER_RFCOMM_BTEDR, address, 0, dataLength, false, NULL);
                 (*env)->ExceptionDescribe(env);
                 (*env)->ExceptionClear(env);
                 return CA_STATUS_FAILED;
@@ -861,12 +862,14 @@ CAResult_t CAEDRNativeSendData(JNIEnv *env, const char *address, const uint8_t *
 
             OIC_LOG_V(INFO, TAG, "EDR sendTo is successful: %u bytes, to %s",
                       dataLength, address);
+            CALogSendStateInfo(CA_ADAPTER_RFCOMM_BTEDR, address, 0, dataLength, true, NULL);
         }
         else
         {
+            OIC_LOG(ERROR, TAG, "error!!");
+            CALogSendStateInfo(CA_ADAPTER_RFCOMM_BTEDR, address, 0, dataLength, false, NULL);
             (*env)->ExceptionDescribe(env);
             (*env)->ExceptionClear(env);
-            OIC_LOG(ERROR, TAG, "error!!");
             return CA_STATUS_FAILED;
         }
     }
@@ -1029,6 +1032,7 @@ CAResult_t CAEDRNativeConnect(JNIEnv *env, const char *address)
 
     if ((*env)->ExceptionCheck(env))
     {
+        CALogSendStateInfo(CA_ADAPTER_RFCOMM_BTEDR, address, 0, 0, false, "Connect has Failed");
         OIC_LOG(ERROR, TAG, "Connect is Failed!!!");
         (*env)->ExceptionDescribe(env);
         (*env)->ExceptionClear(env);