#define CA_MESSAGE_HANDLER_H_
#include "cacommon.h"
-#include "coap.h"
+#include <coap/coap.h>
#define CA_MEMORY_ALLOC_CHECK(arg) { if (NULL == arg) {OIC_LOG(ERROR, TAG, "Out of memory"); \
goto memory_error_exit;} }
CARequestInfo_t *requestInfo;
CAResponseInfo_t *responseInfo;
CAErrorInfo_t *errorInfo;
+ CAConnectEvent_t eventInfo;
CADataType_t dataType;
} CAData_t;
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.
/**
* 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.
*/
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.