+#ifndef SINGLE_THREAD
+/**
+ * @brief timeout value is
+ * between DEFAULT_ACK_TIMEOUT_SEC and
+ * (DEFAULT_ACK_TIMEOUT_SEC * DEFAULT_RANDOM_FACTOR) second.
+ * DEFAULT_RANDOM_FACTOR 1.5 (CoAP)
+ * @return microseconds.
+ */
+static uint64_t CAGetTimeoutValue()
+{
+ return ((DEFAULT_ACK_TIMEOUT_SEC * 1000) + ((1000 * (random() & 0xFF)) >> 8)) *
+ (uint64_t) 1000;
+}
+
+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;
+ }
+
+ CAResult_t res = ca_thread_pool_add_task(context->threadPool, CARetransmissionBaseRoutine,
+ context);
+
+ if (CA_STATUS_OK != res)
+ {
+ OIC_LOG(ERROR, TAG, "thread pool add task error(send thread).");
+ return res;
+ }
+
+ return res;
+}
+#endif
+