/* data is NULL unless explicitly set by coap_add_data() */
pdu->length = length;
}
+#else
+ (void)length;
#endif
}
coap_pdu_t *
coap_new_pdu(coap_transport_type transport, unsigned int size)
{
+#ifndef WITH_TCP
+ (void)size;
+#endif
coap_pdu_t *pdu;
#ifndef WITH_CONTIKI
OIC_LOG_V(DEBUG, TAG, "[%d]adapter status is changed to [%d]", adapter, status);
}
+#if defined(TCP_ADAPTER) || defined(EDR_ADAPTER) || defined(LE_ADAPTER)
static void CAConnectionChangedCallback(const CAEndpoint_t *info, bool isConnected)
{
// Call the callback.
}
OIC_LOG_V(DEBUG, TAG, "[%s] connection status is changed to [%d]", info->addr, isConnected);
}
+#endif
static void CAAdapterErrorHandleCallback(const CAEndpoint_t *endpoint,
const void *data, uint32_t dataLen,
OIC_LOG_V(DEBUG,
TAG,
- "%zu adapter network info size is %" PRIu32 " res:%d",
+ "%" PRIu32 " adapter network info size is %" PRIu32 " res:%d",
index,
tempSize[index],
res);
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#ifdef TB_LOG
+#include <inttypes.h>
+#endif
#ifndef SINGLE_THREAD
#ifdef HAVE_UNISTD_H
if (currentTime >= retData->timeStamp + timeout)
{
- OIC_LOG_V(DEBUG, TAG, "%llu microseconds time out!!, tried count(%d)",
+ OIC_LOG_V(DEBUG, TAG, "%" PRIu64 " microseconds time out!!, tried count(%d)",
timeout, retData->triedCount);
return true;
}
else if (!context->isStop)
{
// check each RETRANSMISSION_CHECK_PERIOD_SEC time.
- OIC_LOG_V(DEBUG, TAG, "wait..(%lld)microseconds",
+ OIC_LOG_V(DEBUG, TAG, "wait..(%" PRIu64 ")microseconds",
RETRANSMISSION_CHECK_PERIOD_SEC * (uint64_t) USECS_PER_SEC);
// wait
return;
}
- char *secure = (endpoint->flags & CA_SECURE) ? "secure " : "";
-
- (void)secure; // eliminates unused-variable waring when built in release mode
(void)cast; // eliminates release warning
(void)fam;
{
socklen = sizeof(struct sockaddr_in);
}
+
+#ifdef TB_LOG
+ const char *secure = (endpoint->flags & CA_SECURE) ? "secure " : "";
+#endif
#if !defined(_WIN32)
ssize_t len = sendto(fd, data, dlen, 0, (struct sockaddr *)&sock, socklen);
if (OC_SOCKET_ERROR == len)
remainLen -= len;
} while (remainLen > 0);
+#ifndef TB_LOG
+ (void)fam;
+#endif
OIC_LOG_V(INFO, TAG, "unicast %stcp sendTo is successful: %zu bytes", fam, dlen);
}
CoAPOptionCase cases[] = {
{COAP_OPTION_URI_PATH, 113, "oic"
- "123456789012345678901234567890123456789012345678901234567890"
- "12345678901234567890123456789012345678901234567890"},
+ "123456789012345678901234567890123456789012345678901234567890"
+ "12345678901234567890123456789012345678901234567890"},
{COAP_OPTION_URI_PATH, 3, "res"},
{COAP_OPTION_URI_QUERY, 14, "rt=core.sensor"},
{COAP_OPTION_URI_QUERY, 13, "if=core.mi.ll"},
CAInfo_t inData;
memset(&inData, 0, sizeof(CAInfo_t));
- inData.token = "token";
+ inData.token = (CAToken_t)"token";
inData.tokenLength = strlen(inData.token);
inData.type = CA_MSG_NONCONFIRM;
int dummy[1000] = {0};
size_t cap = sizeof(dummy) / sizeof(dummy[0]);
- for (int i = 0; i < cap; ++i)
+ for (size_t i = 0; i < cap; ++i)
{
dummy[i] = i;
EXPECT_EQ(CA_STATUS_OK, u_linklist_add(list, &dummy[i]));
char* OCCreateString(const OCStringLL* ll)
{
+ if (!ll)
+ {
+ return NULL;
+ }
+
char *str = NULL;
char *pos = NULL;
size_t len = 0;
size_t sublen = 0;
int count = 0;
- if (!ll) return NULL;
-
- for (const OCStringLL *it = ll; it ; it = it->next )
+ for (const OCStringLL *it = ll; it; it = it->next)
{
len += strlen(it->value) + 1;
}
len--; // renove trailing separator (just added above)
str = (char*) malloc(len + 1);
if (!str)
+ {
return NULL;
+ }
pos = str;
const OCStringLL *it = ll;
{
sublen = strlen(it->value);
count = snprintf(pos, len + 1, "%s", it->value);
- if (count<sublen)
+ if ((size_t)count < sublen)
{
free(str);
return NULL;
}
- len-=sublen;
- pos+=count;
+ len -= sublen;
+ pos += count;
it = it->next;
if (it)
{
OIC_LOG_V(ERROR, TAG,
"encodeAddressForRFC6874 failed: "
- "outputSize (%d) < inputSize (%d)",
+ "outputSize (%zu) < inputSize (%zu)",
outputSize, inputSize);
return OC_STACK_ERROR;
VERIFY_NON_NULL_NR(entry, FATAL);
OIC_LOG_V(DEBUG, TAG, "Total interval counts: %d", entry->intervalSize);
- if (entry->intervalSize > entry->currIndex + 1)
+ if (entry->intervalSize > (size_t)entry->currIndex + 1)
{
entry->currIndex++;
entry->interval = entry->intervalInfo[entry->currIndex];
// This is a function called back when a device is discovered
OCStackApplicationResult applicationDiscoverCB(
OCClientResponse * clientResponse) {
+ (void)clientResponse;
OIC_LOG(INFO, TAG, "Entering applicationDiscoverCB (Application Layer CB)");
OIC_LOG_V(INFO, TAG, "Device =============> Discovered %s @ %s:%d",
clientResponse->resourceUri,
#include "OCPlatform.h"
#include "OCApi.h"
-#define MAX_URI_LENGTH (64)
#define MAX_PERMISSION_LENGTH (5)
#define CREATE (1)
#define READ (2)