replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / resource / csdk / connectivity / inc / camessagehandler.h
index 5596039..10203b9 100644 (file)
@@ -45,6 +45,7 @@ typedef struct
     CARequestInfo_t *requestInfo;
     CAResponseInfo_t *responseInfo;
     CAErrorInfo_t *errorInfo;
+    CAConnectEvent_t eventInfo;
     CADataType_t dataType;
 } CAData_t;
 
@@ -65,6 +66,17 @@ CAResult_t CADetachSendMessage(const CAEndpoint_t *endpoint,
                                CADataType_t dataType);
 
 /**
+ * Detaches control from the caller for sending message to adapter.
+ * @param[in] endpoint    endpoint information where the data has to be sent.
+ * @param[in] event       command to request disconect or connect.
+ * @param[in] dataType    type of the message(request/response).
+ * @return  ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h).
+ */
+CAResult_t CADetachSendNetworkReqMessage(const CAEndpoint_t *endpoint,
+                                         CAConnectEvent_t event,
+                                         CADataType_t dataType);
+
+/**
  * Setting the request and response callbacks for network packets.
  * @param[in] ReqHandler      callback for receiving the requests.
  * @param[in] RespHandler     callback for receiving the response.
@@ -76,9 +88,16 @@ void CASetInterfaceCallbacks(CARequestCallback ReqHandler, CAResponseCallback Re
 /**
  * Initialize the message handler by starting thread pool and initializing the
  * send and receive queue.
+ * @param[in]   transportType  transport type to initialize.
  * @return  ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h).
  */
-CAResult_t CAInitializeMessageHandler();
+CAResult_t CAInitializeMessageHandler(CATransportAdapter_t transportType);
+
+/**
+ * Clears the message handler queue data.
+ * @param[in]   transportType  transport type to initialize.
+ */
+void CAClearMessageHandler(CATransportAdapter_t transportType);
 
 /**
  * Terminate the message handler by stopping  the thread pool and destroying the queues.
@@ -96,13 +115,6 @@ void CAHandleRequestResponseCallbacks();
  */
 void CASetNetworkMonitorCallback(CANetworkMonitorCallback nwMonitorHandler);
 
-/**
- * To log the PDU data.
- * @param[in] pdu    pdu data.
- * @param[in] endpoint  endpoint
- */
-void CALogPDUInfo(coap_pdu_t *pdu, const CAEndpoint_t *endpoint);
-
 #ifdef WITH_BWT
 /**
  * Add the data to the send queue thread.