static int retry_flag = 0;
uint64_t const TIMEOUT = 30 * MICROSECS_PER_SEC;
-#ifndef TIZEN_VD
/**
* Mutex to call connect only after disconnect during retry
*/
* Condition for calling connect during connection retry
*/
static oc_cond g_LEDisconnectedCond = NULL;
-#endif
/**
* Flag to check if scanning is in progress
return CA_STATUS_FAILED;
}
g_isConnectionInProgress = true;
-#ifndef TIZEN_VD
// Set gatt connect retry count
g_retrycount = RETRY_COUNT;
-#endif
oc_mutex_unlock(g_isConnectionInProgressMutex);
// Pause the scanning
if (!connected)
{
OIC_LOG_V(DEBUG, TAG, "DisConnected from [%s] ", remoteAddress);
-#ifdef TIZEN_VD
- oc_mutex_lock(g_LEServerListMutex);
- CARemoveLEServerInfoFromList(&g_LEServerList, remoteAddress);
- oc_mutex_unlock(g_LEServerListMutex);
-#else
if(!retry_flag)
{
oc_mutex_lock(g_LEServerListMutex);
oc_mutex_unlock(g_isDisconnectedMutex);
}
retry_flag = 0;
-#endif
}
else
{
oc_mutex_unlock(g_LEServerListMutex);
}
-
OIC_LOG(DEBUG, TAG, "OUT");
}
}
}
-#ifndef TIZEN_VD
if (NULL == g_isDisconnectedMutex)
{
g_isDisconnectedMutex = oc_mutex_new();
return CA_STATUS_FAILED;
}
}
-#endif
if (NULL == g_startTimerCond)
{
oc_mutex_free(g_threadMTUChangedMutex);
g_threadMTUChangedMutex = NULL;
-#ifndef TIZEN_VD
oc_mutex_free(g_isDisconnectedMutex);
g_isDisconnectedMutex = NULL;
oc_cond_free(g_LEDisconnectedCond);
g_LEDisconnectedCond = NULL;
-#endif
oc_cond_free(g_startTimerCond);
g_startTimerCond = NULL;
OIC_LOG(DEBUG, TAG, "OUT");
}
-#ifndef TIZEN_VD
static int CALEWaittillDisconnect(oc_mutex mutex, oc_cond cv, int wait_seconds)
{
OIC_LOG(DEBUG, TAG, "Waiting for server to be disconnected...");
OIC_LOG(DEBUG, TAG, "OUT");
return result;
}
-#endif
CAResult_t CALEGattDiscoverServices(const char *remoteAddress)
{
{
OIC_LOG_V(ERROR, TAG,
"bt_gatt_client_get_service Failed with ret value [%s] ", CALEGetErrorMsg(ret));
-#ifdef TIZEN_VD
- goto error_exit;
-#else
+
if(g_retrycount)
{
OIC_LOG(DEBUG, TAG, "Retry will be attempted to connect Gatt Server");
return CA_STATUS_FAILED;
}
}
-#endif
}
retry_flag = 0;