+ OIC_LOG_V(ERROR, TAG, "bt_device_is_profile_connected Failed with ret value [%s] ",
+ CALEGetErrorMsg(ret));
+ oc_mutex_unlock(g_LEServerListMutex);
+ return CA_STATUS_FAILED;
+ }
+
+ if (isConnected){
+ OIC_LOG_V(DEBUG, TAG, "Already connected to address [%s]", remoteAddress);
+ serverInfo->status = LE_STATUS_CONNECTED;
+ } else {
+ oc_mutex_lock(g_scanMutex);
+ if (!g_isMulticastInProgress && !g_isUnicastScanInProgress)
+ {
+ CAResult_t result = CALEGattStartDeviceScanning();
+ if (CA_STATUS_OK != result)
+ {
+ oc_mutex_unlock(g_scanMutex);
+ OIC_LOG(ERROR, TAG, "CALEGattStartDeviceScanning failed");
+ oc_mutex_unlock(g_LEServerListMutex);
+ return CA_STATUS_FAILED;
+ }
+ g_isUnicastScanInProgress = true;
+ // Start Timer
+ oc_cond_signal(g_startTimerCond);
+ }
+ else