g_threadSendMutex,
TIMEOUT) == OC_WAIT_SUCCESS)
{
+ OIC_LOG(DEBUG, TAG, "time out");
oc_mutex_lock(g_deviceListMutex);
size_t scannedDeviceLen = u_arraylist_length(g_deviceList);
oc_mutex_unlock(g_deviceListMutex);
CALEClientSetSendFinishFlag(true);
oc_mutex_unlock(g_threadMutex);
+ oc_mutex_lock(g_threadSendMutex);
+ OIC_LOG(DEBUG, TAG, "signal - g_deviceDesc cond");
+ oc_cond_signal(g_deviceDescCond);
+ oc_mutex_unlock(g_threadSendMutex);
+
oc_mutex_lock(g_threadWriteCharacteristicMutex);
OIC_LOG(DEBUG, TAG, "signal - WriteCharacteristic cond");
oc_cond_signal(g_threadWriteCharacteristicCond);
#ifndef SINGLE_THREAD
OIC_LOG(DEBUG, CALEADAPTER_TAG, "CALEAdapterGattServerStop");
- CAResult_t result = CAStopLEGattServer();
+ CAResult_t res = CAStopLEGattServer();
+ if (CA_STATUS_OK != res)
+ {
+ OIC_LOG(ERROR, CALEADAPTER_TAG, "CAStopLEGattServer has failed");
+ }
+
oc_mutex_lock(g_bleServerSendDataMutex);
- if (CA_STATUS_OK == result)
+ res = CAQueueingThreadStop(g_bleServerSendQueueHandle);
+ if (CA_STATUS_OK != res)
{
- result = CAQueueingThreadStop(g_bleServerSendQueueHandle);
+ OIC_LOG(ERROR, CALEADAPTER_TAG, "CAQueueingThreadStop has failed");
}
oc_mutex_unlock(g_bleServerSendDataMutex);
- return result;
+ return res;
#else
return CAStopLEGattServer();
#endif
static void CATerminateLE()
{
- OIC_LOG(DEBUG, CALEADAPTER_TAG, "IN");
+ OIC_LOG(DEBUG, CALEADAPTER_TAG, "IN - CATerminateLE");
CASetLEReqRespServerCallback(NULL);
CASetLEReqRespClientCallback(NULL);
CATerminateLEAdapterMutex();
- OIC_LOG(DEBUG, CALEADAPTER_TAG, "OUT");
+ OIC_LOG(DEBUG, CALEADAPTER_TAG, "OUT - CATerminateLE");
}
static CAResult_t CAStartLEListeningServer()