From e641db0ad106785e73aaa348e57198c7b97c2f30 Mon Sep 17 00:00:00 2001 From: "jihwan.seo" Date: Fri, 8 Jul 2016 20:12:49 +0900 Subject: [PATCH] Separated transmission logic for data on Both Mode. Since BLE transport has gatt server and client. there are two sender and receiver such as notifyCharacteristic / writeCharacteristic in BLE transport. (while other transport has only one sender and receiver.) thur, message has to be sent by message type which whether it is a request or response message. Change-Id: I7f77d86c13115138082b72a6371ce5bd49f1f0c6 Signed-off-by: jihwan.seo Reviewed-on: https://gerrit.iotivity.org/gerrit/9255 Tested-by: jenkins-iotivity Reviewed-by: Jaehong Jo Reviewed-by: Jon A. Cruz --- resource/csdk/connectivity/api/cacommon.h | 83 ++++++++++++---------- .../csdk/connectivity/inc/caadapterinterface.h | 8 ++- resource/csdk/connectivity/inc/caedradapter.h | 6 +- .../csdk/connectivity/inc/cainterfacecontroller.h | 8 ++- resource/csdk/connectivity/inc/caipadapter.h | 7 +- resource/csdk/connectivity/inc/camessagehandler.h | 7 -- resource/csdk/connectivity/inc/canfcadapter.h | 7 +- resource/csdk/connectivity/inc/caraadapter.h | 5 +- resource/csdk/connectivity/inc/caretransmission.h | 11 +-- resource/csdk/connectivity/inc/catcpadapter.h | 8 ++- .../connectivity/src/bt_edr_adapter/caedradapter.c | 7 +- .../connectivity/src/bt_le_adapter/caleadapter.c | 28 +++++--- .../csdk/connectivity/src/caconnectivitymanager.c | 11 ++- .../csdk/connectivity/src/cainterfacecontroller.c | 10 +-- resource/csdk/connectivity/src/camessagehandler.c | 11 +-- resource/csdk/connectivity/src/caretransmission.c | 6 +- .../csdk/connectivity/src/ip_adapter/caipadapter.c | 8 ++- .../connectivity/src/nfc_adapter/canfcadapter.c | 8 ++- .../csdk/connectivity/src/ra_adapter/caraadapter.c | 14 ++-- .../connectivity/src/tcp_adapter/catcpadapter.c | 8 ++- .../csdk/connectivity/test/ca_api_unittest.cpp | 3 + .../csdk/stack/include/internal/ocstackinternal.h | 3 +- resource/csdk/stack/src/ocstack.c | 23 +++--- resource/csdk/stack/src/oickeepalive.c | 4 +- 24 files changed, 187 insertions(+), 107 deletions(-) diff --git a/resource/csdk/connectivity/api/cacommon.h b/resource/csdk/connectivity/api/cacommon.h index d9c2c47..e42f75a 100644 --- a/resource/csdk/connectivity/api/cacommon.h +++ b/resource/csdk/connectivity/api/cacommon.h @@ -51,7 +51,7 @@ extern "C" #endif /** - * IP address Length + * IP address Length. */ #define CA_IPADDR_SIZE 16 @@ -61,22 +61,22 @@ extern "C" #define CA_RAJABBERID_SIZE 256 /** - * Mac address length for BT port + * Mac address length for BT port. */ #define CA_MACADDR_SIZE 18 /** - * Max header options data length + * Max header options data length. */ #define CA_MAX_HEADER_OPTION_DATA_LENGTH 20 /** -* Max token length +* Max token length. */ #define CA_MAX_TOKEN_LEN (8) /** - * Max URI length + * Max URI length. */ #ifdef ARDUINO #define CA_MAX_URI_LENGTH 128 /* maximum size of URI for embedded platforms*/ @@ -85,7 +85,7 @@ extern "C" #endif /** - * Max PDU length supported + * Max PDU length supported. */ #ifdef ARDUINO #define COAP_MAX_PDU_SIZE 320 /* maximum size of a CoAP PDU for embedded platforms*/ @@ -98,12 +98,12 @@ extern "C" #endif /** - *Maximum length of the remoteEndpoint identity + *Maximum length of the remoteEndpoint identity. */ #define CA_MAX_ENDPOINT_IDENTITY_LEN (32) /** - * option types - the highest option number 63 + * option types - the highest option number 63. */ #define CA_OPTION_IF_MATCH 1 #define CA_OPTION_ETAG 4 @@ -119,7 +119,7 @@ extern "C" #define CA_OPTION_LOCATION_QUERY 20 /** - * Payload information from resource model + * Payload information from resource model. */ typedef uint8_t *CAPayload_t; @@ -129,12 +129,12 @@ typedef uint8_t *CAPayload_t; typedef char *CAURI_t; /** - * Token information for mapping the request and responses by resource model + * Token information for mapping the request and responses by resource model. */ typedef char *CAToken_t; /* - * Socket types and error definitions + * Socket types and error definitions. */ #ifdef HAVE_WINSOCK2_H # define OC_SOCKET_ERROR SOCKET_ERROR @@ -208,7 +208,6 @@ typedef enum #define CA_SCOPE_MASK 0xf // mask scope bits above /** - * @enum CANetworkStatus_t * Information about the network status. */ typedef enum @@ -218,7 +217,7 @@ typedef enum } CANetworkStatus_t; /* - * remoteEndpoint identity + * remoteEndpoint identity. */ typedef struct { @@ -227,8 +226,7 @@ typedef struct } CARemoteId_t; /** - * @enum CAMessageType_t - * Message Type for Base source code + * Message Type for Base source code. */ typedef enum { @@ -240,8 +238,7 @@ typedef enum } CAMessageType_t; /** - * @enum CAMethod_t - * Allowed method to be used by resource model + * Allowed method to be used by resource model. */ typedef enum { @@ -252,7 +249,7 @@ typedef enum } CAMethod_t; /** - * block size + * block size. * it depends on defined size in libCoAP. */ typedef enum @@ -267,7 +264,7 @@ typedef enum } CABlockSize_t; /** - * Endpoint information for connectivities + * Endpoint information for connectivities. * Must be identical to OCDevAddr. */ typedef struct @@ -284,7 +281,7 @@ typedef struct } CAEndpoint_t; /** - * Endpoint information for secure messages + * Endpoint information for secure messages. */ typedef struct { @@ -293,8 +290,7 @@ typedef struct } CASecureEndpoint_t; /** - * @enum CAResult_t - * Enums for CA return values + * Enums for CA return values. */ typedef enum { @@ -319,8 +315,7 @@ typedef enum } CAResult_t; /** - * @enum CAResponseResult_t - * Enums for CA Response values + * Enums for CA Response values. */ typedef enum { @@ -347,8 +342,20 @@ typedef enum } CAResponseResult_t; /** - * @enum CATransportProtocolID_t - * Transport Protocol IDs for additional options + * Data type whether the data is Request Message or Response Message. + * if there is some failure before send data on network. + * Type will be set as error type for error callback. + */ +typedef enum +{ + CA_REQUEST_DATA = 1, + CA_RESPONSE_DATA, + CA_ERROR_DATA, + CA_RESPONSE_FOR_RES +} CADataType_t; + +/** + * Transport Protocol IDs for additional options. */ typedef enum { @@ -357,7 +364,6 @@ typedef enum } CATransportProtocolID_t; /** - * @enum CAAdapterState_t * Adapter State to indicate the network changed notifications. */ typedef enum @@ -384,7 +390,7 @@ typedef enum } CAPayloadFormat_t; /** - * Header options structure to be filled + * Header options structure to be filled. * * This structure is used to hold header information. */ @@ -398,9 +404,9 @@ typedef struct } CAHeaderOption_t; /** - * Base Information received + * Base Information received. * - * This structure is used to hold request & response base information + * This structure is used to hold request & response base information. */ typedef struct { @@ -422,12 +428,13 @@ typedef struct CAPayloadFormat_t acceptFormat; /**< accept format for the response payload */ CAURI_t resourceUri; /**< Resource URI information **/ CARemoteId_t identity; /**< endpoint identity */ + CADataType_t dataType; /**< data type */ } CAInfo_t; /** - * Request Information to be sent + * Request Information to be sent. * - * This structure is used to hold request information + * This structure is used to hold request information. */ typedef struct { @@ -437,9 +444,9 @@ typedef struct } CARequestInfo_t; /** - * Response information received + * Response information received. * - * This structure is used to hold response information + * This structure is used to hold response information. */ typedef struct { @@ -450,9 +457,9 @@ typedef struct /** * Error information from CA - * contains error code and message information + * contains error code and message information. * - * This structure holds error information + * This structure holds error information. */ typedef struct { @@ -462,7 +469,7 @@ typedef struct } CAErrorInfo_t; /** - * Hold global variables for CA layer (also used by RI layer) + * Hold global variables for CA layer. (also used by RI layer) */ typedef struct { @@ -487,7 +494,7 @@ typedef struct } CAHistory_t; /** - * Hold interface index for keeping track of comings and goings + * Hold interface index for keeping track of comings and goings. */ typedef struct { diff --git a/resource/csdk/connectivity/inc/caadapterinterface.h b/resource/csdk/connectivity/inc/caadapterinterface.h index 144f383..0236089 100644 --- a/resource/csdk/connectivity/inc/caadapterinterface.h +++ b/resource/csdk/connectivity/inc/caadapterinterface.h @@ -88,10 +88,12 @@ typedef CAResult_t (*CAAdapterStartDiscoveryServer)(); * reference uri and connectivity type) to which the unicast data has to be sent. * @param[in] data Data which required to be sent. * @param[in] dataLen Size of data to be sent. + * @param[in] dataType Data type which is REQUEST or RESPONSE. * @return The number of bytes sent on the network. Return value equal to -1 indicates error. */ typedef int32_t (*CAAdapterSendUnicastData)(const CAEndpoint_t *endpoint, - const void *data, uint32_t dataLen); + const void *data, uint32_t dataLen, + CADataType_t dataType); /** * Sends Multicast data to the endpoint using the adapter connectivity. @@ -99,10 +101,12 @@ typedef int32_t (*CAAdapterSendUnicastData)(const CAEndpoint_t *endpoint, * @param[in] endpoint Remote Endpoint information (like ipaddress , port, * @param[in] data Data which required to be sent. * @param[in] dataLen Size of data to be sent. + * @param[in] dataType Data type which is REQUEST or RESPONSE. * @return The number of bytes sent on the network. Return value equal to -1 indicates error. */ typedef int32_t (*CAAdapterSendMulticastData)(const CAEndpoint_t *endpoint, - const void *data, uint32_t dataLen); + const void *data, uint32_t dataLen, + CADataType_t dataType); /** * Get Network Information. diff --git a/resource/csdk/connectivity/inc/caedradapter.h b/resource/csdk/connectivity/inc/caedradapter.h index bec17b7..019f363 100644 --- a/resource/csdk/connectivity/inc/caedradapter.h +++ b/resource/csdk/connectivity/inc/caedradapter.h @@ -96,21 +96,23 @@ CAResult_t CAStartEDRDiscoveryServer(); * connectivity type) to which the unicast data has to be sent. * @param[in] data Data to be sent. * @param[in] dataLength Size of data to be sent. + * @param[in] dataType Data type which is REQUEST or RESPONSE. * @return The number of bytes sent on the network. Returns -1 on error. * */ int32_t CASendEDRUnicastData(const CAEndpoint_t *endpoint, const void *data, - uint32_t dataLength); + uint32_t dataLength, CADataType_t dataType); /** * Sends multicast data to all discovered bluetooth OIC devices using the adapter. * @param[in] endpoint Remote Endpoint information (like ipaddress, port, and connectivity. * @param[in] data Data which needs to be sent to all discovered bluetooth OIC device. * @param[in] dataLength Length of data in bytes. + * @param[in] dataType Data type which is REQUEST or RESPONSE. * @return Number of bytes sent on the network. Returns -1 on error. */ int32_t CASendEDRMulticastData(const CAEndpoint_t *endpoint, const void *data, - uint32_t dataLength); + uint32_t dataLength, CADataType_t dataType); /** * Get EDR Connectivity network information. diff --git a/resource/csdk/connectivity/inc/cainterfacecontroller.h b/resource/csdk/connectivity/inc/cainterfacecontroller.h index edf060f..803fe57 100644 --- a/resource/csdk/connectivity/inc/cainterfacecontroller.h +++ b/resource/csdk/connectivity/inc/cainterfacecontroller.h @@ -111,19 +111,23 @@ CAResult_t CAGetNetworkInfo(CAEndpoint_t **info, uint32_t *size); * @param[in] endpoint endpoint information where the data has to be sent. * @param[in] data data that needs to be sent. * @param[in] length length of the data that needs to be sent. + * @param[in] dataType Data type which is REQUEST or RESPONSE. * @return ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h). */ -CAResult_t CASendUnicastData(const CAEndpoint_t *endpoint, const void *data, uint32_t length); +CAResult_t CASendUnicastData(const CAEndpoint_t *endpoint, const void *data, + uint32_t length, CADataType_t dataType); /** * Sends multicast data to all endpoints in the network. * @param[in] endpoint endpoint information where the data has to be sent. * @param[in] data data that needs to be sent. * @param[in] length length of the data that needs to be sent. + * @param[in] dataType Data type which is REQUEST or RESPONSE. * @return ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h). */ -CAResult_t CASendMulticastData(const CAEndpoint_t *endpoint, const void *data, uint32_t length); +CAResult_t CASendMulticastData(const CAEndpoint_t *endpoint, const void *data, + uint32_t length, CADataType_t dataType); /** * Start listening servers to receive search requests from clients. diff --git a/resource/csdk/connectivity/inc/caipadapter.h b/resource/csdk/connectivity/inc/caipadapter.h index d4ec30a..7ca9267 100644 --- a/resource/csdk/connectivity/inc/caipadapter.h +++ b/resource/csdk/connectivity/inc/caipadapter.h @@ -92,11 +92,12 @@ CAResult_t CAStartIPDiscoveryServer(); * which the unicast data has to be sent. * @param[in] data Data which is required to be sent. * @param[in] dataLen Size of data to be sent. + * @param[in] dataType Data type which is REQUEST or RESPONSE. * @note dataLen must be > 0. * @return The number of bytes sent on the network, or -1 upon error. */ int32_t CASendIPUnicastData(const CAEndpoint_t *endpoint, const void *data, - uint32_t dataLen); + uint32_t dataLen, CADataType_t dataType); /** * Send Multicast data to the endpoint using the IP connectivity. @@ -104,10 +105,12 @@ int32_t CASendIPUnicastData(const CAEndpoint_t *endpoint, const void *data, * port) * @param[in] data Data which is required to be sent. * @param[in] dataLen Size of data to be sent. + * @param[in] dataType Data type which is REQUEST or RESPONSE. * @note dataLen must be > 0. * @return The number of bytes sent on the network, or -1 upon error. */ -int32_t CASendIPMulticastData(const CAEndpoint_t *endpoint, const void *data, uint32_t dataLen); +int32_t CASendIPMulticastData(const CAEndpoint_t *endpoint, const void *data, + uint32_t dataLen, CADataType_t dataType); /** * Get IP Connectivity network information. diff --git a/resource/csdk/connectivity/inc/camessagehandler.h b/resource/csdk/connectivity/inc/camessagehandler.h index 3f2fa6c..5a70271 100644 --- a/resource/csdk/connectivity/inc/camessagehandler.h +++ b/resource/csdk/connectivity/inc/camessagehandler.h @@ -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; diff --git a/resource/csdk/connectivity/inc/canfcadapter.h b/resource/csdk/connectivity/inc/canfcadapter.h index 3083ab3..ba308db 100644 --- a/resource/csdk/connectivity/inc/canfcadapter.h +++ b/resource/csdk/connectivity/inc/canfcadapter.h @@ -81,21 +81,24 @@ CAResult_t CAStartNFCDiscoveryServer(); * @param[in] endpoint Remote Endpoint information. * @param[in] data data to be sent. * @param[in] dataLen Size of data to be sent. + * @param[in] dataType Data type which is REQUEST or RESPONSE. * @return number of bytes sent on the network. Return value equal to -1 indicates error. * @remark dataLen must be > 0. */ int32_t CASendNFCUnicastData(const CAEndpoint_t *endpoint, const void *data, - uint32_t dataLen); + uint32_t dataLen, CADataType_t dataType); /** * Send Multicast data to the endpoint using the NFC connectivity. * @param[in] endpoint Remote Endpoint information. * @param[in] data Data which is required to be sent. * @param[in] dataLen Size of data to be sent. + @param[in] dataType Data type which is REQUEST or RESPONSE. * @return number of bytes sent on the network. Return value equal to -1 indicates error. * @remark dataLen must be > 0. */ -int32_t CASendNFCMulticastData(const CAEndpoint_t *endpoint, const void *data, uint32_t dataLen); +int32_t CASendNFCMulticastData(const CAEndpoint_t *endpoint, const void *data, + uint32_t dataLen, CADataType_t dataType); /** * Get NFC Connectivity network information diff --git a/resource/csdk/connectivity/inc/caraadapter.h b/resource/csdk/connectivity/inc/caraadapter.h index ed730f0..95961de 100644 --- a/resource/csdk/connectivity/inc/caraadapter.h +++ b/resource/csdk/connectivity/inc/caraadapter.h @@ -68,11 +68,12 @@ CAResult_t CAStartRA(); * the unicast data has to be sent. * @param[in] data Data which is required to be sent. * @param[in] dataLen Size of data to be sent. + * @param[in] dataType Data type which is REQUEST or RESPONSE. * @note dataLen must be > 0. * @return The number of bytes sent on the network, or -1 upon error. */ int32_t CASendRAUnicastData(const CAEndpoint_t *endpoint, const void *data, - uint32_t dataLen); + uint32_t dataLen, CADataType_t dataType); /** * Get RA Connectivity network information. @@ -107,7 +108,7 @@ CAResult_t CASetRAInfo(const CARAInfo_t *caraInfo); * These functions are not applicable to Remote Access adapter. */ int32_t CASendRAMulticastData(const CAEndpoint_t *endpoint, - const void *data, uint32_t dataLen); + const void *data, uint32_t dataLen, CADataType_t dataType); /** * Start listening server for receiving search requests. diff --git a/resource/csdk/connectivity/inc/caretransmission.h b/resource/csdk/connectivity/inc/caretransmission.h index b1a9971..d764e51 100644 --- a/resource/csdk/connectivity/inc/caretransmission.h +++ b/resource/csdk/connectivity/inc/caretransmission.h @@ -50,7 +50,8 @@ /** retransmission data send method type. **/ typedef CAResult_t (*CADataSendMethod_t)(const CAEndpoint_t *endpoint, const void *pdu, - uint32_t size); + uint32_t size, + CADataType_t dataType); /** retransmission timeout callback type. **/ typedef void (*CATimeoutCallback_t)(const CAEndpoint_t *endpoint, @@ -128,13 +129,15 @@ CAResult_t CARetransmissionStart(CARetransmission_t *context); * process the retransmission data. * @param[in] context context for retransmission. * @param[in] endpoint endpoint information. + * @param[in] dataType Data type which is REQUEST or RESPONSE. * @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); +CAResult_t CARetransmissionSentData(CARetransmission_t *context, + const CAEndpoint_t *endpoint, + CADataType_t dataType, + const void *pdu, uint32_t size); /** * Pass the received pdu data. if received pdu is ACK data for the retransmission CON data, diff --git a/resource/csdk/connectivity/inc/catcpadapter.h b/resource/csdk/connectivity/inc/catcpadapter.h index 9e9fde5..e892e07 100644 --- a/resource/csdk/connectivity/inc/catcpadapter.h +++ b/resource/csdk/connectivity/inc/catcpadapter.h @@ -110,11 +110,13 @@ CAResult_t CAStartTCPDiscoveryServer(); * which the unicast data has to be sent. * @param[in] data Data which is required to be sent. * @param[in] dataLen Size of data to be sent. + * @param[in] dataType Data type which is REQUEST or RESPONSE. * @note dataLen must be > 0. * @return The number of bytes sent on the network, or -1 upon error. */ int32_t CASendTCPUnicastData(const CAEndpoint_t *endpoint, - const void *data, uint32_t dataLen); + const void *data, uint32_t dataLen, + CADataType_t dataType); /** * Send Multicast data to the endpoint using the TCP connectivity. @@ -122,11 +124,13 @@ int32_t CASendTCPUnicastData(const CAEndpoint_t *endpoint, * port) * @param[in] data Data which is required to be sent. * @param[in] dataLen Size of data to be sent. + * @param[in] dataType Data type which is REQUEST or RESPONSE. * @note dataLen must be > 0. * @return The number of bytes sent on the network, or -1 upon error. */ int32_t CASendTCPMulticastData(const CAEndpoint_t *endpoint, - const void *data, uint32_t dataLen); + const void *data, uint32_t dataLen, + CADataType_t dataType); /** * Get TCP Connectivity network information. diff --git a/resource/csdk/connectivity/src/bt_edr_adapter/caedradapter.c b/resource/csdk/connectivity/src/bt_edr_adapter/caedradapter.c index f0b3fdf..c5a86d8 100644 --- a/resource/csdk/connectivity/src/bt_edr_adapter/caedradapter.c +++ b/resource/csdk/connectivity/src/bt_edr_adapter/caedradapter.c @@ -264,11 +264,12 @@ CAResult_t CAStartEDRDiscoveryServer() } int32_t CASendEDRUnicastData(const CAEndpoint_t *remoteEndpoint, const void *data, - uint32_t dataLength) + uint32_t dataLength, CADataType_t dataType) { // Input validation VERIFY_NON_NULL_RET(remoteEndpoint, TAG, "Remote endpoint is null", -1); VERIFY_NON_NULL_RET(data, TAG, "Data is null", -1); + (void)dataType; if (0 == dataLength) { @@ -296,9 +297,11 @@ int32_t CASendEDRUnicastData(const CAEndpoint_t *remoteEndpoint, const void *dat return sentLength; } -int32_t CASendEDRMulticastData(const CAEndpoint_t *endpoint, const void *data, uint32_t dataLength) +int32_t CASendEDRMulticastData(const CAEndpoint_t *endpoint, const void *data, uint32_t dataLength, + CADataType_t dataType) { OIC_LOG(DEBUG, TAG, "IN - CASendEDRMulticastData"); + (void)dataType; // Input validation VERIFY_NON_NULL_RET(data, TAG, "Data is null", -1); diff --git a/resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c b/resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c index 302a2e8..f6c001f 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c +++ b/resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c @@ -1490,7 +1490,8 @@ static CAResult_t CAStartLEDiscoveryServer(); */ static int32_t CASendLEUnicastData(const CAEndpoint_t *endpoint, const void *data, - uint32_t dataLen); + uint32_t dataLen, + CADataType_t dataType); /** * Send multicast data to the endpoint using the LE connectivity. @@ -1506,7 +1507,8 @@ static int32_t CASendLEUnicastData(const CAEndpoint_t *endpoint, */ static int32_t CASendLEMulticastData(const CAEndpoint_t *endpoint, const void *data, - uint32_t dataLen); + uint32_t dataLen, + CADataType_t dataType); /** * Get LE Connectivity network information. @@ -1998,9 +2000,10 @@ static CAResult_t CAReadLEData() static int32_t CASendLEUnicastData(const CAEndpoint_t *endpoint, const void *data, - uint32_t dataLen) + uint32_t dataLen, + CADataType_t dataType) { - OIC_LOG(DEBUG, CALEADAPTER_TAG, "IN - CASendLEUnicastData"); + OIC_LOG_V(DEBUG, CALEADAPTER_TAG, "IN - CASendLEUnicastData : type(%d)", dataType); //Input validation VERIFY_NON_NULL_RET(endpoint, CALEADAPTER_TAG, "Remote endpoint is null", -1); @@ -2015,7 +2018,8 @@ static int32_t CASendLEUnicastData(const CAEndpoint_t *endpoint, } ca_mutex_lock(g_bleIsServerMutex); - if (ADAPTER_SERVER == g_adapterType || ADAPTER_BOTH_CLIENT_SERVER == g_adapterType) + if (ADAPTER_SERVER == g_adapterType || + (ADAPTER_BOTH_CLIENT_SERVER == g_adapterType && CA_RESPONSE_DATA == dataType)) { result = CALEAdapterServerSendData(endpoint, data, dataLen); if (CA_STATUS_OK != result) @@ -2031,7 +2035,9 @@ static int32_t CASendLEUnicastData(const CAEndpoint_t *endpoint, } } - if (ADAPTER_CLIENT == g_adapterType || ADAPTER_BOTH_CLIENT_SERVER == g_adapterType) + if (ADAPTER_CLIENT == g_adapterType || + (ADAPTER_BOTH_CLIENT_SERVER == g_adapterType && CA_REQUEST_DATA == dataType) || + (ADAPTER_BOTH_CLIENT_SERVER == g_adapterType && CA_RESPONSE_FOR_RES == dataType)) { result = CALEAdapterClientSendData(endpoint, data, dataLen); if (CA_STATUS_OK != result) @@ -2054,7 +2060,8 @@ static int32_t CASendLEUnicastData(const CAEndpoint_t *endpoint, static int32_t CASendLEMulticastData(const CAEndpoint_t *endpoint, const void *data, - uint32_t dataLen) + uint32_t dataLen, + CADataType_t dataType) { OIC_LOG(DEBUG, CALEADAPTER_TAG, "IN - CASendLEMulticastData"); @@ -2076,7 +2083,8 @@ static int32_t CASendLEMulticastData(const CAEndpoint_t *endpoint, } ca_mutex_lock(g_bleIsServerMutex); - if (ADAPTER_SERVER == g_adapterType || ADAPTER_BOTH_CLIENT_SERVER == g_adapterType) + if (ADAPTER_SERVER == g_adapterType || + (ADAPTER_BOTH_CLIENT_SERVER == g_adapterType && CA_RESPONSE_DATA == dataType)) { result = CALEAdapterServerSendData(NULL, data, dataLen); if (CA_STATUS_OK != result) @@ -2093,7 +2101,9 @@ static int32_t CASendLEMulticastData(const CAEndpoint_t *endpoint, } } - if (ADAPTER_CLIENT == g_adapterType || ADAPTER_BOTH_CLIENT_SERVER == g_adapterType) + if (ADAPTER_CLIENT == g_adapterType || + (ADAPTER_BOTH_CLIENT_SERVER == g_adapterType && CA_REQUEST_DATA == dataType) || + (ADAPTER_BOTH_CLIENT_SERVER == g_adapterType && CA_RESPONSE_FOR_RES == dataType)) { result = CALEAdapterClientSendData(NULL, data, dataLen); if (CA_STATUS_OK != result) diff --git a/resource/csdk/connectivity/src/caconnectivitymanager.c b/resource/csdk/connectivity/src/caconnectivitymanager.c index 7355e2a..f5ddd6f 100644 --- a/resource/csdk/connectivity/src/caconnectivitymanager.c +++ b/resource/csdk/connectivity/src/caconnectivitymanager.c @@ -331,14 +331,19 @@ CAResult_t CASendResponse(const CAEndpoint_t *object, const CAResponseInfo_t *re return CA_STATUS_NOT_INITIALIZED; } - if (responseInfo && responseInfo->isMulticast && + if (!responseInfo || !object) + { + return CA_STATUS_INVALID_PARAM; + } + + if (responseInfo->isMulticast && (object->adapter == CA_DEFAULT_ADAPTER || object->adapter == CA_ALL_ADAPTERS)) { - return CASendMessageMultiAdapter(object, responseInfo, CA_RESPONSE_DATA); + return CASendMessageMultiAdapter(object, responseInfo, responseInfo->info.dataType); } else { - return CADetachSendMessage(object, responseInfo, CA_RESPONSE_DATA); + return CADetachSendMessage(object, responseInfo, responseInfo->info.dataType); } } diff --git a/resource/csdk/connectivity/src/cainterfacecontroller.c b/resource/csdk/connectivity/src/cainterfacecontroller.c index 5de93f1..e4dea19 100644 --- a/resource/csdk/connectivity/src/cainterfacecontroller.c +++ b/resource/csdk/connectivity/src/cainterfacecontroller.c @@ -361,7 +361,8 @@ memory_error_exit: return CA_MEMORY_ALLOC_FAILED; } -CAResult_t CASendUnicastData(const CAEndpoint_t *endpoint, const void *data, uint32_t length) +CAResult_t CASendUnicastData(const CAEndpoint_t *endpoint, const void *data, uint32_t length, + CADataType_t dataType) { if (endpoint == NULL) { @@ -406,7 +407,7 @@ CAResult_t CASendUnicastData(const CAEndpoint_t *endpoint, const void *data, uin if (NULL != g_adapterHandler[index].sendData) { OIC_LOG(DEBUG, TAG, "unicast message to adapter"); - sentDataLen = g_adapterHandler[index].sendData(endpoint, data, length); + sentDataLen = g_adapterHandler[index].sendData(endpoint, data, length, dataType); } if (sentDataLen != (int32_t)length) @@ -423,7 +424,8 @@ CAResult_t CASendUnicastData(const CAEndpoint_t *endpoint, const void *data, uin return CA_STATUS_OK; } -CAResult_t CASendMulticastData(const CAEndpoint_t *endpoint, const void *data, uint32_t length) +CAResult_t CASendMulticastData(const CAEndpoint_t *endpoint, const void *data, uint32_t length, + CADataType_t dataType) { u_arraylist_t *list = CAGetSelectedNetworkList(); if (!list) @@ -467,7 +469,7 @@ CAResult_t CASendMulticastData(const CAEndpoint_t *endpoint, const void *data, u return CA_MEMORY_ALLOC_FAILED; } memcpy(payload, data, length); - sentDataLen = g_adapterHandler[index].sendDataToAll(endpoint, payload, length); + sentDataLen = g_adapterHandler[index].sendDataToAll(endpoint, payload, length, dataType); OICFree(payload); } diff --git a/resource/csdk/connectivity/src/camessagehandler.c b/resource/csdk/connectivity/src/camessagehandler.c index 8dea22a..8cc0858 100644 --- a/resource/csdk/connectivity/src/camessagehandler.c +++ b/resource/csdk/connectivity/src/camessagehandler.c @@ -455,7 +455,7 @@ static CAResult_t CAProcessMulticastData(const CAData_t *data) OIC_LOG(DEBUG, TAG, "pdu to send :"); OIC_LOG_BUFFER(DEBUG, TAG, (uint8_t*)pdu->hdr, pdu->length); - res = CASendMulticastData(data->remoteEndpoint, pdu->hdr, pdu->length); + res = CASendMulticastData(data->remoteEndpoint, pdu->hdr, pdu->length, data->dataType); if (CA_STATUS_OK != res) { OIC_LOG_V(ERROR, TAG, "send failed:%d", res); @@ -552,7 +552,8 @@ static CAResult_t CAProcessSendData(const CAData_t *data) #endif // WITH_BWT CALogPDUInfo(pdu, data->remoteEndpoint); - res = CASendUnicastData(data->remoteEndpoint, pdu->hdr, pdu->length); + OIC_LOG_V(INFO, TAG, "CASendUnicastData type : %d", data->dataType); + res = CASendUnicastData(data->remoteEndpoint, pdu->hdr, pdu->length, data->dataType); if (CA_STATUS_OK != res) { OIC_LOG_V(ERROR, TAG, "send failed:%d", res); @@ -574,7 +575,9 @@ static CAResult_t CAProcessSendData(const CAData_t *data) #endif { // for retransmission - res = CARetransmissionSentData(&g_retransmissionContext, data->remoteEndpoint, + res = CARetransmissionSentData(&g_retransmissionContext, + data->remoteEndpoint, + data->dataType, pdu->hdr, pdu->length); if ((CA_STATUS_OK != res) && (CA_NOT_SUPPORTED != res)) { @@ -883,7 +886,7 @@ static CAData_t* CAPrepareSendData(const CAEndpoint_t *endpoint, const void *sen cadata->type = request->isMulticast ? SEND_TYPE_MULTICAST : SEND_TYPE_UNICAST; cadata->requestInfo = request; } - else if (CA_RESPONSE_DATA == dataType) + else if (CA_RESPONSE_DATA == dataType || CA_RESPONSE_FOR_RES == dataType) { // clone response info CAResponseInfo_t *response = CACloneResponseInfo((CAResponseInfo_t *)sendData); diff --git a/resource/csdk/connectivity/src/caretransmission.c b/resource/csdk/connectivity/src/caretransmission.c index 56edbef..4c6f55c 100644 --- a/resource/csdk/connectivity/src/caretransmission.c +++ b/resource/csdk/connectivity/src/caretransmission.c @@ -82,6 +82,7 @@ typedef struct #endif uint8_t triedCount; /**< retransmission count */ uint16_t messageId; /**< coap PDU message id */ + CADataType_t dataType; /**< data Type (Request/Response) */ CAEndpoint_t *endpoint; /**< remote endpoint */ void *pdu; /**< coap PDU */ uint32_t size; /**< coap PDU size */ @@ -196,7 +197,8 @@ static void CACheckRetransmissionList(CARetransmission_t *context) { OIC_LOG_V(DEBUG, TAG, "retransmission CON data!!, msgid=%d", retData->messageId); - context->dataSendMethod(retData->endpoint, retData->pdu, retData->size); + context->dataSendMethod(retData->endpoint, retData->pdu, + retData->size, retData->dataType); } // #3. increase the retransmission count and update timestamp. @@ -358,6 +360,7 @@ CAResult_t CARetransmissionInitialize(CARetransmission_t *context, CAResult_t CARetransmissionSentData(CARetransmission_t *context, const CAEndpoint_t *endpoint, + CADataType_t dataType, const void *pdu, uint32_t size) { if (NULL == context || NULL == endpoint || NULL == pdu) @@ -425,6 +428,7 @@ CAResult_t CARetransmissionSentData(CARetransmission_t *context, retData->endpoint = remoteEndpoint; retData->pdu = pduData; retData->size = size; + retData->dataType = dataType; #ifndef SINGLE_THREAD // mutex lock ca_mutex_lock(context->threadMutex); diff --git a/resource/csdk/connectivity/src/ip_adapter/caipadapter.c b/resource/csdk/connectivity/src/ip_adapter/caipadapter.c index e77f46d..04f16c8 100644 --- a/resource/csdk/connectivity/src/ip_adapter/caipadapter.c +++ b/resource/csdk/connectivity/src/ip_adapter/caipadapter.c @@ -379,13 +379,17 @@ static int32_t CAQueueIPData(bool isMulticast, const CAEndpoint_t *endpoint, } int32_t CASendIPUnicastData(const CAEndpoint_t *endpoint, - const void *data, uint32_t dataLength) + const void *data, uint32_t dataLength, + CADataType_t dataType) { + (void)dataType; return CAQueueIPData(false, endpoint, data, dataLength); } -int32_t CASendIPMulticastData(const CAEndpoint_t *endpoint, const void *data, uint32_t dataLength) +int32_t CASendIPMulticastData(const CAEndpoint_t *endpoint, const void *data, uint32_t dataLength, + CADataType_t dataType) { + (void)dataType; return CAQueueIPData(true, endpoint, data, dataLength); } diff --git a/resource/csdk/connectivity/src/nfc_adapter/canfcadapter.c b/resource/csdk/connectivity/src/nfc_adapter/canfcadapter.c index eddee4d..4f8e57e 100644 --- a/resource/csdk/connectivity/src/nfc_adapter/canfcadapter.c +++ b/resource/csdk/connectivity/src/nfc_adapter/canfcadapter.c @@ -300,13 +300,17 @@ static int32_t CAQueueNFCData(const CAEndpoint_t *endpoint, const void *data, } -int32_t CASendNFCUnicastData(const CAEndpoint_t *endpoint, const void *data, uint32_t dataLength) +int32_t CASendNFCUnicastData(const CAEndpoint_t *endpoint, const void *data, uint32_t dataLength, + CADataType_t dataType) { + (void)dataType; return CAQueueNFCData(endpoint, data, dataLength); } -int32_t CASendNFCMulticastData(const CAEndpoint_t *endpoint, const void *data, uint32_t dataLength) +int32_t CASendNFCMulticastData(const CAEndpoint_t *endpoint, const void *data, uint32_t dataLength, + CADataType_t dataType) { + (void)dataType; return CAQueueNFCData(endpoint, data, dataLength); } diff --git a/resource/csdk/connectivity/src/ra_adapter/caraadapter.c b/resource/csdk/connectivity/src/ra_adapter/caraadapter.c index fba4ca8..86741fe 100644 --- a/resource/csdk/connectivity/src/ra_adapter/caraadapter.c +++ b/resource/csdk/connectivity/src/ra_adapter/caraadapter.c @@ -493,8 +493,10 @@ CAResult_t CAStopRA() } int32_t CASendRAUnicastData(const CAEndpoint_t *remoteEndpoint, const void *data, - uint32_t dataLength) + uint32_t dataLength, CADataType_t dataType) { + SET_BUT_NOT_USED(dataType); + if (!remoteEndpoint || !data) { OIC_LOG(ERROR, RA_ADAPTER_TAG, "Invalid parameter!"); @@ -563,12 +565,14 @@ CAResult_t CAGetRAInterfaceInformation(CAEndpoint_t **info, uint32_t *size) } int32_t CASendRAMulticastData(const CAEndpoint_t *endpoint, - const void *data, uint32_t dataLength) + const void *data, uint32_t dataLength, + CADataType_t dataType) { OIC_LOG(INFO, RA_ADAPTER_TAG, "RA adapter does not support sending multicast data"); SET_BUT_NOT_USED(endpoint); SET_BUT_NOT_USED(data); SET_BUT_NOT_USED(dataLength); + SET_BUT_NOT_USED(dataType); return 0; } @@ -879,8 +883,9 @@ CAResult_t CAStopRA() } int32_t CASendRAUnicastData(const CAEndpoint_t *remoteEndpoint, const void *data, - uint32_t dataLength) + uint32_t dataLength, CADataType_t dataType) { + (void)dataType; if (!remoteEndpoint || !data) { OIC_LOG(ERROR, RA_ADAPTER_TAG, "Invalid parameter!"); @@ -947,7 +952,8 @@ CAResult_t CAGetRAInterfaceInformation(CAEndpoint_t **info, uint32_t *size) } int32_t CASendRAMulticastData(const CAEndpoint_t *endpoint, - const void *data, uint32_t dataLength) + const void *data, uint32_t dataLength, + CADataType_t dataType) { OIC_LOG(INFO, RA_ADAPTER_TAG, "RA adapter does not support sending multicast data"); return 0; diff --git a/resource/csdk/connectivity/src/tcp_adapter/catcpadapter.c b/resource/csdk/connectivity/src/tcp_adapter/catcpadapter.c index d81f600..b9f2c11 100644 --- a/resource/csdk/connectivity/src/tcp_adapter/catcpadapter.c +++ b/resource/csdk/connectivity/src/tcp_adapter/catcpadapter.c @@ -368,9 +368,11 @@ static size_t CAQueueTCPData(bool isMulticast, const CAEndpoint_t *endpoint, } int32_t CASendTCPUnicastData(const CAEndpoint_t *endpoint, - const void *data, uint32_t dataLength) + const void *data, uint32_t dataLength, + CADataType_t dataType) { OIC_LOG(DEBUG, TAG, "IN"); + (void)dataType; #ifndef SINGLE_THREAD return CAQueueTCPData(false, endpoint, data, dataLength); #else @@ -380,8 +382,10 @@ int32_t CASendTCPUnicastData(const CAEndpoint_t *endpoint, } int32_t CASendTCPMulticastData(const CAEndpoint_t *endpoint, - const void *data, uint32_t dataLength) + const void *data, uint32_t dataLength, + CADataType_t dataType) { + (void)dataType; return CAQueueTCPData(true, endpoint, data, dataLength); } diff --git a/resource/csdk/connectivity/test/ca_api_unittest.cpp b/resource/csdk/connectivity/test/ca_api_unittest.cpp index eccca11..d45ef4d 100644 --- a/resource/csdk/connectivity/test/ca_api_unittest.cpp +++ b/resource/csdk/connectivity/test/ca_api_unittest.cpp @@ -344,6 +344,7 @@ TEST_F(CATests, SendResponseTestWithInvalidCode) responseData.type = CA_MSG_RESET; responseData.messageId = 1; responseData.payload = (CAPayload_t)malloc(sizeof("response payload")); + responseData.dataType = CA_RESPONSE_DATA; EXPECT_TRUE(responseData.payload != NULL); @@ -376,6 +377,7 @@ TEST(SendResponseTest, DISABLED_TC_19_Positive_01) responseData.type = CA_MSG_NONCONFIRM; responseData.messageId = 1; responseData.payload = (CAPayload_t)malloc(sizeof("response payload")); + responseData.dataType = CA_RESPONSE_DATA; EXPECT_TRUE(responseData.payload != NULL); if(!responseData.payload) @@ -413,6 +415,7 @@ TEST(SendResponseTest, DISABLED_TC_20_Negative_01) responseData.type = CA_MSG_NONCONFIRM; responseData.messageId = 1; responseData.payload = (CAPayload_t)malloc(sizeof("response payload")); + responseData.dataType = CA_RESPONSE_DATA; EXPECT_TRUE(responseData.payload != NULL); if(!responseData.payload) diff --git a/resource/csdk/stack/include/internal/ocstackinternal.h b/resource/csdk/stack/include/internal/ocstackinternal.h index 7120951..e067d28 100644 --- a/resource/csdk/stack/include/internal/ocstackinternal.h +++ b/resource/csdk/stack/include/internal/ocstackinternal.h @@ -202,7 +202,8 @@ OCStackResult HandleStackRequests(OCServerProtocolRequest * protocolRequest); OCStackResult SendDirectStackResponse(const CAEndpoint_t* endPoint, const uint16_t coapID, const CAResponseResult_t responseResult, const CAMessageType_t type, const uint8_t numOptions, const CAHeaderOption_t *options, - CAToken_t token, uint8_t tokenLength, const char *resourceUri); + CAToken_t token, uint8_t tokenLength, const char *resourceUri, + CADataType_t dataType); #ifdef WITH_PRESENCE diff --git a/resource/csdk/stack/src/ocstack.c b/resource/csdk/stack/src/ocstack.c index 28f9645..7498896 100644 --- a/resource/csdk/stack/src/ocstack.c +++ b/resource/csdk/stack/src/ocstack.c @@ -1447,7 +1447,7 @@ void OCHandleResponse(const CAEndpoint_t* endPoint, const CAResponseInfo_t* resp if(responseInfo->info.type == CA_MSG_CONFIRM) { SendDirectStackResponse(endPoint, responseInfo->info.messageId, CA_EMPTY, - CA_MSG_ACKNOWLEDGE, 0, NULL, NULL, 0, NULL); + CA_MSG_ACKNOWLEDGE, 0, NULL, NULL, 0, NULL, CA_RESPONSE_FOR_RES); } OCPayloadDestroy(response.payload); @@ -1497,7 +1497,7 @@ void OCHandleResponse(const CAEndpoint_t* endPoint, const CAResponseInfo_t* resp { OIC_LOG(INFO, TAG, "Received a message without callbacks. Sending RESET"); SendDirectStackResponse(endPoint, responseInfo->info.messageId, CA_EMPTY, - CA_MSG_RESET, 0, NULL, NULL, 0, NULL); + CA_MSG_RESET, 0, NULL, NULL, 0, NULL, CA_RESPONSE_FOR_RES); } } @@ -1611,7 +1611,8 @@ void HandleCAErrorResponse(const CAEndpoint_t *endPoint, const CAErrorInfo_t *er OCStackResult SendDirectStackResponse(const CAEndpoint_t* endPoint, const uint16_t coapID, const CAResponseResult_t responseResult, const CAMessageType_t type, const uint8_t numOptions, const CAHeaderOption_t *options, - CAToken_t token, uint8_t tokenLength, const char *resourceUri) + CAToken_t token, uint8_t tokenLength, const char *resourceUri, + CADataType_t dataType) { OIC_LOG(DEBUG, TAG, "Entering SendDirectStackResponse"); CAResponseInfo_t respInfo = { @@ -1635,6 +1636,7 @@ OCStackResult SendDirectStackResponse(const CAEndpoint_t* endPoint, const uint16 respInfo.info.type = type; respInfo.info.resourceUri = OICStrdup (resourceUri); respInfo.info.acceptFormat = CA_FORMAT_UNDEFINED; + respInfo.info.dataType = dataType; #if defined (ROUTING_GATEWAY) || defined (ROUTING_EP) // Add the destination to route option from the endpoint->routeData. @@ -1870,7 +1872,8 @@ void OCHandleRequests(const CAEndpoint_t* endPoint, const CARequestInfo_t* reque SendDirectStackResponse(endPoint, requestInfo->info.messageId, CA_BAD_REQ, requestInfo->info.type, requestInfo->info.numOptions, requestInfo->info.options, requestInfo->info.token, - requestInfo->info.tokenLength, requestInfo->info.resourceUri); + requestInfo->info.tokenLength, requestInfo->info.resourceUri, + CA_RESPONSE_DATA); OICFree(serverRequest.payload); return; } @@ -1889,7 +1892,8 @@ void OCHandleRequests(const CAEndpoint_t* endPoint, const CARequestInfo_t* reque SendDirectStackResponse(endPoint, requestInfo->info.messageId, CA_INTERNAL_SERVER_ERROR, requestInfo->info.type, requestInfo->info.numOptions, requestInfo->info.options, requestInfo->info.token, - requestInfo->info.tokenLength, requestInfo->info.resourceUri); + requestInfo->info.tokenLength, requestInfo->info.resourceUri, + CA_RESPONSE_DATA); OICFree(serverRequest.payload); return; } @@ -1940,7 +1944,8 @@ void OCHandleRequests(const CAEndpoint_t* endPoint, const CARequestInfo_t* reque SendDirectStackResponse(endPoint, requestInfo->info.messageId, CA_BAD_OPT, requestInfo->info.type, requestInfo->info.numOptions, requestInfo->info.options, requestInfo->info.token, - requestInfo->info.tokenLength, requestInfo->info.resourceUri); + requestInfo->info.tokenLength, requestInfo->info.resourceUri, + CA_RESPONSE_DATA); OICFree(serverRequest.payload); OICFree(serverRequest.requestToken); return; @@ -1960,7 +1965,8 @@ void OCHandleRequests(const CAEndpoint_t* endPoint, const CARequestInfo_t* reque if (requestInfo->info.type == CA_MSG_CONFIRM) { SendDirectStackResponse(endPoint, requestInfo->info.messageId, CA_EMPTY, - CA_MSG_ACKNOWLEDGE,0, NULL, NULL, 0, NULL); + CA_MSG_ACKNOWLEDGE,0, NULL, NULL, 0, NULL, + CA_RESPONSE_DATA); } } else if(!OCResultToSuccess(requestResult)) @@ -1973,7 +1979,8 @@ void OCHandleRequests(const CAEndpoint_t* endPoint, const CARequestInfo_t* reque SendDirectStackResponse(endPoint, requestInfo->info.messageId, stackResponse, requestInfo->info.type, requestInfo->info.numOptions, requestInfo->info.options, requestInfo->info.token, - requestInfo->info.tokenLength, requestInfo->info.resourceUri); + requestInfo->info.tokenLength, requestInfo->info.resourceUri, + CA_RESPONSE_DATA); } // requestToken is fed to HandleStackRequests, which then goes to AddServerRequest. // The token is copied in there, and is thus still owned by this function. diff --git a/resource/csdk/stack/src/oickeepalive.c b/resource/csdk/stack/src/oickeepalive.c index 2dd2b2f..f0ae1cd 100644 --- a/resource/csdk/stack/src/oickeepalive.c +++ b/resource/csdk/stack/src/oickeepalive.c @@ -356,7 +356,7 @@ OCStackResult HandleKeepAliveGETRequest(const CAEndpoint_t* endPoint, SendDirectStackResponse(endPoint, requestInfo->info.messageId, result, requestInfo->info.type, requestInfo->info.numOptions, requestInfo->info.options, requestInfo->info.token, requestInfo->info.tokenLength, - requestInfo->info.resourceUri); + requestInfo->info.resourceUri, CA_RESPONSE_DATA); return OC_STACK_OK; } @@ -396,7 +396,7 @@ OCStackResult HandleKeepAlivePUTRequest(const CAEndpoint_t* endPoint, SendDirectStackResponse(endPoint, requestInfo->info.messageId, CA_CHANGED, requestInfo->info.type, requestInfo->info.numOptions, requestInfo->info.options, requestInfo->info.token, requestInfo->info.tokenLength, - requestInfo->info.resourceUri); + requestInfo->info.resourceUri, CA_RESPONSE_DATA); return OC_STACK_OK; } -- 2.7.4