X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=resource%2Fcsdk%2Fconnectivity%2Finc%2Fcamessagehandler.h;h=10203b9a4eb3c4221242cb34f91ab4905c01421c;hb=7f00f942c39b7bc27c7eeecf213a239c3fe4173c;hp=1bd51a0f1872a60bccfac60d49405eeaea24f385;hpb=45c364268c4f5d575d98f4cd88b571b536c6cb17;p=platform%2Fupstream%2Fiotivity.git diff --git a/resource/csdk/connectivity/inc/camessagehandler.h b/resource/csdk/connectivity/inc/camessagehandler.h index 1bd51a0..10203b9 100644 --- a/resource/csdk/connectivity/inc/camessagehandler.h +++ b/resource/csdk/connectivity/inc/camessagehandler.h @@ -27,7 +27,7 @@ #define CA_MESSAGE_HANDLER_H_ #include "cacommon.h" -#include "coap.h" +#include #define CA_MEMORY_ALLOC_CHECK(arg) { if (NULL == arg) {OIC_LOG(ERROR, TAG, "Out of memory"); \ goto memory_error_exit;} } @@ -38,13 +38,6 @@ typedef enum SEND_TYPE_UNICAST } CASendDataType_t; -typedef enum -{ - CA_REQUEST_DATA = 1, - CA_RESPONSE_DATA = 2, - CA_ERROR_DATA = 3, -} CADataType_t; - typedef struct { CASendDataType_t type; @@ -52,6 +45,7 @@ typedef struct CARequestInfo_t *requestInfo; CAResponseInfo_t *responseInfo; CAErrorInfo_t *errorInfo; + CAConnectEvent_t eventInfo; CADataType_t dataType; } CAData_t; @@ -72,17 +66,15 @@ CAResult_t CADetachSendMessage(const CAEndpoint_t *endpoint, CADataType_t dataType); /** - * Detaches control from the caller for sending request. - * @param[in] resourceUri resource uri that needs to be sent in the request. - * @param[in] token token information of the request. - * @param[in] tokenLength length of the token. - * @param[in] options header options that need to be append in the request. - * @param[in] numOptions number of options be appended. + * 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 CADetachMessageResourceUri(const CAURI_t resourceUri, const CAToken_t token, - uint8_t tokenLength, const CAHeaderOption_t *options, - uint8_t numOptions); +CAResult_t CADetachSendNetworkReqMessage(const CAEndpoint_t *endpoint, + CAConnectEvent_t event, + CADataType_t dataType); /** * Setting the request and response callbacks for network packets. @@ -96,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. @@ -111,11 +110,10 @@ void CATerminateMessageHandler(); void CAHandleRequestResponseCallbacks(); /** - * To log the PDU data. - * @param[in] pdu pdu data. - * @param[in] endpoint endpoint + * Setting the Callback funtion for network state change callback. + * @param[in] nwMonitorHandler callback for network state change. */ -void CALogPDUInfo(coap_pdu_t *pdu, const CAEndpoint_t *endpoint); +void CASetNetworkMonitorCallback(CANetworkMonitorCallback nwMonitorHandler); #ifdef WITH_BWT /**