if (!g_deviceList)
{
+ OIC_LOG(ERROR, TAG, "g_deviceList is not available");
return CA_STATUS_FAILED;
}
return CA_STATUS_FAILED;
}
}
+ else
+ {
+ OIC_LOG(DEBUG, TAG, "there is a target device in the scanned devices");
+ }
return CA_STATUS_OK;
}
(*env)->ReleaseStringUTFChars(env, jni_setAddress, setAddress);
(*env)->DeleteLocalRef(env, jni_setAddress);
- // stop scan while sending
- CALEClientStopScanWithInterval();
-
if (g_sendBuffer)
{
(*env)->DeleteGlobalRef(env, g_sendBuffer);
(*g_jvm)->DetachCurrentThread(g_jvm);
}
- // start LE Scan again
- ret = CALEClientStartScanWithInterval();
- if (CA_STATUS_OK != ret)
- {
- OIC_LOG(ERROR, TAG, "CALEClientStartScanWithInterval has failed");
- ca_mutex_unlock(g_threadSendMutex);
- return ret;
- }
-
ca_mutex_unlock(g_threadSendMutex);
OIC_LOG(INFO, TAG, "unicast - send logic has finished");
if (CALEClientIsValidState(address, CA_LE_SEND_STATE,
// error label.
error_exit:
-
- // start LE Scan again
- ret = CALEClientStartScanWithInterval();
- if (CA_STATUS_OK != ret)
- {
- OIC_LOG(ERROR, TAG, "CALEClientStartScanWithInterval has failed");
- ca_mutex_unlock(g_threadSendMutex);
- if (isAttached)
- {
- (*g_jvm)->DetachCurrentThread(g_jvm);
- }
- return ret;
- }
-
if (isAttached)
{
(*g_jvm)->DetachCurrentThread(g_jvm);
goto error_exit;
}
- // stop scan while sending
- CALEClientStopScanWithInterval();
-
uint32_t length = u_arraylist_length(g_deviceList);
g_targetCnt = length;
OIC_LOG(DEBUG, TAG, "the data was sent");
}
ca_mutex_unlock(g_threadMutex);
-
- // start LE Scan again
- res = CALEClientStartScanWithInterval();
- if (CA_STATUS_OK != res)
- {
- OIC_LOG(ERROR, TAG, "CALEClientStartScanWithInterval has failed");
- ca_mutex_unlock(g_threadSendMutex);
- return res;
- }
-
ca_mutex_unlock(g_threadSendMutex);
OIC_LOG(DEBUG, TAG, "OUT - CALEClientSendMulticastMessageImpl");
return CA_STATUS_OK;
error_exit:
- res = CALEClientStartScanWithInterval();
- if (CA_STATUS_OK != res)
- {
- OIC_LOG(ERROR, TAG, "CALEClientStartScanWithInterval has failed");
- ca_mutex_unlock(g_threadSendMutex);
- return res;
- }
-
ca_mutex_unlock(g_threadSendMutex);
- OIC_LOG(DEBUG, TAG, "OUT - CALEClientSendMulticastMessageImpl");
+ OIC_LOG(ERROR, TAG, "OUT - CALEClientSendMulticastMessageImpl");
return CA_SEND_FAILED;
}
if (!g_deviceList)
{
OIC_LOG(ERROR, TAG, "gdevice_list is null");
- CALEClientStopScanWithInterval();
-
ca_mutex_unlock(g_deviceListMutex);
return CA_STATUS_FAILED;
}