Modified logic for LE scanning 69/199569/1 accepted/tizen/5.0/unified/20190214.060742 submit/tizen_5.0/20190213.055525
authorKush Agrawal <kush.agrawal@samsung.com>
Mon, 11 Feb 2019 15:00:44 +0000 (20:30 +0530)
committerAbhishek Sansanwal <abhishek.s94@samsung.com>
Wed, 13 Feb 2019 05:44:49 +0000 (00:44 -0500)
Issue : If scan fails once and if we retry from above layer then scan is not started.
Cause : Scan was not started for device which is already added once in server list.

Fix : Changed logic by enabling scan for devices which are already added and in UNICAST_PENDING state

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/412
(cherry picked from 3106e414dbe8807c50b439cc19e6b94e86ab50ac)

Change-Id: I5c18ed79099e0f4245fd8b75a7191459bd0357ec
Signed-off-by: Kush Agrawal <kush.agrawal@samsung.com>
Signed-off-by: Abhishek Sansanwal <abhishek.s94@samsung.com>
resource/csdk/connectivity/src/bt_le_adapter/tizen/caleclient.c
resource/csdk/connectivity/src/bt_le_adapter/tizen/caleclient_vd.c

index ad5765a..91bfa18 100644 (file)
@@ -1404,7 +1404,10 @@ CAResult_t CAUpdateCharacteristicsToGattServer(const char *remoteAddress,
                 OIC_LOG(ERROR, TAG, "Could not add data to pending list");
                 return CA_STATUS_FAILED;
             }
+        }
 
+        if(serverInfo->status == LE_STATUS_UNICAST_PENDING)
+        {
             oc_mutex_lock(g_scanMutex);
             if (!g_isMulticastInProgress && !g_isUnicastScanInProgress)
             {
index 0b79771..18b63e6 100644 (file)
@@ -1449,7 +1449,10 @@ CAResult_t CAUpdateCharacteristicsToGattServer(const char *remoteAddress,
                 OIC_LOG(ERROR, TAG, "Could not add data to pending list");
                 return CA_STATUS_FAILED;
             }
+        }
 
+        if(serverInfo->status == LE_STATUS_UNICAST_PENDING)
+        {
             oc_mutex_lock(g_scanMutex);
             if (!g_isMulticastInProgress && !g_isUnicastScanInProgress)
             {