//-----------------------------------------------------------------------------
#define TAG "OIC_RI_STACK"
#define VERIFY_SUCCESS(op, successCode) { if ((op) != (successCode)) \
- {OC_LOG_V(FATAL, TAG, "%s failed!!", #op); goto exit;} }
-#define VERIFY_NON_NULL(arg, logLevel, retVal) { if (!(arg)) { OC_LOG((logLevel), \
+ {OIC_LOG_V(FATAL, TAG, "%s failed!!", #op); goto exit;} }
+#define VERIFY_NON_NULL(arg, logLevel, retVal) { if (!(arg)) { OIC_LOG((logLevel), \
TAG, #arg " is NULL"); return (retVal); } }
-#define VERIFY_NON_NULL_NR(arg, logLevel) { if (!(arg)) { OC_LOG((logLevel), \
+#define VERIFY_NON_NULL_NR(arg, logLevel) { if (!(arg)) { OIC_LOG((logLevel), \
TAG, #arg " is NULL"); return; } }
-#define VERIFY_NON_NULL_V(arg) { if (!arg) {OC_LOG(FATAL, TAG, #arg " is NULL");\
+#define VERIFY_NON_NULL_V(arg) { if (!arg) {OIC_LOG(FATAL, TAG, #arg " is NULL");\
goto exit;} }
//TODO: we should allow the server to define this
&(requestInfo->info.numOptions));
if (OC_STACK_OK != rmResult)
{
- OC_LOG(ERROR, TAG, "Add destination option failed");
+ OIC_LOG(ERROR, TAG, "Add destination option failed");
return rmResult;
}
#endif
CAResult_t result = CASendRequest(object, requestInfo);
if(CA_STATUS_OK != result)
{
- OC_LOG_V(ERROR, TAG, "CASendRequest failed with CA error %u", result);
+ OIC_LOG_V(ERROR, TAG, "CASendRequest failed with CA error %u", result);
return CAResultToOCResult(result);
}
return OC_STACK_OK;
switch(status)
{
case OC_OBSERVER_NOT_INTERESTED:
- OC_LOG(DEBUG, TAG, "observer not interested in our notifications");
+ OIC_LOG(DEBUG, TAG, "observer not interested in our notifications");
observer = GetObserverUsingToken (token, tokenLength);
if(observer)
{
result = DeleteObserverUsingToken (token, tokenLength);
if(result == OC_STACK_OK)
{
- OC_LOG(DEBUG, TAG, "Removed observer successfully");
+ OIC_LOG(DEBUG, TAG, "Removed observer successfully");
}
else
{
result = OC_STACK_OK;
- OC_LOG(DEBUG, TAG, "Observer Removal failed");
+ OIC_LOG(DEBUG, TAG, "Observer Removal failed");
}
break;
case OC_OBSERVER_STILL_INTERESTED:
- OC_LOG(DEBUG, TAG, "observer still interested, reset the failedCount");
+ OIC_LOG(DEBUG, TAG, "observer still interested, reset the failedCount");
observer = GetObserverUsingToken (token, tokenLength);
if(observer)
{
break;
case OC_OBSERVER_FAILED_COMM:
- OC_LOG(DEBUG, TAG, "observer is unreachable");
+ OIC_LOG(DEBUG, TAG, "observer is unreachable");
observer = GetObserverUsingToken (token, tokenLength);
if(observer)
{
result = DeleteObserverUsingToken (token, tokenLength);
if(result == OC_STACK_OK)
{
- OC_LOG(DEBUG, TAG, "Removed observer successfully");
+ OIC_LOG(DEBUG, TAG, "Removed observer successfully");
}
else
{
result = OC_STACK_OK;
- OC_LOG(DEBUG, TAG, "Observer Removal failed");
+ OIC_LOG(DEBUG, TAG, "Observer Removal failed");
}
}
else
result = OC_STACK_CONTINUE;
}
observer->forceHighQos = 1;
- OC_LOG_V(DEBUG, TAG, "Failed count for this observer is %d",observer->failedCommCount);
+ OIC_LOG_V(DEBUG, TAG, "Failed count for this observer is %d",observer->failedCommCount);
}
break;
default:
- OC_LOG(ERROR, TAG, "Unknown status");
+ OIC_LOG(ERROR, TAG, "Unknown status");
result = OC_STACK_ERROR;
break;
}
// This should not happen but,
// give it a value just in case but output an error
ret = CA_CONTENT;
- OC_LOG_V(ERROR, TAG, "Unexpected OC_STACK_OK return code for method [%d].", method);
+ OIC_LOG_V(ERROR, TAG, "Unexpected OC_STACK_OK return code for method [%d].", method);
}
break;
case OC_STACK_RESOURCE_CREATED:
return OC_STACK_INVALID_PARAM;
}
- OC_LOG_V(INFO, TAG, "Update presence TTL, time is %u", GetTicks(0));
+ OIC_LOG_V(INFO, TAG, "Update presence TTL, time is %u", GetTicks(0));
cbNode->presence->TTL = maxAgeSeconds;
cbNode->presence->timeOut[index] = OCGetRandomRange(lowerBound, higherBound);
- OC_LOG_V(DEBUG, TAG, "lowerBound timeout %d", lowerBound);
- OC_LOG_V(DEBUG, TAG, "higherBound timeout %d", higherBound);
- OC_LOG_V(DEBUG, TAG, "timeOut entry %d", cbNode->presence->timeOut[index]);
+ OIC_LOG_V(DEBUG, TAG, "lowerBound timeout %d", lowerBound);
+ OIC_LOG_V(DEBUG, TAG, "higherBound timeout %d", higherBound);
+ OIC_LOG_V(DEBUG, TAG, "timeOut entry %d", cbNode->presence->timeOut[index]);
}
cbNode->presence->TTLlevel = 0;
- OC_LOG_V(DEBUG, TAG, "this TTL level %d", cbNode->presence->TTLlevel);
+ OIC_LOG_V(DEBUG, TAG, "this TTL level %d", cbNode->presence->TTLlevel);
return OC_STACK_OK;
}
if (responseInfo->result != CA_CONTENT)
{
- OC_LOG_V(ERROR, TAG, "HandlePresenceResponse failed %d", responseInfo->result);
+ OIC_LOG_V(ERROR, TAG, "HandlePresenceResponse failed %d", responseInfo->result);
return OC_STACK_ERROR;
}
if (!presenceSubscribe && !multicastPresenceSubscribe)
{
- OC_LOG(ERROR, TAG, "Received a presence notification, but no callback, ignoring");
+ OIC_LOG(ERROR, TAG, "Received a presence notification, but no callback, ignoring");
goto exit;
}
if(result != OC_STACK_OK)
{
- OC_LOG(ERROR, TAG, "Presence parse failed");
+ OIC_LOG(ERROR, TAG, "Presence parse failed");
goto exit;
}
if(!response.payload || response.payload->type != PAYLOAD_TYPE_PRESENCE)
{
- OC_LOG(ERROR, TAG, "Presence payload was wrong type");
+ OIC_LOG(ERROR, TAG, "Presence payload was wrong type");
result = OC_STACK_ERROR;
goto exit;
}
{
if(cbNode->sequenceNumber == response.sequenceNumber)
{
- OC_LOG(INFO, TAG, "No presence change");
+ OIC_LOG(INFO, TAG, "No presence change");
ResetPresenceTTL(cbNode, maxAge);
- OC_LOG_V(INFO, TAG, "ResetPresenceTTL - TTLlevel:%d\n", cbNode->presence->TTLlevel);
+ OIC_LOG_V(INFO, TAG, "ResetPresenceTTL - TTLlevel:%d\n", cbNode->presence->TTLlevel);
goto exit;
}
if(maxAge == 0)
{
- OC_LOG(INFO, TAG, "Stopping presence");
+ OIC_LOG(INFO, TAG, "Stopping presence");
response.result = OC_STACK_PRESENCE_STOPPED;
if(cbNode->presence)
{
if(!(cbNode->presence))
{
- OC_LOG(ERROR, TAG, "Could not allocate memory for cbNode->presence");
+ OIC_LOG(ERROR, TAG, "Could not allocate memory for cbNode->presence");
result = OC_STACK_NO_MEMORY;
goto exit;
}
cbNode->presence->timeOut = (uint32_t *)
OICMalloc(PresenceTimeOutSize * sizeof(uint32_t));
if(!(cbNode->presence->timeOut)){
- OC_LOG(ERROR, TAG,
+ OIC_LOG(ERROR, TAG,
"Could not allocate memory for cbNode->presence->timeOut");
OICFree(cbNode->presence);
result = OC_STACK_NO_MEMORY;
{
if(mcNode->nonce == response.sequenceNumber)
{
- OC_LOG(INFO, TAG, "No presence change (Multicast)");
+ OIC_LOG(INFO, TAG, "No presence change (Multicast)");
goto exit;
}
mcNode->nonce = response.sequenceNumber;
if(maxAge == 0)
{
- OC_LOG(INFO, TAG, "Stopping presence");
+ OIC_LOG(INFO, TAG, "Stopping presence");
response.result = OC_STACK_PRESENCE_STOPPED;
}
}
char* uri = OICStrdup(presenceUri);
if (!uri)
{
- OC_LOG(INFO, TAG,
+ OIC_LOG(INFO, TAG,
"No Memory for URI to store in the presence node");
result = OC_STACK_NO_MEMORY;
goto exit;
result = AddMCPresenceNode(&mcNode, uri, response.sequenceNumber);
if(result == OC_STACK_NO_MEMORY)
{
- OC_LOG(INFO, TAG,
+ OIC_LOG(INFO, TAG,
"No Memory for Multicast Presence Node");
OICFree(uri);
goto exit;
VERIFY_NON_NULL_NR(endPoint, FATAL);
VERIFY_NON_NULL_NR(responseInfo, FATAL);
- OC_LOG(INFO, TAG, "Enter HandleCAResponses");
+ OIC_LOG(INFO, TAG, "Enter HandleCAResponses");
#if defined (ROUTING_GATEWAY) || defined (ROUTING_EP)
#ifdef ROUTING_GATEWAY
&needRIHandling);
if(ret != OC_STACK_OK || !needRIHandling)
{
- OC_LOG_V(INFO, TAG, "Routing status![%d]. Not forwarding to RI", ret);
+ OIC_LOG_V(INFO, TAG, "Routing status![%d]. Not forwarding to RI", ret);
return;
}
#endif
if(cbNode)
{
- OC_LOG(INFO, TAG, "There is a cbNode associated with the response token");
+ OIC_LOG(INFO, TAG, "There is a cbNode associated with the response token");
if(responseInfo->result == CA_EMPTY)
{
- OC_LOG(INFO, TAG, "Receiving A ACK/RESET for this token");
+ OIC_LOG(INFO, TAG, "Receiving A ACK/RESET for this token");
// We do not have a case for the client to receive a RESET
if(responseInfo->info.type == CA_MSG_ACKNOWLEDGE)
{
//This is the case of receiving an ACK on a request to a slow resource!
- OC_LOG(INFO, TAG, "This is a pure ACK");
+ OIC_LOG(INFO, TAG, "This is a pure ACK");
//TODO: should we inform the client
// app that at least the request was received at the server?
}
}
else if(responseInfo->result == CA_RETRANSMIT_TIMEOUT)
{
- OC_LOG(INFO, TAG, "Receiving A Timeout for this token");
- OC_LOG(INFO, TAG, "Calling into application address space");
+ OIC_LOG(INFO, TAG, "Receiving A Timeout for this token");
+ OIC_LOG(INFO, TAG, "Calling into application address space");
OCClientResponse response =
{.devAddr = {.adapter = OC_DEFAULT_ADAPTER}};
}
else
{
- OC_LOG(INFO, TAG, "This is a regular response, A client call back is found");
- OC_LOG(INFO, TAG, "Calling into application address space");
+ OIC_LOG(INFO, TAG, "This is a regular response, A client call back is found");
+ OIC_LOG(INFO, TAG, "Calling into application address space");
OCClientResponse response =
{.devAddr = {.adapter = OC_DEFAULT_ADAPTER}};
}
else
{
- OC_LOG_V(ERROR, TAG, "Unknown Payload type in Discovery: %d %s",
+ OIC_LOG_V(ERROR, TAG, "Unknown Payload type in Discovery: %d %s",
cbNode->method, cbNode->requestUri);
return;
}
}
if (type == PAYLOAD_TYPE_INVALID)
{
- OC_LOG_V(INFO, TAG, "Assuming PAYLOAD_TYPE_REPRESENTATION: %d %s",
+ OIC_LOG_V(INFO, TAG, "Assuming PAYLOAD_TYPE_REPRESENTATION: %d %s",
cbNode->method, cbNode->requestUri);
type = PAYLOAD_TYPE_REPRESENTATION;
}
}
else
{
- OC_LOG_V(ERROR, TAG, "Unknown Payload type: %d %s",
+ OIC_LOG_V(ERROR, TAG, "Unknown Payload type: %d %s",
cbNode->method, cbNode->requestUri);
return;
}
responseInfo->info.payload,
responseInfo->info.payloadSize))
{
- OC_LOG(ERROR, TAG, "Error converting payload");
+ OIC_LOG(ERROR, TAG, "Error converting payload");
OCPayloadDestroy(response.payload);
return;
}
if(response.numRcvdVendorSpecificHeaderOptions > MAX_HEADER_OPTIONS)
{
- OC_LOG(ERROR, TAG, "#header options are more than MAX_HEADER_OPTIONS");
+ OIC_LOG(ERROR, TAG, "#header options are more than MAX_HEADER_OPTIONS");
OCPayloadDestroy(response.payload);
return;
}
response.sequenceNumber > OC_OFFSET_SEQUENCE_NUMBER &&
response.sequenceNumber <= cbNode->sequenceNumber)
{
- OC_LOG_V(INFO, TAG, "Received stale notification. Number :%d",
+ OIC_LOG_V(INFO, TAG, "Received stale notification. Number :%d",
response.sequenceNumber);
}
else
if(observer)
{
- OC_LOG(INFO, TAG, "There is an observer associated with the response token");
+ OIC_LOG(INFO, TAG, "There is an observer associated with the response token");
if(responseInfo->result == CA_EMPTY)
{
- OC_LOG(INFO, TAG, "Receiving A ACK/RESET for this token");
+ OIC_LOG(INFO, TAG, "Receiving A ACK/RESET for this token");
if(responseInfo->info.type == CA_MSG_RESET)
{
- OC_LOG(INFO, TAG, "This is a RESET");
+ OIC_LOG(INFO, TAG, "This is a RESET");
OCStackFeedBack(responseInfo->info.token, responseInfo->info.tokenLength,
OC_OBSERVER_NOT_INTERESTED);
}
else if(responseInfo->info.type == CA_MSG_ACKNOWLEDGE)
{
- OC_LOG(INFO, TAG, "This is a pure ACK");
+ OIC_LOG(INFO, TAG, "This is a pure ACK");
OCStackFeedBack(responseInfo->info.token, responseInfo->info.tokenLength,
OC_OBSERVER_STILL_INTERESTED);
}
}
else if(responseInfo->result == CA_RETRANSMIT_TIMEOUT)
{
- OC_LOG(INFO, TAG, "Receiving Time Out for an observer");
+ OIC_LOG(INFO, TAG, "Receiving Time Out for an observer");
OCStackFeedBack(responseInfo->info.token, responseInfo->info.tokenLength,
OC_OBSERVER_FAILED_COMM);
}
if(myStackMode == OC_CLIENT || myStackMode == OC_CLIENT_SERVER
|| myStackMode == OC_GATEWAY)
{
- OC_LOG(INFO, TAG, "This is a client, but no cbNode was found for token");
+ OIC_LOG(INFO, TAG, "This is a client, but no cbNode was found for token");
if(responseInfo->result == CA_EMPTY)
{
- OC_LOG(INFO, TAG, "Receiving CA_EMPTY in the ocstack");
+ OIC_LOG(INFO, TAG, "Receiving CA_EMPTY in the ocstack");
}
else
{
- OC_LOG(INFO, TAG, "Received a message without callbacks. Sending RESET");
+ 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);
}
if(myStackMode == OC_SERVER || myStackMode == OC_CLIENT_SERVER
|| myStackMode == OC_GATEWAY)
{
- OC_LOG(INFO, TAG, "This is a server, but no observer was found for token");
+ OIC_LOG(INFO, TAG, "This is a server, but no observer was found for token");
if (responseInfo->info.type == CA_MSG_ACKNOWLEDGE)
{
- OC_LOG_V(INFO, TAG, "Received ACK at server for messageId : %d",
+ OIC_LOG_V(INFO, TAG, "Received ACK at server for messageId : %d",
responseInfo->info.messageId);
}
if (responseInfo->info.type == CA_MSG_RESET)
{
- OC_LOG_V(INFO, TAG, "Received RESET at server for messageId : %d",
+ OIC_LOG_V(INFO, TAG, "Received RESET at server for messageId : %d",
responseInfo->info.messageId);
}
}
return;
}
- OC_LOG(INFO, TAG, "Exit HandleCAResponses");
+ OIC_LOG(INFO, TAG, "Exit HandleCAResponses");
}
/*
*/
void HandleCAErrorResponse(const CAEndpoint_t *endPoint, const CAErrorInfo_t *errrorInfo)
{
- OC_LOG(INFO, TAG, "Enter HandleCAErrorResponse");
+ OIC_LOG(INFO, TAG, "Enter HandleCAErrorResponse");
if(NULL == endPoint)
{
- OC_LOG(ERROR, TAG, "endPoint is NULL");
+ OIC_LOG(ERROR, TAG, "endPoint is NULL");
return;
}
if(NULL == errrorInfo)
{
- OC_LOG(ERROR, TAG, "errrorInfo is NULL");
+ OIC_LOG(ERROR, TAG, "errrorInfo is NULL");
return;
}
- OC_LOG(INFO, TAG, "Exit HandleCAErrorResponse");
+ OIC_LOG(INFO, TAG, "Exit HandleCAErrorResponse");
}
/*
&(respInfo.info.numOptions));
if(OC_STACK_OK != result)
{
- OC_LOG_V(ERROR, TAG, "Add routing option failed [%d]", result);
+ OIC_LOG_V(ERROR, TAG, "Add routing option failed [%d]", result);
return result;
}
#endif
OICFree (respInfo.info.options);
if(CA_STATUS_OK != caResult)
{
- OC_LOG(ERROR, TAG, "CASendResponse error");
+ OIC_LOG(ERROR, TAG, "CASendResponse error");
return CAResultToOCResult(caResult);
}
return OC_STACK_OK;
//This function will be called back by CA layer when a request is received
void HandleCARequests(const CAEndpoint_t* endPoint, const CARequestInfo_t* requestInfo)
{
- OC_LOG(INFO, TAG, "Enter HandleCARequests");
+ OIC_LOG(INFO, TAG, "Enter HandleCARequests");
if(!endPoint)
{
- OC_LOG(ERROR, TAG, "endPoint is NULL");
+ OIC_LOG(ERROR, TAG, "endPoint is NULL");
return;
}
if(!requestInfo)
{
- OC_LOG(ERROR, TAG, "requestInfo is NULL");
+ OIC_LOG(ERROR, TAG, "requestInfo is NULL");
return;
}
&needRIHandling);
if(OC_STACK_OK != ret || !needRIHandling)
{
- OC_LOG_V(INFO, TAG, "Routing status![%d]. Not forwarding to RI", ret);
+ OIC_LOG_V(INFO, TAG, "Routing status![%d]. Not forwarding to RI", ret);
return;
}
#endif
OCServerProtocolRequest serverRequest = {0};
- OC_LOG_V(INFO, TAG, "Endpoint URI : %s", requestInfo->info.resourceUri);
+ OIC_LOG_V(INFO, TAG, "Endpoint URI : %s", requestInfo->info.resourceUri);
char * uriWithoutQuery = NULL;
char * query = NULL;
if (requestResult != OC_STACK_OK || !uriWithoutQuery)
{
- OC_LOG_V(ERROR, TAG, "getQueryFromUri() failed with OC error code %d\n", requestResult);
+ OIC_LOG_V(ERROR, TAG, "getQueryFromUri() failed with OC error code %d\n", requestResult);
return;
}
- OC_LOG_V(INFO, TAG, "URI without query: %s", uriWithoutQuery);
- OC_LOG_V(INFO, TAG, "Query : %s", query);
+ OIC_LOG_V(INFO, TAG, "URI without query: %s", uriWithoutQuery);
+ OIC_LOG_V(INFO, TAG, "Query : %s", query);
if(strlen(uriWithoutQuery) < MAX_URI_LENGTH)
{
}
else
{
- OC_LOG(ERROR, TAG, "URI length exceeds MAX_URI_LENGTH.");
+ OIC_LOG(ERROR, TAG, "URI length exceeds MAX_URI_LENGTH.");
OICFree(uriWithoutQuery);
OICFree(query);
return;
}
else
{
- OC_LOG(ERROR, TAG, "Query length exceeds MAX_QUERY_LENGTH.");
+ OIC_LOG(ERROR, TAG, "Query length exceeds MAX_QUERY_LENGTH.");
OICFree(query);
return;
}
serverRequest.method = OC_REST_DELETE;
break;
default:
- OC_LOG_V(ERROR, TAG, "Received CA method %d not supported", requestInfo->method);
+ OIC_LOG_V(ERROR, TAG, "Received CA method %d not supported", requestInfo->method);
SendDirectStackResponse(endPoint, requestInfo->info.messageId, CA_BAD_REQ,
requestInfo->info.type, requestInfo->info.numOptions,
requestInfo->info.options, requestInfo->info.token,
return;
}
- OC_LOG_BUFFER(INFO, TAG, (const uint8_t *)requestInfo->info.token,
+ OIC_LOG_BUFFER(INFO, TAG, (const uint8_t *)requestInfo->info.token,
requestInfo->info.tokenLength);
serverRequest.tokenLength = requestInfo->info.tokenLength;
if (!serverRequest.requestToken)
{
- OC_LOG(FATAL, TAG, "Allocation for token failed.");
+ OIC_LOG(FATAL, TAG, "Allocation for token failed.");
SendDirectStackResponse(endPoint, requestInfo->info.messageId, CA_INTERNAL_SERVER_ERROR,
requestInfo->info.type, requestInfo->info.numOptions,
requestInfo->info.options, requestInfo->info.token,
GetObserveHeaderOption(&serverRequest.observationOption, requestInfo->info.options, &tempNum);
if (requestInfo->info.numOptions > MAX_HEADER_OPTIONS)
{
- OC_LOG(ERROR, TAG,
+ OIC_LOG(ERROR, TAG,
"The request info numOptions is greater than MAX_HEADER_OPTIONS");
SendDirectStackResponse(endPoint, requestInfo->info.messageId, CA_BAD_OPT,
requestInfo->info.type, requestInfo->info.numOptions,
}
else if(requestResult != OC_STACK_OK)
{
- OC_LOG_V(ERROR, TAG, "HandleStackRequests failed. error: %d", requestResult);
+ OIC_LOG_V(ERROR, TAG, "HandleStackRequests failed. error: %d", requestResult);
CAResponseResult_t stackResponse =
OCToCAStackResult(requestResult, serverRequest.method);
// The token is copied in there, and is thus still owned by this function.
OICFree(serverRequest.payload);
OICFree(serverRequest.requestToken);
- OC_LOG(INFO, TAG, "Exit HandleCARequests");
+ OIC_LOG(INFO, TAG, "Exit HandleCARequests");
}
OCStackResult HandleStackRequests(OCServerProtocolRequest * protocolRequest)
{
- OC_LOG(INFO, TAG, "Entering HandleStackRequests (OCStack Layer)");
+ OIC_LOG(INFO, TAG, "Entering HandleStackRequests (OCStack Layer)");
OCStackResult result = OC_STACK_ERROR;
ResourceHandling resHandling;
OCResource *resource;
if(!protocolRequest)
{
- OC_LOG(ERROR, TAG, "protocolRequest is NULL");
+ OIC_LOG(ERROR, TAG, "protocolRequest is NULL");
return OC_STACK_INVALID_PARAM;
}
protocolRequest->tokenLength);
if(!request)
{
- OC_LOG(INFO, TAG, "This is a new Server Request");
+ OIC_LOG(INFO, TAG, "This is a new Server Request");
result = AddServerRequest(&request, protocolRequest->coapID,
protocolRequest->delayedResNeeded, 0, protocolRequest->method,
protocolRequest->numRcvdVendorSpecificHeaderOptions,
&protocolRequest->devAddr);
if (OC_STACK_OK != result)
{
- OC_LOG(ERROR, TAG, "Error adding server request");
+ OIC_LOG(ERROR, TAG, "Error adding server request");
return result;
}
if(!request)
{
- OC_LOG(ERROR, TAG, "Out of Memory");
+ OIC_LOG(ERROR, TAG, "Out of Memory");
return OC_STACK_NO_MEMORY;
}
}
else
{
- OC_LOG(INFO, TAG, "This is either a repeated or blocked Server Request");
+ OIC_LOG(INFO, TAG, "This is either a repeated or blocked Server Request");
}
if(request->requestComplete)
{
- OC_LOG(INFO, TAG, "This Server Request is complete");
+ OIC_LOG(INFO, TAG, "This Server Request is complete");
result = DetermineResourceHandling (request, &resHandling, &resource);
if (result == OC_STACK_OK)
{
}
else
{
- OC_LOG(INFO, TAG, "This Server Request is incomplete");
+ OIC_LOG(INFO, TAG, "This Server Request is incomplete");
result = OC_STACK_CONTINUE;
}
return result;
if (!info.platformID)
{
- OC_LOG(ERROR, TAG, "No platform ID found.");
+ OIC_LOG(ERROR, TAG, "No platform ID found.");
return false;
}
if(lenManufacturerName == 0 || lenManufacturerName > MAX_MANUFACTURER_NAME_LENGTH)
{
- OC_LOG(ERROR, TAG, "Manufacturer name fails length requirements.");
+ OIC_LOG(ERROR, TAG, "Manufacturer name fails length requirements.");
return false;
}
}
else
{
- OC_LOG(ERROR, TAG, "No manufacturer name present");
+ OIC_LOG(ERROR, TAG, "No manufacturer name present");
return false;
}
{
if(strlen(info.manufacturerUrl) > MAX_MANUFACTURER_URL_LENGTH)
{
- OC_LOG(ERROR, TAG, "Manufacturer url fails length requirements.");
+ OIC_LOG(ERROR, TAG, "Manufacturer url fails length requirements.");
return false;
}
}
{
if(stackState == OC_STACK_INITIALIZED)
{
- OC_LOG(INFO, TAG, "Subsequent calls to OCInit() without calling \
+ OIC_LOG(INFO, TAG, "Subsequent calls to OCInit() without calling \
OCStop() between them are ignored.");
return OC_STACK_OK;
}
#ifndef ROUTING_GATEWAY
if (OC_GATEWAY == mode)
{
- OC_LOG(ERROR, TAG, "Routing Manager not supported");
+ OIC_LOG(ERROR, TAG, "Routing Manager not supported");
return OC_STACK_INVALID_PARAM;
}
#endif
#ifdef RA_ADAPTER
if(!gRASetInfo)
{
- OC_LOG(ERROR, TAG, "Need to call OCSetRAInfo before calling OCInit");
+ OIC_LOG(ERROR, TAG, "Need to call OCSetRAInfo before calling OCInit");
return OC_STACK_ERROR;
}
#endif
OCStackResult result = OC_STACK_ERROR;
- OC_LOG(INFO, TAG, "Entering OCInit");
+ OIC_LOG(INFO, TAG, "Entering OCInit");
// Validate mode
if (!((mode == OC_CLIENT) || (mode == OC_SERVER) || (mode == OC_CLIENT_SERVER)
|| (mode == OC_GATEWAY)))
{
- OC_LOG(ERROR, TAG, "Invalid mode");
+ OIC_LOG(ERROR, TAG, "Invalid mode");
return OC_STACK_ERROR;
}
myStackMode = mode;
case OC_CLIENT:
CARegisterHandler(HandleCARequests, HandleCAResponses, HandleCAErrorResponse);
result = CAResultToOCResult(CAStartDiscoveryServer());
- OC_LOG(INFO, TAG, "Client mode: CAStartDiscoveryServer");
+ OIC_LOG(INFO, TAG, "Client mode: CAStartDiscoveryServer");
break;
case OC_SERVER:
SRMRegisterHandler(HandleCARequests, HandleCAResponses, HandleCAErrorResponse);
result = CAResultToOCResult(CAStartListeningServer());
- OC_LOG(INFO, TAG, "Server mode: CAStartListeningServer");
+ OIC_LOG(INFO, TAG, "Server mode: CAStartListeningServer");
break;
case OC_CLIENT_SERVER:
case OC_GATEWAY:
exit:
if(result != OC_STACK_OK)
{
- OC_LOG(ERROR, TAG, "Stack initialization error");
+ OIC_LOG(ERROR, TAG, "Stack initialization error");
deleteAllResources();
CATerminate();
stackState = OC_STACK_UNINITIALIZED;
OCStackResult OCStop()
{
- OC_LOG(INFO, TAG, "Entering OCStop");
+ OIC_LOG(INFO, TAG, "Entering OCStop");
if (stackState == OC_STACK_UNINIT_IN_PROGRESS)
{
- OC_LOG(DEBUG, TAG, "Stack already stopping, exiting");
+ OIC_LOG(DEBUG, TAG, "Stack already stopping, exiting");
return OC_STACK_OK;
}
else if (stackState != OC_STACK_INITIALIZED)
{
- OC_LOG(ERROR, TAG, "Stack not initialized");
+ OIC_LOG(ERROR, TAG, "Stack not initialized");
return OC_STACK_ERROR;
}
{
if(stackState != OC_STACK_INITIALIZED)
{
- OC_LOG(ERROR, TAG, "OCStack is not initalized. Cannot start multicast server.");
+ OIC_LOG(ERROR, TAG, "OCStack is not initalized. Cannot start multicast server.");
return OC_STACK_ERROR;
}
CAResult_t ret = CAStartListeningServer();
if (CA_STATUS_OK != ret)
{
- OC_LOG_V(ERROR, TAG, "Failed starting listening server: %d", ret);
+ OIC_LOG_V(ERROR, TAG, "Failed starting listening server: %d", ret);
return OC_STACK_ERROR;
}
return OC_STACK_OK;
CAResult_t ret = CAStopListeningServer();
if (CA_STATUS_OK != ret)
{
- OC_LOG_V(ERROR, TAG, "Failed stopping listening server: %d", ret);
+ OIC_LOG_V(ERROR, TAG, "Failed stopping listening server: %d", ret);
return OC_STACK_ERROR;
}
return OC_STACK_OK;
OCHeaderOption *options,
uint8_t numOptions)
{
- OC_LOG(INFO, TAG, "Entering OCDoResource");
+ OIC_LOG(INFO, TAG, "Entering OCDoResource");
// Validate input parameters
VERIFY_NON_NULL(cbData, FATAL, OC_STACK_INVALID_CALLBACK);
if (result != OC_STACK_OK)
{
- OC_LOG_V(DEBUG, TAG, "Unable to parse uri: %s", requestUri);
+ OIC_LOG_V(DEBUG, TAG, "Unable to parse uri: %s", requestUri);
goto exit;
}
if (!devAddr && !destination)
{
- OC_LOG(DEBUG, TAG, "no devAddr and no destination");
+ OIC_LOG(DEBUG, TAG, "no devAddr and no destination");
result = OC_STACK_INVALID_PARAM;
goto exit;
}
caResult = CAGenerateToken(&token, tokenLength);
if (caResult != CA_STATUS_OK)
{
- OC_LOG(ERROR, TAG, "CAGenerateToken error");
+ OIC_LOG(ERROR, TAG, "CAGenerateToken error");
result= OC_STACK_ERROR;
goto exit;
}
OCConvertPayload(payload, &requestInfo.info.payload, &requestInfo.info.payloadSize))
!= OC_STACK_OK)
{
- OC_LOG(ERROR, TAG, "Failed to create CBOR Payload");
+ OIC_LOG(ERROR, TAG, "Failed to create CBOR Payload");
goto exit;
}
requestInfo.info.payloadFormat = CA_FORMAT_APPLICATION_CBOR;
if (result != OC_STACK_OK)
{
- OC_LOG(ERROR, TAG, "CACreateEndpoint error");
+ OIC_LOG(ERROR, TAG, "CACreateEndpoint error");
goto exit;
}
exit:
if (result != OC_STACK_OK)
{
- OC_LOG(ERROR, TAG, "OCDoResource error");
+ OIC_LOG(ERROR, TAG, "OCDoResource error");
FindAndDeleteClientCB(clientCB);
CADestroyToken(token);
if (handle)
ClientCB *clientCB = GetClientCB(NULL, 0, handle, NULL);
if (!clientCB)
{
- OC_LOG(ERROR, TAG, "Callback not found. Called OCCancel on same resource twice?");
+ OIC_LOG(ERROR, TAG, "Callback not found. Called OCCancel on same resource twice?");
return OC_STACK_ERROR;
}
case OC_REST_OBSERVE:
case OC_REST_OBSERVE_ALL:
- OC_LOG_V(INFO, TAG, "Canceling observation for resource %s",
+ OIC_LOG_V(INFO, TAG, "Canceling observation for resource %s",
clientCB->requestUri);
if (qos != OC_HIGH_QOS)
{
break;
}
- OC_LOG(INFO, TAG, "Cancelling observation as CONFIRMABLE");
+ OIC_LOG(INFO, TAG, "Cancelling observation as CONFIRMABLE");
requestInfo.info.type = qualityOfServiceToMessageType(qos);
requestInfo.info.token = clientCB->token;
break;
case OC_REST_DISCOVER:
- OC_LOG_V(INFO, TAG, "Cancelling discovery callback for resource %s",
+ OIC_LOG_V(INFO, TAG, "Cancelling discovery callback for resource %s",
clientCB->requestUri);
FindAndDeleteClientCB(clientCB);
break;
*/
OCStackResult OCRegisterPersistentStorageHandler(OCPersistentStorage* persistentStorageHandler)
{
- OC_LOG(INFO, TAG, "RegisterPersistentStorageHandler !!");
+ OIC_LOG(INFO, TAG, "RegisterPersistentStorageHandler !!");
if(!persistentStorageHandler)
{
- OC_LOG(ERROR, TAG, "The persistent storage handler is invalid");
+ OIC_LOG(ERROR, TAG, "The persistent storage handler is invalid");
return OC_STACK_INVALID_PARAM;
}
else
!persistentStorageHandler->unlink ||
!persistentStorageHandler->write)
{
- OC_LOG(ERROR, TAG, "The persistent storage handler is invalid");
+ OIC_LOG(ERROR, TAG, "The persistent storage handler is invalid");
return OC_STACK_INVALID_PARAM;
}
}
// the following line floods the log with messages that are irrelevant
// to most purposes. Uncomment as needed.
- //OC_LOG(INFO, TAG, "Entering RequestPresence");
+ //OIC_LOG(INFO, TAG, "Entering RequestPresence");
ClientCB* cbNode = NULL;
OCClientResponse clientResponse;
OCStackApplicationResult cbResult = OC_STACK_DELETE_TRANSACTION;
}
uint32_t now = GetTicks(0);
- OC_LOG_V(DEBUG, TAG, "this TTL level %d",
+ OIC_LOG_V(DEBUG, TAG, "this TTL level %d",
cbNode->presence->TTLlevel);
- OC_LOG_V(DEBUG, TAG, "current ticks %d", now);
+ OIC_LOG_V(DEBUG, TAG, "current ticks %d", now);
if (cbNode->presence->TTLlevel > PresenceTimeOutSize)
{
if (cbNode->presence->TTLlevel < PresenceTimeOutSize)
{
- OC_LOG_V(DEBUG, TAG, "timeout ticks %d",
+ OIC_LOG_V(DEBUG, TAG, "timeout ticks %d",
cbNode->presence->timeOut[cbNode->presence->TTLlevel]);
}
if (cbNode->presence->TTLlevel >= PresenceTimeOutSize)
{
- OC_LOG(DEBUG, TAG, "No more timeout ticks");
+ OIC_LOG(DEBUG, TAG, "No more timeout ticks");
clientResponse.sequenceNumber = 0;
clientResponse.result = OC_STACK_PRESENCE_TIMEOUT;
// Increment the TTLLevel (going to a next state), so we don't keep
// sending presence notification to client.
cbNode->presence->TTLlevel++;
- OC_LOG_V(DEBUG, TAG, "moving to TTL level %d",
+ OIC_LOG_V(DEBUG, TAG, "moving to TTL level %d",
cbNode->presence->TTLlevel);
cbResult = cbNode->callBack(cbNode->context, cbNode->handle, &clientResponse);
CAInfo_t requestData = {.type = CA_MSG_CONFIRM};
CARequestInfo_t requestInfo = {.method = CA_GET};
- OC_LOG(DEBUG, TAG, "time to test server presence");
+ OIC_LOG(DEBUG, TAG, "time to test server presence");
CopyDevAddrToEndpoint(cbNode->devAddr, &endpoint);
}
cbNode->presence->TTLlevel++;
- OC_LOG_V(DEBUG, TAG, "moving to TTL level %d", cbNode->presence->TTLlevel);
+ OIC_LOG_V(DEBUG, TAG, "moving to TTL level %d", cbNode->presence->TTLlevel);
}
exit:
if (result != OC_STACK_OK)
{
- OC_LOG(ERROR, TAG, "OCProcessPresence error");
+ OIC_LOG(ERROR, TAG, "OCProcessPresence error");
}
return result;
if (OC_MAX_PRESENCE_TTL_SECONDS < ttl)
{
presenceResource.presenceTTL = OC_MAX_PRESENCE_TTL_SECONDS;
- OC_LOG(INFO, TAG, "Setting Presence TTL to max value");
+ OIC_LOG(INFO, TAG, "Setting Presence TTL to max value");
}
else if (0 == ttl)
{
presenceResource.presenceTTL = OC_DEFAULT_PRESENCE_TTL_SECONDS;
- OC_LOG(INFO, TAG, "Setting Presence TTL to default value");
+ OIC_LOG(INFO, TAG, "Setting Presence TTL to default value");
}
else
{
presenceResource.presenceTTL = ttl;
}
- OC_LOG_V(DEBUG, TAG, "Presence TTL is %" PRIu32 " seconds", presenceResource.presenceTTL);
+ OIC_LOG_V(DEBUG, TAG, "Presence TTL is %" PRIu32 " seconds", presenceResource.presenceTTL);
if (OC_PRESENCE_UNINITIALIZED == presenceState)
{
CAResult_t caResult = CAGenerateToken(&caToken, tokenLength);
if (caResult != CA_STATUS_OK)
{
- OC_LOG(ERROR, TAG, "CAGenerateToken error");
+ OIC_LOG(ERROR, TAG, "CAGenerateToken error");
CADestroyToken(caToken);
return OC_STACK_ERROR;
}
if(result != OC_STACK_OK)
{
- OC_LOG(ERROR, TAG,
+ OIC_LOG(ERROR, TAG,
"Changing the presence resource properties to ACTIVE not successful");
return result;
}
OCStackResult OCSetPlatformInfo(OCPlatformInfo platformInfo)
{
- OC_LOG(INFO, TAG, "Entering OCSetPlatformInfo");
+ OIC_LOG(INFO, TAG, "Entering OCSetPlatformInfo");
if(myStackMode == OC_SERVER || myStackMode == OC_CLIENT_SERVER || myStackMode == OC_GATEWAY)
{
OCStackResult OCSetDeviceInfo(OCDeviceInfo deviceInfo)
{
- OC_LOG(INFO, TAG, "Entering OCSetDeviceInfo");
+ OIC_LOG(INFO, TAG, "Entering OCSetDeviceInfo");
if (!deviceInfo.deviceName || deviceInfo.deviceName[0] == '\0')
{
- OC_LOG(ERROR, TAG, "Null or empty device name.");
+ OIC_LOG(ERROR, TAG, "Null or empty device name.");
return OC_STACK_INVALID_PARAM;
}
OCResource *pointer = NULL;
OCStackResult result = OC_STACK_ERROR;
- OC_LOG(INFO, TAG, "Entering OCCreateResource");
+ OIC_LOG(INFO, TAG, "Entering OCCreateResource");
if(myStackMode == OC_CLIENT)
{
// Validate parameters
if(!uri || uri[0]=='\0' || strlen(uri)>=MAX_URI_LENGTH )
{
- OC_LOG(ERROR, TAG, "URI is empty or too long");
+ OIC_LOG(ERROR, TAG, "URI is empty or too long");
return OC_STACK_INVALID_URI;
}
// Is it presented during resource discovery?
if (!handle || !resourceTypeName || resourceTypeName[0] == '\0' )
{
- OC_LOG(ERROR, TAG, "Input parameter is NULL");
+ OIC_LOG(ERROR, TAG, "Input parameter is NULL");
return OC_STACK_INVALID_PARAM;
}
> (OC_ACTIVE | OC_DISCOVERABLE | OC_OBSERVABLE | OC_SLOW | OC_SECURE |
OC_EXPLICIT_DISCOVERABLE))
{
- OC_LOG(ERROR, TAG, "Invalid property");
+ OIC_LOG(ERROR, TAG, "Invalid property");
return OC_STACK_INVALID_PARAM;
}
{
if (strncmp(uri, pointer->uri, MAX_URI_LENGTH) == 0)
{
- OC_LOG_V(ERROR, TAG, "Resource %s already exists", uri);
+ OIC_LOG_V(ERROR, TAG, "Resource %s already exists", uri);
return OC_STACK_INVALID_PARAM;
}
pointer = pointer->next;
result = BindResourceTypeToResource(pointer, resourceTypeName);
if (result != OC_STACK_OK)
{
- OC_LOG(ERROR, TAG, "Error adding resourcetype");
+ OIC_LOG(ERROR, TAG, "Error adding resourcetype");
goto exit;
}
result = BindResourceInterfaceToResource(pointer, resourceInterfaceName);
if (result != OC_STACK_OK)
{
- OC_LOG(ERROR, TAG, "Error adding resourceinterface");
+ OIC_LOG(ERROR, TAG, "Error adding resourceinterface");
goto exit;
}
OCResource *resource = NULL;
uint8_t i = 0;
- OC_LOG(INFO, TAG, "Entering OCBindResource");
+ OIC_LOG(INFO, TAG, "Entering OCBindResource");
// Validate parameters
VERIFY_NON_NULL(collectionHandle, ERROR, OC_STACK_ERROR);
// Container cannot contain itself
if (collectionHandle == resourceHandle)
{
- OC_LOG(ERROR, TAG, "Added handle equals collection handle");
+ OIC_LOG(ERROR, TAG, "Added handle equals collection handle");
return OC_STACK_INVALID_PARAM;
}
resource = findResource((OCResource *) collectionHandle);
if (!resource)
{
- OC_LOG(ERROR, TAG, "Collection handle not found");
+ OIC_LOG(ERROR, TAG, "Collection handle not found");
return OC_STACK_INVALID_PARAM;
}
if (!resource->rsrcResources[i])
{
resource->rsrcResources[i] = (OCResource *) resourceHandle;
- OC_LOG(INFO, TAG, "resource bound");
+ OIC_LOG(INFO, TAG, "resource bound");
#ifdef WITH_PRESENCE
if (presenceResource.handle)
OCResource *resource = NULL;
uint8_t i = 0;
- OC_LOG(INFO, TAG, "Entering OCUnBindResource");
+ OIC_LOG(INFO, TAG, "Entering OCUnBindResource");
// Validate parameters
VERIFY_NON_NULL(collectionHandle, ERROR, OC_STACK_ERROR);
// Container cannot contain itself
if (collectionHandle == resourceHandle)
{
- OC_LOG(ERROR, TAG, "removing handle equals collection handle");
+ OIC_LOG(ERROR, TAG, "removing handle equals collection handle");
return OC_STACK_INVALID_PARAM;
}
resource = findResource((OCResource *) collectionHandle);
if (!resource)
{
- OC_LOG(ERROR, TAG, "Collection handle not found");
+ OIC_LOG(ERROR, TAG, "Collection handle not found");
return OC_STACK_INVALID_PARAM;
}
if (resourceHandle == resource->rsrcResources[i])
{
resource->rsrcResources[i] = (OCResource *) NULL;
- OC_LOG(INFO, TAG, "resource unbound");
+ OIC_LOG(INFO, TAG, "resource unbound");
// Send notification when resource is unbounded successfully.
#ifdef WITH_PRESENCE
}
}
- OC_LOG(INFO, TAG, "resource not found in collection");
+ OIC_LOG(INFO, TAG, "resource not found in collection");
// Unable to add resourceHandle, so return error
return OC_STACK_ERROR;
if (!ValidateResourceTypeInterface(resourceTypeName))
{
- OC_LOG(ERROR, TAG, "resource type illegal (see RFC 6690)");
+ OIC_LOG(ERROR, TAG, "resource type illegal (see RFC 6690)");
return OC_STACK_INVALID_PARAM;
}
if (!ValidateResourceTypeInterface(resourceInterfaceName))
{
- OC_LOG(ERROR, TAG, "resource /interface illegal (see RFC 6690)");
+ OIC_LOG(ERROR, TAG, "resource /interface illegal (see RFC 6690)");
return OC_STACK_INVALID_PARAM;
}
- OC_LOG_V(INFO, TAG, "Binding %s interface to %s", resourceInterfaceName, resource->uri);
+ OIC_LOG_V(INFO, TAG, "Binding %s interface to %s", resourceInterfaceName, resource->uri);
pointer = (OCResourceInterface *) OICCalloc(1, sizeof(OCResourceInterface));
if (!pointer)
resource = findResource((OCResource *) handle);
if (!resource)
{
- OC_LOG(ERROR, TAG, "Resource not found");
+ OIC_LOG(ERROR, TAG, "Resource not found");
return OC_STACK_ERROR;
}
resource = findResource((OCResource *) handle);
if (!resource)
{
- OC_LOG(ERROR, TAG, "Resource not found");
+ OIC_LOG(ERROR, TAG, "Resource not found");
return OC_STACK_ERROR;
}
{
if (!handle)
{
- OC_LOG(ERROR, TAG, "Invalid handle for deletion");
+ OIC_LOG(ERROR, TAG, "Invalid handle for deletion");
return OC_STACK_INVALID_PARAM;
}
OCResource *resource = findResource((OCResource *) handle);
if (resource == NULL)
{
- OC_LOG(ERROR, TAG, "Resource not found");
+ OIC_LOG(ERROR, TAG, "Resource not found");
return OC_STACK_NO_RESOURCE;
}
if (deleteResource((OCResource *) handle) != OC_STACK_OK)
{
- OC_LOG(ERROR, TAG, "Error deleting resource");
+ OIC_LOG(ERROR, TAG, "Error deleting resource");
return OC_STACK_ERROR;
}
resource = findResource((OCResource *)handle);
if (!resource)
{
- OC_LOG(ERROR, TAG, "Resource not found");
+ OIC_LOG(ERROR, TAG, "Resource not found");
return OC_STACK_ERROR;
}
resource = findResource((OCResource *)handle);
if (!resource)
{
- OC_LOG(ERROR, TAG, "Resource not found");
+ OIC_LOG(ERROR, TAG, "Resource not found");
return NULL;
}
OCMethod method = OC_REST_NOMETHOD;
uint32_t maxAge = 0;
- OC_LOG(INFO, TAG, "Notifying all observers");
+ OIC_LOG(INFO, TAG, "Notifying all observers");
#ifdef WITH_PRESENCE
if(handle == presenceResource.handle)
{
const OCRepPayload *payload,
OCQualityOfService qos)
{
- OC_LOG(INFO, TAG, "Entering OCNotifyListOfObservers");
+ OIC_LOG(INFO, TAG, "Entering OCNotifyListOfObservers");
OCResource *resPtr = NULL;
//TODO: we should allow the server to define this
OCStackResult result = OC_STACK_ERROR;
OCServerRequest *serverRequest = NULL;
- OC_LOG(INFO, TAG, "Entering OCDoResponse");
+ OIC_LOG(INFO, TAG, "Entering OCDoResponse");
// Validate input parameters
VERIFY_NON_NULL(ehResponse, ERROR, OC_STACK_INVALID_PARAM);
if (resourceProperties
> (OC_ACTIVE | OC_DISCOVERABLE | OC_OBSERVABLE | OC_SLOW))
{
- OC_LOG(ERROR, TAG, "Invalid property");
+ OIC_LOG(ERROR, TAG, "Invalid property");
return OC_STACK_INVALID_PARAM;
}
if(!enable)
OCResource *temp = NULL;
if(!resource)
{
- OC_LOG(DEBUG,TAG,"resource is NULL");
+ OIC_LOG(DEBUG,TAG,"resource is NULL");
return OC_STACK_INVALID_PARAM;
}
- OC_LOG_V (INFO, TAG, "Deleting resource %s", resource->uri);
+ OIC_LOG_V (INFO, TAG, "Deleting resource %s", resource->uri);
temp = headResource;
while (temp)
{
if (!strcmp(resourceType->resourcetypename, pointer->resourcetypename))
{
- OC_LOG_V(INFO, TAG, "Type %s already exists", resourceType->resourcetypename);
+ OIC_LOG_V(INFO, TAG, "Type %s already exists", resourceType->resourcetypename);
OICFree(resourceType->resourcetypename);
OICFree(resourceType);
return;
}
resourceType->next = NULL;
- OC_LOG_V(INFO, TAG, "Added type %s to %s", resourceType->resourcetypename, resource->uri);
+ OIC_LOG_V(INFO, TAG, "Added type %s to %s", resourceType->resourcetypename, resource->uri);
}
OCResourceType *findResourceTypeAtIndex(OCResourceHandle handle, uint8_t index)
if (GetDoxmDeviceID(&sid) != OC_STACK_OK)
{
- OC_LOG(FATAL, TAG, "Generate UUID for Server Instance failed!");
+ OIC_LOG(FATAL, TAG, "Generate UUID for Server Instance failed!");
return NULL;
}
generated = true;
if(OCConvertUuidToString(sid->id, sidStr) != RAND_UUID_OK)
{
- OC_LOG(FATAL, TAG, "Generate UUID String for Server Instance failed!");
+ OIC_LOG(FATAL, TAG, "Generate UUID String for Server Instance failed!");
return NULL;
}