CMConfigureInfo_t cmInfo;
} CAUtilConfig_t;
+#if defined(__TIZEN__)
+
#define MAX_IP_LENGTH 46
typedef struct
u_int32_t tcpi_total_retrans;
} TCPInfo;
+#endif
+
/**
* Callback function type for connection status changes delivery.
* @param[out] info Remote endpoint information.
* @param[in] data Advertisment Data buffer.
* @param[in] length Length of buffer.
*
- * @return ::CA_STATUS_OK or ::CA_STATUS_FAILED or ::CA_STATUS_INVALID_PARAM
+ * @return ::CA_STATUS_OK or ::CA_STATUS_FAILED or ::CA_STATUS_INVALID_PARAM
*/
CAResult_t CASetAdvertisementData(const char* data, int length);
/**
* Set function that will be called before starting advertising.
* Provided data and length will be used to set advertisement data.
- * @param[in] getter Custom advertisement data getter callback.
+ * @param[in] getter Custom advertisement data getter callback.
*
*/
void CASetAdvertisementDataGetter(CAAdvertisementDataGetterCB getter);
* Scan and set data for custom bluetooth advertisement.
* @param[in] data Array with custom bluetooth advertisement data.
* @param[in] length Length of data array.
- * @return ::CA_STATUS_OK or ::CA_STATUS_FAILED or ::CA_STATUS_INVALID_PARAM
+ * @return ::CA_STATUS_OK or ::CA_STATUS_FAILED or ::CA_STATUS_INVALID_PARAM
*/
CAResult_t CASetScanResponseData(const char* data, int length);
CAResult_t CAUtilStartGattServer();
CAResult_t CAUtilStopGattServer();
+
+#if defined(__TIZEN__)
CAResult_t CAGetTCPIPHeader(CATransportAdapter_t adapter, int flag, TCPHeaderInfo* info);
+#endif
#ifdef __cplusplus
} /* extern "C" */
#include "cathreadpool.h"
#include "cainterface.h"
#include <coap/pdu.h>
+
+#if defined(__TIZEN__)
#include "cautilinterface.h"
+#endif
#ifdef __cplusplus
extern "C"
*/
void CATerminateTCP();
+#if defined(__TIZEN__)
/**
* Gets TCP Header Information
* @return ::CA_STATUS_OK or Appropriate error code.
*/
CAResult_t CAGetTCPIPHeaderInfo(CATransportFlags_t flag, TCPHeaderInfo* tcpHeaderInfo);
+#endif
#ifdef TCP_ADAPTER
/**
*
******************************************************************/
-#include <netdb.h>
-#include <ifaddrs.h>
-#include <netinet/tcp.h>
-#include <net/if.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
+
+#if defined(__TIZEN__)
+#include <netdb.h>
+#include <ifaddrs.h>
+#include <netinet/tcp.h>
+#include <net/if.h>
#include <errno.h>
#include <arpa/inet.h>
#include <sys/socket.h>
+#endif
#ifndef __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS
#define CA_TCP_SELECT_TIMEOUT 10
+#if defined(__TIZEN__)
#define CA_IPV4_VERSION 4
#define CA_IPV6_VERSION 6
+#endif
+
/**
* Mutex to synchronize TCP adapter access.
*/
CAFreeTCPData(TCPData);
}
+#if defined(__TIZEN__)
void CAGetTCPLocalIP(CATransportFlags_t flag, char* localIP)
{
//int targetPort;
OIC_LOG_V(DEBUG, TAG, "src_addr = %s", localIP);
}
-int CAGetSocketInformation(u_int8_t* destIP, u_int32_t *destPort){
-
+int CAGetSocketInformation(u_int8_t* destIP, u_int32_t *destPort)
+{
oc_mutex_lock(g_mutexAdapter);
uint32_t length = u_arraylist_length(caglobals.tcp.svrlist);
for (size_t i = 0; i < length; i++)
return res;
}
+#endif
#ifdef SINGLE_THREAD
size_t CAGetTotalLengthFromPacketHeader(const unsigned char *recvBuffer, size_t size)