+
+ if (GATT_SUCCESS != status) // error case
+ {
+ OIC_LOG(ERROR, TAG, "it will be sent again.");
+
+ CAResult_t res = CALEServerSend(env, device, g_sendBuffer);
+ if (CA_STATUS_OK != res)
+ {
+ OIC_LOG(ERROR, TAG, "send has failed");
+ ca_mutex_lock(g_threadSendNotifyMutex);
+ g_isSignalSetFlag = true;
+ ca_cond_signal(g_threadSendNotifyCond);
+ ca_mutex_unlock(g_threadSendNotifyMutex);
+ return CA_SEND_FAILED;
+ }
+ }
+ else
+ {
+ OIC_LOG(DEBUG, TAG, "notify success");
+
+ // next data can be sent
+ ca_mutex_lock(g_threadSendNotifyMutex);
+ OIC_LOG(DEBUG, TAG, "g_isSignalSetFlag is set true and signal");
+ g_isSignalSetFlag = true;
+ ca_cond_signal(g_threadSendNotifyCond);
+ ca_mutex_unlock(g_threadSendNotifyMutex);
+ }
+