+static uint64_t CAGetTimeoutValue()
+{
+ return ((DEFAULT_ACK_TIMEOUT_SEC * MSECS_PER_SEC)
+ + ((MSECS_PER_SEC * OCGetRandomByte()) >> 8)) * MSECS_PER_SEC;
+}
+
+CAResult_t CARetransmissionStart(CARetransmission_t *context)
+{
+ if (NULL == context)
+ {
+ OIC_LOG(ERROR, TAG, "context is empty");
+ return CA_STATUS_INVALID_PARAM;
+ }
+
+ if (NULL == context->threadPool)
+ {
+ OIC_LOG(ERROR, TAG, "thread pool handle is empty..");
+ return CA_STATUS_INVALID_PARAM;
+ }
+#ifndef __TIZENRT__
+ CAResult_t res = ca_thread_pool_add_task(context->threadPool, CARetransmissionBaseRoutine,
+ context, NULL);
+#else
+ CAResult_t res = ca_thread_pool_add_task(context->threadPool, CARetransmissionBaseRoutine,
+ context, NULL, "IoT_Retransmit",
+ CONFIG_IOTIVITY_RETRANSMIT_PTHREAD_STACKSIZE);
+#endif
+ if (CA_STATUS_OK != res)
+ {
+ OIC_LOG(ERROR, TAG, "thread pool add task error(send thread).");
+ return res;
+ }
+
+ return res;
+}
+#endif