size_t headerLen;
CAGetTCPHeaderDetails(recvBuffer, &transport, &headerLen);
if (totalReceivedLen >= headerLen)
size_t headerLen;
CAGetTCPHeaderDetails(recvBuffer, &transport, &headerLen);
if (totalReceivedLen >= headerLen)
- {.endpoint = {.adapter = CA_ADAPTER_TCP, .port = tcpClientPort}};
+ {.endpoint = {.adapter = CA_ADAPTER_TCP,
+ .flags = CA_DEFAULT_FLAGS,
+ .port = tcpClientPort}};
IPAddress clientIP = tcpClientIP;
int ret = snprintf(ep.endpoint.addr, sizeof(ep.endpoint.addr), "%d.%d.%d.%d",
IPAddress clientIP = tcpClientIP;
int ret = snprintf(ep.endpoint.addr, sizeof(ep.endpoint.addr), "%d.%d.%d.%d",
-static void sendData(const CAEndpoint_t *endpoint,
- const void *data, size_t dlen)
+static ssize_t sendData(const CAEndpoint_t *endpoint,
+ const void *data, size_t dlen)
&parsedPort) != CA_STATUS_OK)
{
OIC_LOG(ERROR, TAG, "parse fail");
&parsedPort) != CA_STATUS_OK)
{
OIC_LOG(ERROR, TAG, "parse fail");
}
if (dlen > 65535) // Max value for uint16_t
{
// This will never happen as max buffer size we are dealing with is COAP_MAX_PDU_SIZE
OIC_LOG(ERROR, TAG, "Size exceeded");
}
if (dlen > 65535) // Max value for uint16_t
{
// This will never happen as max buffer size we are dealing with is COAP_MAX_PDU_SIZE
OIC_LOG(ERROR, TAG, "Size exceeded");
-void CATCPSendData(CAEndpoint_t *endpoint, const void *data, uint32_t datalen,
- bool isMulticast)
+ssize_t CATCPSendData(CAEndpoint_t *endpoint, const void *data, size_t datalen)
{
VERIFY_NON_NULL_VOID(endpoint, TAG, "endpoint is NULL");
VERIFY_NON_NULL_VOID(data, TAG, "data is NULL");
{
VERIFY_NON_NULL_VOID(endpoint, TAG, "endpoint is NULL");
VERIFY_NON_NULL_VOID(data, TAG, "data is NULL");
- if (caglobals.tcp.ipv4tcpenabled && (endpoint->adapter & CA_ADAPTER_TCP))
- {
- sendData(endpoint, data, datalen);
- }
+ return sendData(endpoint, data, datalen);