Fix data alignment issue in tinydtls session_t
[platform/upstream/iotivity.git] / resource / csdk / connectivity / inc / caretransmission.h
index d43db32..b1a9971 100644 (file)
@@ -19,8 +19,8 @@
  ******************************************************************/
 
 /**
- * @file caretransmission.h
- * @brief This file contains common function for retransmission messages.
+ * @file
+ * This file contains common function for retransmission messages.
  */
 
 #ifndef CA_RETRANSMISSION_H_
 #include "uarraylist.h"
 #include "cacommon.h"
 
-/** IP, EDR, LE **/
+/** IP, EDR, LE. **/
 #define DEFAULT_RETRANSMISSION_TYPE (CA_ADAPTER_IP | \
                                      CA_ADAPTER_RFCOMM_BTEDR | \
                                      CA_ADAPTER_GATT_BTLE)
 
-/** default ACK time is 2 sec.(CoAP) **/
+/** default ACK time is 2 sec(CoAP). **/
 #define DEFAULT_ACK_TIMEOUT_SEC     2
 
-/** default max retransmission trying count is 4.(CoAP) **/
+/** default max retransmission trying count is 4(CoAP). **/
 #define DEFAULT_RETRANSMISSION_COUNT      4
 
 /** check period is 1 sec. **/
 #define RETRANSMISSION_CHECK_PERIOD_SEC     1
 
-/** retransmission data send method type**/
+/** retransmission data send method type**/
 typedef CAResult_t (*CADataSendMethod_t)(const CAEndpoint_t *endpoint,
                                          const void *pdu,
                                          uint32_t size);
 
