[IOT-1478] add stop scan logic for BLE, when stack is terminated
authorjihwan.seo <jihwan.seo@samsung.com>
Wed, 26 Oct 2016 11:14:57 +0000 (20:14 +0900)
committerAshok Babu Channa <ashok.channa@samsung.com>
Thu, 27 Oct 2016 06:59:26 +0000 (06:59 +0000)
Change-Id: I2454bb3f24c0aa3f821a24d494d8ab7db2d52bf2
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/13717
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
resource/csdk/connectivity/src/bt_le_adapter/android/caleclient.c

index 09d294a..6b75592 100644 (file)
@@ -497,6 +497,13 @@ void CALEClientTerminate()
         isAttached = true;
     }
 
+    // stop scan
+    CAResult_t ret = CALEClientStopScan();
+    if (CA_STATUS_OK != ret)
+    {
+        OIC_LOG(INFO, TAG, "CALEClientStopScan has failed");
+    }
+
     if (g_leScanCallback)
     {
         (*env)->DeleteGlobalRef(env, g_leScanCallback);
@@ -521,7 +528,7 @@ void CALEClientTerminate()
         g_uuidList = NULL;
     }
 
-    CAResult_t ret = CALEClientRemoveAllDeviceState();
+    ret = CALEClientRemoveAllDeviceState();
     if (CA_STATUS_OK != ret)
     {
         OIC_LOG(ERROR, TAG, "CALEClientRemoveAllDeviceState has failed");