-/** retransmission timeout callback type**/
+/** retransmission timeout callback type**/
 typedef void (*CATimeoutCallback_t)(const CAEndpoint_t *endpoint,
                                     const void *pdu,
                                     uint32_t size);
 
 typedef struct
 {
-    /** retransmission support transport type **/
+    /** retransmission support transport type. **/
     CATransportAdapter_t supportType;
 
-    /** retransmission trying count **/
+    /** retransmission trying count. **/
     uint8_t tryingCount;
 
 } CARetransmissionConfig_t;
 
 typedef struct
 {
-    /** Thread pool of the thread started **/
+    /** Thread pool of the thread started. **/
     ca_thread_pool_t threadPool;
 
-    /** mutex for synchronization **/
+    /** mutex for synchronization. **/
     ca_mutex threadMutex;
 
-    /** conditional mutex for synchronization **/
+    /** conditional mutex for synchronization. **/
     ca_cond threadCond;
 
-    /** send method for retransmission data **/
+    /** send method for retransmission data. **/
     CADataSendMethod_t dataSendMethod;
 
-    /** callback function for retransmit timeout **/
+    /** callback function for retransmit timeout. **/
     CATimeoutCallback_t timeoutCallback;
 
-    /** retransmission configure data **/
+    /** retransmission configure data. **/
     CARetransmissionConfig_t config;
 
-    /** Variable to inform the thread to stop **/
+    /** Variable to inform the thread to stop. **/
     bool isStop;
 
     /** array list on which the thread is operating. **/
@@ -101,14 +101,14 @@ extern "C"
 #endif
 
 /**
- * @brief   Initializes the retransmission context
- * @param   context                     [IN] context for retransmission
- * @param   handle                      [IN] thread pool handle
- * @param   retransmissionSendMethod    [IN] function to be called for retransmission
- * @param   timeoutCallback             [IN] callback for retransmit timeout
- * @param   config                      [IN] configuration for retransmission.
+ * Initializes the retransmission context.
+ * @param[in]   context                      context for retransmission.
+ * @param[in]   handle                       thread pool handle.
+ * @param[in]   retransmissionSendMethod     function to be called for retransmission.
+ * @param[in]   timeoutCallback              callback for retransmit timeout.
+ * @param[in]   config                       configuration for retransmission.
  *                                           if NULL is coming, it will set default values.
- * @return  CA_STATUS_OK or ERROR CODES (CAResult_t error codes in cacommon.h)
+ * @return  ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h).
  */
 CAResult_t CARetransmissionInitialize(CARetransmission_t *context,
                                       ca_thread_pool_t handle,
@@ -117,56 +117,56 @@ CAResult_t CARetransmissionInitialize(CARetransmission_t *context,
                                       CARetransmissionConfig_t* config);
 
 /**
- * @brief   Starting the retransmission context
- * @param   context     [IN] context for retransmission
- * @return  CA_STATUS_OK or ERROR CODES (CAResult_t error codes in cacommon.h)
+ * Starting the retransmission context.
+ * @param[in]   context      context for retransmission.
+ * @return  ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h).
  */
 CAResult_t CARetransmissionStart(CARetransmission_t *context);
 
 /**
- * @brief   Pass the sent pdu data. if retransmission process need, internal thread will wake up and
- *          process the retransmission data
- * @param   context     [IN] context for retransmission
- * @param   endpoint    [IN] endpoint information
- * @param   pdu         [IN] sent pdu binary data
- * @param   size        [IN] sent pdu binary data size
- * @return  CA_STATUS_OK or ERROR CODES (CAResult_t error codes in cacommon.h)
+ * Pass the sent pdu data. if retransmission process need, internal thread will wake up and
+ * process the retransmission data.
+ * @param[in]   context      context for retransmission.
+ * @param[in]   endpoint     endpoint information.
+ * @param[in]   pdu          sent pdu binary data.
+ * @param[in]   size         sent pdu binary data size.
+ * @return  ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h).
  */
 CAResult_t CARetransmissionSentData(CARetransmission_t* context,
                                     const CAEndpoint_t* endpoint,
                                     const void* pdu, uint32_t size);
 
 /**
- * @brief   Pass the received pdu data. if received pdu is ACK data for the retransmission CON data,
- *          the specified CON data will remove on retransmission list.
- * @param   context             [IN] context for retransmission
- * @param   endpoint            [IN] endpoint information
- * @param   pdu                 [IN] received pdu binary data
- * @param   size                [IN] received pdu binary data size
- * @param   retransmissionPdu   [OUT] pdu data of the request for reset and ack
- * @return  CA_STATUS_OK or ERROR CODES (CAResult_t error codes in cacommon.h)
+ * Pass the received pdu data. if received pdu is ACK data for the retransmission CON data,
+ * the specified CON data will remove on retransmission list.
+ * @param[in]   context              context for retransmission.
+ * @param[in]   endpoint             endpoint information.
+ * @param[in]   pdu                  received pdu binary data.
+ * @param[in]   size                 received pdu binary data size.
+ * @param[out]  retransmissionPdu    pdu data of the request for reset and ack.
+ * @return  ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h).
  */
 CAResult_t CARetransmissionReceivedData(CARetransmission_t *context,
                                         const CAEndpoint_t *endpoint, const void *pdu,
                                         uint32_t size, void **retransmissionPdu);
 
 /**
- * @brief   Stopping the retransmission context
- * @param   context     [IN] context for retransmission
- * @return  CA_STATUS_OK or ERROR CODES (CAResult_t error codes in cacommon.h)
+ * Stopping the retransmission context.
+ * @param[in]   context         context for retransmission.
+ * @return  ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h).
  */
 CAResult_t CARetransmissionStop(CARetransmission_t *context);
 
 /**
- * @brief   Terminating the retransmission context
- * @param   context     [IN] context for retransmission
- * @return  CA_STATUS_OK or ERROR CODES (CAResult_t error codes in cacommon.h)
+ * Terminating the retransmission context.
+ * @param[in]   context         context for retransmission.
+ * @return  ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h).
  */
 CAResult_t CARetransmissionDestroy(CARetransmission_t *context);
 
 /**
- * @brief   Invoke Retransmission according to TimedAction Response
- * @param   threadValue [IN]    context for retransmission
+ * Invoke Retransmission according to TimedAction Response.
+ * @param[in]   threadValue     context for retransmission.
  */
 void CARetransmissionBaseRoutine(void *threadValue);