replaced OC_LOG with OIC_LOG in stack
authorjihwan.seo <jihwan.seo@samsung.com>
Wed, 23 Dec 2015 01:22:48 +0000 (10:22 +0900)
committerJon A. Cruz <jonc@osg.samsung.com>
Mon, 1 Feb 2016 23:11:51 +0000 (23:11 +0000)
Change-Id: Ice2639c3bc09e9a7fe2452ab9fbb1593b07bdb9c
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/4707
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jaehong Jo <jaehong.jo@samsung.com>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
38 files changed:
resource/csdk/routing/src/routingmanager.c
resource/csdk/routing/src/routingmanagerinterface.c
resource/csdk/routing/src/routingmessageparser.c
resource/csdk/routing/src/routingtablemanager.c
resource/csdk/routing/src/routingutility.c
resource/csdk/stack/include/payload_logging.h
resource/csdk/stack/samples/arduino/SimpleClientServer/ocserver/ocserver.cpp
resource/csdk/stack/samples/linux/SimpleClientServer/occlient.cpp
resource/csdk/stack/samples/linux/SimpleClientServer/occlientbasicops.cpp
resource/csdk/stack/samples/linux/SimpleClientServer/occlientcoll.cpp
resource/csdk/stack/samples/linux/SimpleClientServer/occlientslow.cpp
resource/csdk/stack/samples/linux/SimpleClientServer/ocremoteaccessclient.cpp
resource/csdk/stack/samples/linux/SimpleClientServer/ocrouting.cpp
resource/csdk/stack/samples/linux/SimpleClientServer/ocserver.cpp
resource/csdk/stack/samples/linux/SimpleClientServer/ocserverbasicops.cpp
resource/csdk/stack/samples/linux/SimpleClientServer/ocservercoll.cpp
resource/csdk/stack/samples/linux/SimpleClientServer/ocserverslow.cpp
resource/csdk/stack/samples/linux/secure/ocamsservice.cpp
resource/csdk/stack/samples/linux/secure/occlientbasicops.cpp
resource/csdk/stack/samples/linux/secure/ocserverbasicops.cpp
resource/csdk/stack/samples/tizen/SimpleClientServer/occlient.cpp
resource/csdk/stack/src/occlientcb.c
resource/csdk/stack/src/occollection.c
resource/csdk/stack/src/ocobserve.c
resource/csdk/stack/src/ocpayload.c
resource/csdk/stack/src/ocpayloadconvert.c
resource/csdk/stack/src/ocpayloadparse.c
resource/csdk/stack/src/ocresource.c
resource/csdk/stack/src/ocserverrequest.c
resource/csdk/stack/src/ocstack.c
resource/csdk/stack/src/oicgroup.c
resource/csdk/stack/src/rdpayload.c
resource/csdk/stack/test/android/stacktests.cpp
resource/csdk/stack/test/arduino/ArduinoStackTest.cpp
resource/csdk/stack/test/arduino/ocserver.cpp
resource/csdk/stack/test/linux/occlient.c
resource/csdk/stack/test/linux/ocserver.c
resource/csdk/stack/test/stacktests.cpp

index 9c12c12..bf82153 100644 (file)
@@ -143,16 +143,16 @@ void RMSendDeleteToNeighbourNodes();
 
 void RMGenerateGatewayID(uint8_t *id, size_t idLen)
 {
-    OC_LOG(DEBUG, TAG, "RMGenerateGatewayID IN");
+    OIC_LOG(DEBUG, TAG, "RMGenerateGatewayID IN");
     OCFillRandomMem(id, idLen);
-    OC_LOG(DEBUG, TAG, "RMGenerateGatewayID OUT");
+    OIC_LOG(DEBUG, TAG, "RMGenerateGatewayID OUT");
 }
 OCStackResult RMInitialize()
 {
-    OC_LOG(DEBUG, TAG, "RMInitialize IN");
+    OIC_LOG(DEBUG, TAG, "RMInitialize IN");
     if (g_isRMInitialized)
     {
-        OC_LOG(DEBUG, TAG, "RM already initialized");
+        OIC_LOG(DEBUG, TAG, "RM already initialized");
         return OC_STACK_OK;
     }
 
@@ -160,20 +160,20 @@ OCStackResult RMInitialize()
     OCStackResult result = RMInitGatewayResource();
     if (OC_STACK_OK != result)
     {
-        OC_LOG_V(ERROR, TAG, "RMInitGatewayResource failed[%d]", result);
+        OIC_LOG_V(ERROR, TAG, "RMInitGatewayResource failed[%d]", result);
         return result;
     }
 
     // Generates a 4 byte Gateway ID.
     RMGenerateGatewayID((uint8_t *)&g_GatewayID, sizeof(g_GatewayID));
 
-    OC_LOG_V(INFO, RM_TAG, "Gateway ID: %u", g_GatewayID);
+    OIC_LOG_V(INFO, RM_TAG, "Gateway ID: %u", g_GatewayID);
 
     // Initialize the Routing table manager.
     result = RTMInitialize(&g_routingGatewayTable, &g_routingEndpointTable);
     if (OC_STACK_OK != result)
     {
-        OC_LOG_V(ERROR, TAG, "RTMInitialize failed[%d]", result);
+        OIC_LOG_V(ERROR, TAG, "RTMInitialize failed[%d]", result);
         return result;
     }
 
@@ -183,7 +183,7 @@ OCStackResult RMInitialize()
     result = RMDiscoverGatewayResource();
     if (OC_STACK_OK != result)
     {
-        OC_LOG_V(ERROR, TAG, "RMDiscoverGatewayResource failed[%d]", result);
+        OIC_LOG_V(ERROR, TAG, "RMDiscoverGatewayResource failed[%d]", result);
         RTMTerminate(&g_routingGatewayTable, &g_routingEndpointTable);
         return result;
     }
@@ -192,16 +192,16 @@ OCStackResult RMInitialize()
     g_aliveTime = RTMGetCurrentTime();
     g_refreshTableTime = g_aliveTime;
 
-    OC_LOG(DEBUG, TAG, "RMInitialize OUT");
+    OIC_LOG(DEBUG, TAG, "RMInitialize OUT");
     return result;
 }
 
 OCStackResult RMTerminate()
 {
-    OC_LOG(DEBUG, TAG, "RMTerminate IN");
+    OIC_LOG(DEBUG, TAG, "RMTerminate IN");
     if (!g_isRMInitialized)
     {
-        OC_LOG(ERROR, TAG, "RM not initialized");
+        OIC_LOG(ERROR, TAG, "RM not initialized");
         return OC_STACK_ERROR;
     }
     // Send DELETE request to neighbour nodes
@@ -210,96 +210,96 @@ OCStackResult RMTerminate()
     OCStackResult result = RTMTerminate(&g_routingGatewayTable, &g_routingEndpointTable);
     if (OC_STACK_OK != result)
     {
-        OC_LOG_V(ERROR, TAG, "CARegisterRoutingMessageHandler failed[%d]", result);
+        OIC_LOG_V(ERROR, TAG, "CARegisterRoutingMessageHandler failed[%d]", result);
         return result;
     }
     g_isRMInitialized = false;
-    OC_LOG(DEBUG, TAG, "RMTerminate OUT");
+    OIC_LOG(DEBUG, TAG, "RMTerminate OUT");
     return result;
 }
 
 OCStackResult RMHandleGatewayRequest(OCServerRequest *request, const OCResource *resource)
 {
-    OC_LOG(DEBUG, TAG, "RMHandleGatewayRequest IN");
+    OIC_LOG(DEBUG, TAG, "RMHandleGatewayRequest IN");
 
     if (!g_isRMInitialized)
     {
-        OC_LOG(ERROR, TAG, "RM not initialized");
+        OIC_LOG(ERROR, TAG, "RM not initialized");
         return OC_STACK_ERROR;
     }
 
     RM_NULL_CHECK_WITH_RET(request, TAG, "request");
     RM_NULL_CHECK_WITH_RET(resource, TAG, "resource");
 
-    OC_LOG_V(DEBUG, TAG, "Received request of method: %d", request->method);
+    OIC_LOG_V(DEBUG, TAG, "Received request of method: %d", request->method);
 
     if (OC_REST_GET == request->method)
     {
         switch((OCObserveAction)request->observationOption)
         {
             case OC_OBSERVE_REGISTER:
-                OC_LOG(DEBUG, TAG, "Received OBSERVE request");
+                OIC_LOG(DEBUG, TAG, "Received OBSERVE request");
                 RMHandleOBSERVERequest(request, resource);
                 break;
             case OC_OBSERVE_DEREGISTER:
                 //TODO: Handle this case
-                OC_LOG(DEBUG, TAG, "Received OBSERVE deregister");
+                OIC_LOG(DEBUG, TAG, "Received OBSERVE deregister");
                 break;
             case OC_OBSERVE_NO_OPTION:
-                OC_LOG(DEBUG, TAG, "Received GET request");
+                OIC_LOG(DEBUG, TAG, "Received GET request");
                 RMHandleGETRequest(request, resource);
                 break;
             default:
-                OC_LOG(DEBUG, TAG, "Not Supported by Routing Manager");
+                OIC_LOG(DEBUG, TAG, "Not Supported by Routing Manager");
         }
     }
     else if (OC_REST_DELETE == request->method)
     {
-        OC_LOG(DEBUG, TAG, "Received a Delete request");
+        OIC_LOG(DEBUG, TAG, "Received a Delete request");
         RMHandleDELETERequest(request, resource);
     }
-    OC_LOG(DEBUG, TAG, "RMHandleGatewayRequest OUT");
+    OIC_LOG(DEBUG, TAG, "RMHandleGatewayRequest OUT");
     return OC_STACK_OK;
 }
 
 OCStackResult RMHandleRequestPayload(OCDevAddr devAddr, const uint8_t *reqPayload,
                                      size_t payloadSize)
 {
-    OC_LOG(DEBUG, TAG, "RMHandleRequestPayload IN");
+    OIC_LOG(DEBUG, TAG, "RMHandleRequestPayload IN");
     RM_NULL_CHECK_WITH_RET(reqPayload, TAG, "reqPayload");
 
     uint32_t gatewayId = 0;
 
     OCStackResult result = RMPParseRequestPayload(reqPayload, payloadSize, &gatewayId);
     RM_VERIFY_SUCCESS(result, OC_STACK_OK);
-    OC_LOG(INFO, TAG, "RMPParseRequestPayload is success");
+    OIC_LOG(INFO, TAG, "RMPParseRequestPayload is success");
     // Check if the entry is its own.
     if (gatewayId == g_GatewayID)
     {
-        OC_LOG(INFO, TAG, "Own Request Received!!");
+        OIC_LOG(INFO, TAG, "Own Request Received!!");
         return OC_STACK_CONTINUE;
     }
 
     CAEndpoint_t endpoint = {.adapter = CA_DEFAULT_ADAPTER};
     CopyDevAddrToEndpoint(&devAddr, &endpoint);
 
-    OC_LOG_V(INFO, TAG, "Add the gateway ID: %u", gatewayId);
+    OIC_LOG_V(INFO, TAG, "Add the gateway ID: %u", gatewayId);
     RTMDestIntfInfo_t destInterfaces = {.observerId = 0};
     destInterfaces.destIntfAddr = endpoint;
     result = RTMAddGatewayEntry(gatewayId, 0, 1, &destInterfaces, &g_routingGatewayTable);
 
     if (OC_STACK_OK != result)
     {
-        OC_LOG(DEBUG, TAG, "Gateway was not added to the routing table");
+        OIC_LOG(DEBUG, TAG, "Gateway was not added to the routing table");
         return result;
     }
 
-    OC_LOG(INFO, TAG, "Gateway was added");
+    OIC_LOG(INFO, TAG, "Gateway was added");
     // Create a list to add the updated entries and notify the observers
     u_linklist_t *updatedTableList = u_linklist_create();
     if(!updatedTableList)
     {
-        OC_LOG(DEBUG, TAG, "Failure to notify");
+        OIC_LOG(DEBUG, TAG, "Failure to notify");
         return OC_STACK_NO_MEMORY;
     }
 
@@ -318,7 +318,7 @@ OCStackResult RMHandleRequestPayload(OCDevAddr devAddr, const uint8_t *reqPayloa
                                            &updatedPayload);
     if (OC_STACK_OK != result)
     {
-        OC_LOG_V(ERROR, TAG, "RMPConstructObserveResPayload failed[%d]", result);
+        OIC_LOG_V(ERROR, TAG, "RMPConstructObserveResPayload failed[%d]", result);
         RMPFreePayload(updatedPayload);
         goto exit;
     }
@@ -329,13 +329,13 @@ OCStackResult RMHandleRequestPayload(OCDevAddr devAddr, const uint8_t *reqPayloa
 
 exit:
     u_linklist_free(&updatedTableList);
-    OC_LOG(DEBUG, TAG, "RMHandleRequestPayload OUT");
+    OIC_LOG(DEBUG, TAG, "RMHandleRequestPayload OUT");
     return result;
 }
 
 OCStackResult RMHandleResponsePayload(const OCDevAddr *devAddr, const OCRepPayload *respPayload)
 {
-    OC_LOG(DEBUG, TAG, "RMHandleResponsePayload IN");
+    OIC_LOG(DEBUG, TAG, "RMHandleResponsePayload IN");
     RM_NULL_CHECK_WITH_RET(respPayload, TAG, "respPayload");
 
     // Parse the Payload to get the Gateway ID of neighbouring node.
@@ -350,7 +350,7 @@ OCStackResult RMHandleResponsePayload(const OCDevAddr *devAddr, const OCRepPaylo
     // Check if the entry is its own.
     if (gatewayId == g_GatewayID)
     {
-        OC_LOG(INFO, TAG, "-------------->Own entry, continue!!");
+        OIC_LOG(INFO, TAG, "-------------->Own entry, continue!!");
         RTMFreeGatewayRouteTable(&gatewayTableList);
         return OC_STACK_ERROR;
     }
@@ -361,13 +361,13 @@ OCStackResult RMHandleResponsePayload(const OCDevAddr *devAddr, const OCRepPaylo
     destInterfaces.destIntfAddr = endpoint;
     if (0 < seqNum)
     {
-        OC_LOG_V(DEBUG, TAG, "Sequence Number of Resp payload is %d, Forceupdate: %d",
+        OIC_LOG_V(DEBUG, TAG, "Sequence Number of Resp payload is %d, Forceupdate: %d",
                  seqNum, isUpdateSeqNum);
         result = RTMUpdateEntryParameters(gatewayId, seqNum, &destInterfaces,
                                           &g_routingGatewayTable, isUpdateSeqNum);
         if (OC_STACK_COMM_ERROR == result)
         {
-            OC_LOG(ERROR, TAG, "Few packet drops are found, sequence number is not matching");
+            OIC_LOG(ERROR, TAG, "Few packet drops are found, sequence number is not matching");
             // Send a observe request to the gateway.
             RMSendObserveRequest(devAddr, NULL);
             RTMFreeGatewayRouteTable(&gatewayTableList);
@@ -375,7 +375,7 @@ OCStackResult RMHandleResponsePayload(const OCDevAddr *devAddr, const OCRepPaylo
         }
         else if (OC_STACK_DUPLICATE_REQUEST == result)
         {
-            OC_LOG(ERROR, TAG, "Same sequence number is received");
+            OIC_LOG(ERROR, TAG, "Same sequence number is received");
             RTMFreeGatewayRouteTable(&gatewayTableList);
             return result;
         }
@@ -389,7 +389,7 @@ OCStackResult RMHandleResponsePayload(const OCDevAddr *devAddr, const OCRepPaylo
         RTMGatewayEntry_t *headPtr = u_linklist_get_data(gatewayTableList->list);
         if (headPtr && 0 == headPtr->routeCost)
         {
-            OC_LOG(INFO, TAG, "Remove entry is called");
+            OIC_LOG(INFO, TAG, "Remove entry is called");
             doRemoveEntry = true;
         }
     }
@@ -398,25 +398,25 @@ OCStackResult RMHandleResponsePayload(const OCDevAddr *devAddr, const OCRepPaylo
     u_linklist_t *updatedTableList = u_linklist_create();
     if(!updatedTableList)
     {
-        OC_LOG(DEBUG, TAG, "Failed to allocate memory");
+        OIC_LOG(DEBUG, TAG, "Failed to allocate memory");
         return OC_STACK_NO_MEMORY;
     }
 
     u_linklist_t *alternativeRouteList = u_linklist_create();
     if(!alternativeRouteList)
     {
-        OC_LOG(DEBUG, TAG, "Failed to allocate memory");
+        OIC_LOG(DEBUG, TAG, "Failed to allocate memory");
         return OC_STACK_NO_MEMORY;
     }
 
     OCRepPayload *updatedPayload = NULL;
     if (false == doRemoveEntry)
     {
-        OC_LOG_V(INFO, TAG, "Add the gateway ID: %u", gatewayId);
+        OIC_LOG_V(INFO, TAG, "Add the gateway ID: %u", gatewayId);
         result = RTMAddGatewayEntry(gatewayId, 0, 1, &destInterfaces, &g_routingGatewayTable);
         if (OC_STACK_OK == result)
         {
-            OC_LOG(INFO, TAG, "Node was added");
+            OIC_LOG(INFO, TAG, "Node was added");
             RTMGatewayId_t gwId = {.gatewayId = gatewayId};
             RTMGatewayEntry_t newNode;
             newNode.destination = &gwId;
@@ -426,7 +426,7 @@ OCStackResult RMHandleResponsePayload(const OCDevAddr *devAddr, const OCRepPaylo
 
             if (NULL == gatewayTableList)
             {
-                OC_LOG(INFO, TAG, "Received a Discover Payload");
+                OIC_LOG(INFO, TAG, "Received a Discover Payload");
                 g_sequenceNumber++;
                 result = RMPConstructObserveResPayload(g_GatewayID, g_sequenceNumber,
                                                        updatedTableList, false,
@@ -447,12 +447,12 @@ OCStackResult RMHandleResponsePayload(const OCDevAddr *devAddr, const OCRepPaylo
         // Check if the entry is its own.
         if (!entry || entry->destination->gatewayId == g_GatewayID)
         {
-            OC_LOG(INFO, TAG, "Ignore entry, continue!!");
+            OIC_LOG(INFO, TAG, "Ignore entry, continue!!");
             u_linklist_get_next(&iterTable);
             continue;
         }
 
-        OC_LOG_V(INFO, TAG, "Gateway ID: %u", entry->destination->gatewayId);
+        OIC_LOG_V(INFO, TAG, "Gateway ID: %u", entry->destination->gatewayId);
         if (true == doRemoveEntry)
         {
             // Remove the entry from RTM.
@@ -475,7 +475,7 @@ OCStackResult RMHandleResponsePayload(const OCDevAddr *devAddr, const OCRepPaylo
 
         if (OC_STACK_OK == result)
         {
-            OC_LOG(INFO, TAG, "Gateway was added/removed");
+            OIC_LOG(INFO, TAG, "Gateway was added/removed");
             u_linklist_add(updatedTableList, (void *)entry);
             RTMPrintTable(g_routingGatewayTable, g_routingEndpointTable);
         }
@@ -484,7 +484,7 @@ OCStackResult RMHandleResponsePayload(const OCDevAddr *devAddr, const OCRepPaylo
 
     if ( 0 < u_linklist_length(alternativeRouteList))
     {
-        OC_LOG(DEBUG, TAG, "Alternative routing found");
+        OIC_LOG(DEBUG, TAG, "Alternative routing found");
         // Send the notification.
         OCRepPayload *removeTablePayload = NULL;
         g_sequenceNumber++;
@@ -493,7 +493,7 @@ OCStackResult RMHandleResponsePayload(const OCDevAddr *devAddr, const OCRepPaylo
                                                &removeTablePayload);
         if (OC_STACK_OK != result)
         {
-            OC_LOG_V(ERROR, TAG, "RMPConstructObserveResPayload failed[%d]", result);
+            OIC_LOG_V(ERROR, TAG, "RMPConstructObserveResPayload failed[%d]", result);
             RMPFreePayload(removeTablePayload);
             goto exit;
         }
@@ -504,7 +504,7 @@ OCStackResult RMHandleResponsePayload(const OCDevAddr *devAddr, const OCRepPaylo
 
     if ( 0 >= u_linklist_length(updatedTableList))
     {
-        OC_LOG_V(DEBUG, TAG, "No updation is needed, Length is %d",
+        OIC_LOG_V(DEBUG, TAG, "No updation is needed, Length is %d",
                  u_linklist_length(updatedTableList));
         goto exit;
     }
@@ -532,13 +532,13 @@ exit:
     RTMFreeGatewayRouteTable(&gatewayTableList);
     u_linklist_free(&updatedTableList);
     u_linklist_free(&alternativeRouteList);
-    OC_LOG(DEBUG, TAG, "RMHandleResponsePayload OUT");
+    OIC_LOG(DEBUG, TAG, "RMHandleResponsePayload OUT");
     return OC_STACK_OK;
 }
 
 OCStackResult RMHandleGETRequest(const OCServerRequest *request, const OCResource *resource)
 {
-    OC_LOG(DEBUG, TAG, "RMHandleGETRequest IN");
+    OIC_LOG(DEBUG, TAG, "RMHandleGETRequest IN");
     RM_NULL_CHECK_WITH_RET(request, TAG, "request");
     RM_NULL_CHECK_WITH_RET(resource, TAG, "resource");
 
@@ -546,7 +546,7 @@ OCStackResult RMHandleGETRequest(const OCServerRequest *request, const OCResourc
     OCStackResult result = RMPConstructGatewayPayload(g_GatewayID, &payload);
     if (OC_STACK_OK != result)
     {
-        OC_LOG_V(DEBUG, TAG, "RMPConstructDiscoverPayload failed[%d]", result);
+        OIC_LOG_V(DEBUG, TAG, "RMPConstructDiscoverPayload failed[%d]", result);
         return result;
     }
 
@@ -554,7 +554,7 @@ OCStackResult RMHandleGETRequest(const OCServerRequest *request, const OCResourc
     result = RMSendResponse(request, resource, payload);
     if (OC_STACK_OK != result)
     {
-        OC_LOG_V(DEBUG, TAG, "Send response failed[%d]", result);
+        OIC_LOG_V(DEBUG, TAG, "Send response failed[%d]", result);
         RMPFreePayload(payload);
         return result;
     }
@@ -564,15 +564,15 @@ OCStackResult RMHandleGETRequest(const OCServerRequest *request, const OCResourc
     result = RMSendObserveRequest(&(request->devAddr), NULL);
     if (OC_STACK_OK != result)
     {
-        OC_LOG_V(DEBUG, TAG, "Send response failed[%d]", result);
+        OIC_LOG_V(DEBUG, TAG, "Send response failed[%d]", result);
     }
-    OC_LOG(DEBUG, TAG, "RMHandleGETRequest OUT");
+    OIC_LOG(DEBUG, TAG, "RMHandleGETRequest OUT");
     return result;
 }
 
 OCStackResult RMHandleOBSERVERequest(OCServerRequest *request, const OCResource *resource)
 {
-    OC_LOG(DEBUG, TAG, "RMHandleOBSERVERequest IN");
+    OIC_LOG(DEBUG, TAG, "RMHandleOBSERVERequest IN");
     RM_NULL_CHECK_WITH_RET(request, TAG, "request");
     RM_NULL_CHECK_WITH_RET(resource, TAG, "resource");
 
@@ -586,19 +586,19 @@ OCStackResult RMHandleOBSERVERequest(OCServerRequest *request, const OCResource
     OCObservationId obsID = 0;
     OCStackResult result = RMAddObserver(request, &obsID);
     RM_VERIFY_SUCCESS(result, OC_STACK_OK);
-    OC_LOG_V(DEBUG, TAG, "Observer ID is %d", obsID);
+    OIC_LOG_V(DEBUG, TAG, "Observer ID is %d", obsID);
 
 
     // Get the Routing table from RTM
     OCRepPayload *payload = NULL;
     RTMPrintTable(g_routingGatewayTable, g_routingEndpointTable);
-    OC_LOG(DEBUG, TAG, "Construct Routing table payload");
+    OIC_LOG(DEBUG, TAG, "Construct Routing table payload");
     result = RMPConstructObserveResPayload(g_GatewayID, g_sequenceNumber,
                                            g_routingGatewayTable, true,
                                            &payload);
     if (OC_STACK_OK != result)
     {
-        OC_LOG_V(ERROR, TAG, "RMPConstructObserveResPayload failed[%d]", result);
+        OIC_LOG_V(ERROR, TAG, "RMPConstructObserveResPayload failed[%d]", result);
         RMPFreePayload(payload);
         goto exit;
     }
@@ -607,13 +607,13 @@ OCStackResult RMHandleOBSERVERequest(OCServerRequest *request, const OCResource
     RMPFreePayload(payload);
     RM_VERIFY_SUCCESS(result, OC_STACK_OK);
 exit:
-    OC_LOG(DEBUG, TAG, "RMHandleOBSERVERequest OUT");
+    OIC_LOG(DEBUG, TAG, "RMHandleOBSERVERequest OUT");
     return result;
 }
 
 OCStackResult RMHandleDELETERequest(const OCServerRequest *request, const OCResource *resource)
 {
-    OC_LOG(DEBUG, TAG, "RMHandleDELETERequest IN");
+    OIC_LOG(DEBUG, TAG, "RMHandleDELETERequest IN");
     RM_NULL_CHECK_WITH_RET(request, TAG, "request");
     RM_NULL_CHECK_WITH_RET(resource, TAG, "resource");
 
@@ -621,9 +621,9 @@ OCStackResult RMHandleDELETERequest(const OCServerRequest *request, const OCReso
     OCStackResult result = RMPParseRequestPayload(request->payload, request->payloadSize,
                                                   &gatewayId);
     RM_VERIFY_SUCCESS(result, OC_STACK_OK);
-    OC_LOG(INFO, TAG, "RMPParseRequestPayload is success");
+    OIC_LOG(INFO, TAG, "RMPParseRequestPayload is success");
 
-    OC_LOG_V(INFO, TAG, "Remove the gateway ID: %u", gatewayId);
+    OIC_LOG_V(INFO, TAG, "Remove the gateway ID: %u", gatewayId);
 
     u_linklist_t *removedGatewayNodes = NULL;
     result = RTMRemoveGatewayEntry(gatewayId, &removedGatewayNodes, &g_routingGatewayTable);
@@ -637,7 +637,7 @@ OCStackResult RMHandleDELETERequest(const OCServerRequest *request, const OCReso
                                             false, &resPayloads);
         if (OC_STACK_OK != result)
         {
-            OC_LOG_V(ERROR, TAG, "RMPConstructRemovalPayload failed[%d]", result);
+            OIC_LOG_V(ERROR, TAG, "RMPConstructRemovalPayload failed[%d]", result);
             RMPFreePayload(resPayloads);
             goto exit;
         }
@@ -649,13 +649,13 @@ OCStackResult RMHandleDELETERequest(const OCServerRequest *request, const OCReso
 
 exit:
     RTMFreeGatewayRouteTable(&removedGatewayNodes);
-    OC_LOG(DEBUG, TAG, "RMHandleDELETERequest OUT");
+    OIC_LOG(DEBUG, TAG, "RMHandleDELETERequest OUT");
     return result;
 }
 
 OCStackResult RMAddObserver(OCServerRequest *request, OCObservationId *obsID)
 {
-    OC_LOG(DEBUG, TAG, "RMAddObserverForGateway OUT");
+    OIC_LOG(DEBUG, TAG, "RMAddObserverForGateway OUT");
     RM_NULL_CHECK_WITH_RET(request, TAG, "request");
     RM_NULL_CHECK_WITH_RET(obsID, TAG, "obsID");
 
@@ -666,7 +666,7 @@ OCStackResult RMAddObserver(OCServerRequest *request, OCObservationId *obsID)
     // Check if observer is already added.
     if (true == RTMIsObserverPresent(endpoint, obsID, g_routingGatewayTable))
     {
-        OC_LOG(DEBUG, TAG, "Observer is present");
+        OIC_LOG(DEBUG, TAG, "Observer is present");
         request->observeResult = OC_STACK_OK;
         return OC_STACK_OK;
     }
@@ -675,22 +675,22 @@ OCStackResult RMAddObserver(OCServerRequest *request, OCObservationId *obsID)
     request->observeResult = result;
     if (OC_STACK_OK == result)
     {
-        OC_LOG(DEBUG, TAG, "Added observer successfully");
+        OIC_LOG(DEBUG, TAG, "Added observer successfully");
 
         // Add the observer to the list.
         result = RTMAddObserver(*obsID, endpoint, &g_routingGatewayTable);
         if (OC_STACK_OK != result)
         {
-            OC_LOG_V(DEBUG, TAG, "RMAddObserver failed[%d]", result);
+            OIC_LOG_V(DEBUG, TAG, "RMAddObserver failed[%d]", result);
         }
     }
-    OC_LOG(DEBUG, TAG, "RMAddObserverForGateway OUT");
+    OIC_LOG(DEBUG, TAG, "RMAddObserverForGateway OUT");
     return result;
 }
 
 OCStackResult RMSendNotificationToAll(const OCRepPayload *payload)
 {
-    OC_LOG(DEBUG, TAG, "RMSendNotificationToAll IN");
+    OIC_LOG(DEBUG, TAG, "RMSendNotificationToAll IN");
     RM_NULL_CHECK_WITH_RET(payload, TAG, "payload");
 
     OCObservationId *obsList = NULL;
@@ -698,11 +698,11 @@ OCStackResult RMSendNotificationToAll(const OCRepPayload *payload)
     // Get the complete observer list.
     RTMGetObserverList(&obsList, &obsLen, g_routingGatewayTable);
     OCStackResult result = OC_STACK_OK;
-    OC_LOG_V(DEBUG, TAG, "Number of observers is %d", obsLen);
+    OIC_LOG_V(DEBUG, TAG, "Number of observers is %d", obsLen);
     if (0 < obsLen)
     {
         // Send notification to the list of observers.
-        OC_LOG_V(DEBUG, TAG, "Sending notification with Sequence Number: %d", g_sequenceNumber);
+        OIC_LOG_V(DEBUG, TAG, "Sending notification with Sequence Number: %d", g_sequenceNumber);
         result = RMSendNotificationForListofObservers(obsList, obsLen, payload);
         RM_VERIFY_SUCCESS(result, OC_STACK_OK);
         g_aliveTime = RTMGetCurrentTime();
@@ -710,7 +710,7 @@ OCStackResult RMSendNotificationToAll(const OCRepPayload *payload)
 
 exit:
     OICFree(obsList);
-    OC_LOG(DEBUG, TAG, "RMSendNotificationToAll OUT");
+    OIC_LOG(DEBUG, TAG, "RMSendNotificationToAll OUT");
     return result;
 }
 
@@ -732,11 +732,11 @@ void RMProcess()
                                                false, &payload);
         if (OC_STACK_OK != result)
         {
-            OC_LOG_V(ERROR, TAG, "RMPConstructObserveResPayload failed[%d]", result);
+            OIC_LOG_V(ERROR, TAG, "RMPConstructObserveResPayload failed[%d]", result);
             RMPFreePayload(payload);
             goto exit;
         }
-        OC_LOG(DEBUG, TAG, "Sending the alive notification to all");
+        OIC_LOG(DEBUG, TAG, "Sending the alive notification to all");
         // Send notification for every 15s to all the neighbours.
         result = RMSendNotificationToAll(payload);
         RMPFreePayload(payload);
@@ -745,7 +745,7 @@ void RMProcess()
 
     if (ROUTINGTABLE_VALIDATION_TIMEOUT <= currentTime - g_refreshTableTime)
     {
-        OC_LOG(DEBUG, TAG, "Validating the routing table");
+        OIC_LOG(DEBUG, TAG, "Validating the routing table");
         u_linklist_t *removedEntries = NULL;
         // Remove the invalid gateway entries.
         RTMRemoveInvalidGateways(&removedEntries, &g_routingGatewayTable);
@@ -758,7 +758,7 @@ void RMProcess()
             RTMFreeGatewayRouteTable(&removedEntries);
             if (OC_STACK_OK != result)
             {
-                OC_LOG_V(ERROR, TAG, "RMPConstructRemovalPayload failed[%d]", result);
+                OIC_LOG_V(ERROR, TAG, "RMPConstructRemovalPayload failed[%d]", result);
                 RMPFreePayload(resPayloads);
                 goto exit;
             }
@@ -775,7 +775,7 @@ void RMProcess()
 
     if (!g_isValidated && ROUTINGTABLE_REFRESH_TIMEOUT <= (currentTime - g_refreshTableTime))
     {
-        OC_LOG_V(DEBUG, TAG, "Refreshing the routing table: %llu", currentTime);
+        OIC_LOG_V(DEBUG, TAG, "Refreshing the routing table: %llu", currentTime);
         u_linklist_t* invalidInterfaces = NULL;
         RTMUpdateDestAddrValidity(&invalidInterfaces, &g_routingGatewayTable);
         if (0 < u_linklist_length(invalidInterfaces))
@@ -807,22 +807,22 @@ exit:
 
 OCStackResult RMGetGatewayPayload(OCRepPayload **payload)
 {
-    OC_LOG(DEBUG, TAG, "RMGetGatewayPayload IN");
+    OIC_LOG(DEBUG, TAG, "RMGetGatewayPayload IN");
     OCStackResult result = RMPConstructGatewayPayload(g_GatewayID, payload);
-    OC_LOG_V(DEBUG, TAG, "RMPConstructDiscoverPayload result is %d", result);
-    OC_LOG(DEBUG, TAG, "RMGetGatewayPayload OUT");
+    OIC_LOG_V(DEBUG, TAG, "RMPConstructDiscoverPayload result is %d", result);
+    OIC_LOG(DEBUG, TAG, "RMGetGatewayPayload OUT");
     return result;
 }
 
 void RMSendDeleteToNeighbourNodes()
 {
-    OC_LOG(DEBUG, TAG, "RMSendDeleteToNeighbourNodes IN");
+    OIC_LOG(DEBUG, TAG, "RMSendDeleteToNeighbourNodes IN");
     u_linklist_t *neighbourNodes = NULL;
     RTMGetNeighbours(&neighbourNodes, g_routingGatewayTable);
 
     if (0 >= u_linklist_length(neighbourNodes))
     {
-        OC_LOG(DEBUG, TAG, "No neighbour nodes present");
+        OIC_LOG(DEBUG, TAG, "No neighbour nodes present");
         return;
     }
 
@@ -836,7 +836,7 @@ void RMSendDeleteToNeighbourNodes()
         OCStackResult result = RMPConstructGatewayPayload(g_GatewayID, &payload);
         if (OC_STACK_OK != result)
         {
-            OC_LOG_V(DEBUG, TAG, "RMPConstructGatewayPayload failed[%d]", result);
+            OIC_LOG_V(DEBUG, TAG, "RMPConstructGatewayPayload failed[%d]", result);
             RMPFreePayload(payload);
             u_linklist_free(&neighbourNodes);
             return;
@@ -850,12 +850,12 @@ void RMSendDeleteToNeighbourNodes()
                 RTMDestIntfInfo_t *dest = u_arraylist_get(entry->destination->destIntfAddr, i);
                 if (!dest)
                 {
-                    OC_LOG(ERROR, RM_TAG, "Failed to get dest address");
+                    OIC_LOG(ERROR, RM_TAG, "Failed to get dest address");
                     continue;
                 }
                 OCDevAddr devAddr = {.adapter = OC_DEFAULT_ADAPTER};
                 CopyEndpointToDevAddr(&(dest->destIntfAddr), &devAddr);
-                OC_LOG_V(DEBUG, TAG, "\nDestination interface addresses: %s[%d], OCDevAddr: %s[%d]",
+                OIC_LOG_V(DEBUG, TAG, "\nDestination interface addresses: %s[%d], OCDevAddr: %s[%d]",
                          dest->destIntfAddr.addr, dest->destIntfAddr.port, devAddr.addr, devAddr.port);
                 RMSendDeleteRequest(&devAddr, payload);
             }
@@ -865,14 +865,14 @@ void RMSendDeleteToNeighbourNodes()
     }
 
     u_linklist_free(&neighbourNodes);
-    OC_LOG(DEBUG, TAG, "RMSendDeleteToNeighbourNodes OUT");
+    OIC_LOG(DEBUG, TAG, "RMSendDeleteToNeighbourNodes OUT");
 }
 
 uint32_t RMGetGatewayId()
 {
     if (!g_isRMInitialized)
     {
-        OC_LOG(ERROR, TAG, "RM not initialized");
+        OIC_LOG(ERROR, TAG, "RM not initialized");
         return 0;
     }
     return g_GatewayID;
@@ -882,7 +882,7 @@ uint16_t RMGetMcastSeqNumber()
 {
     if (!g_isRMInitialized)
     {
-        OC_LOG(DEBUG, TAG, "RM not initialized");
+        OIC_LOG(DEBUG, TAG, "RM not initialized");
         return 0;
     }
     return ++g_mcastsequenceNumber;
@@ -933,7 +933,7 @@ OCStackResult RMHandlePacket(bool isRequest, void *message, const CAEndpoint_t *
     RMGetRouteOptionIndex(info->options, info->numOptions, &routeIndex);
     if (-1 >= routeIndex)
     {
-        OC_LOG(ERROR, RM_TAG, "No route option present. Let RI Handle");
+        OIC_LOG(ERROR, RM_TAG, "No route option present. Let RI Handle");
         // Let RI handle this packet.
         *selfDestination = true;
         return OC_STACK_OK;
@@ -944,7 +944,7 @@ OCStackResult RMHandlePacket(bool isRequest, void *message, const CAEndpoint_t *
     OCStackResult res = RMParseRouteOption(&info->options[routeIndex], &routeOption);
     if (OC_STACK_OK != res)
     {
-        OC_LOG_V(ERROR, RM_TAG, "RMParseRouteOption failed");
+        OIC_LOG_V(ERROR, RM_TAG, "RMParseRouteOption failed");
         return OC_STACK_ERROR;
     }
 
@@ -954,7 +954,7 @@ OCStackResult RMHandlePacket(bool isRequest, void *message, const CAEndpoint_t *
      */
     if (g_GatewayID == routeOption.srcGw)
     {
-        OC_LOG_V(ERROR, RM_TAG, "Packet is of its own");
+        OIC_LOG_V(ERROR, RM_TAG, "Packet is of its own");
         if (0 == routeOption.destGw && g_mcastsequenceNumber < routeOption.mSeqNum)
         {
             g_mcastsequenceNumber = routeOption.mSeqNum;
@@ -964,29 +964,29 @@ OCStackResult RMHandlePacket(bool isRequest, void *message, const CAEndpoint_t *
     }
     else if (0 == routeOption.srcGw)
     {
-        OC_LOG(INFO, RM_TAG, "Source missing in option");
+        OIC_LOG(INFO, RM_TAG, "Source missing in option");
         // Packet from end device as Gateway will add source in option.
         uint16_t endpointId = g_EndpointCount + 1;
         OCStackResult res = RTMAddEndpointEntry(&endpointId, sender, &g_routingEndpointTable);
         if (OC_STACK_OK == res)
         {
             g_EndpointCount = endpointId;
-            OC_LOG_V(INFO, RM_TAG, "New endpoint added [%d]:[%s]", g_EndpointCount, sender->addr);
+            OIC_LOG_V(INFO, RM_TAG, "New endpoint added [%d]:[%s]", g_EndpointCount, sender->addr);
         }
         else if (OC_STACK_DUPLICATE_REQUEST == res)
         {
-            OC_LOG_V(INFO, RM_TAG, "Endpoint exist [%d]", endpointId);
+            OIC_LOG_V(INFO, RM_TAG, "Endpoint exist [%d]", endpointId);
         }
         else
         {
-            OC_LOG(ERROR, RM_TAG, "Add Endpoint failed");
+            OIC_LOG(ERROR, RM_TAG, "Add Endpoint failed");
             return OC_STACK_ERROR;
         }
 
         // add source option.
         routeOption.srcGw = g_GatewayID;
         routeOption.srcEp = endpointId;
-        OC_LOG_V(INFO, RM_TAG, "Added source: [%u:%u]", g_GatewayID, endpointId);
+        OIC_LOG_V(INFO, RM_TAG, "Added source: [%u:%u]", g_GatewayID, endpointId);
     }
 
     /*
@@ -996,7 +996,7 @@ OCStackResult RMHandlePacket(bool isRequest, void *message, const CAEndpoint_t *
      */
     if (0 == routeOption.destGw)
     {
-        OC_LOG(INFO, RM_TAG, "Destination missing in option");
+        OIC_LOG(INFO, RM_TAG, "Destination missing in option");
         // This is a multicast packet.
         if (g_GatewayID == routeOption.srcGw)
         {
@@ -1009,7 +1009,7 @@ OCStackResult RMHandlePacket(bool isRequest, void *message, const CAEndpoint_t *
             if (OC_STACK_OK != update)
             {
                 // this shouldnt have been forwarded. ignore.
-                OC_LOG_V(ERROR, RM_TAG, "Multicast Sequence number not proper: %d",
+                OIC_LOG_V(ERROR, RM_TAG, "Multicast Sequence number not proper: %d",
                          routeOption.mSeqNum);
                 return OC_STACK_ERROR;
             }
@@ -1047,7 +1047,7 @@ OCStackResult RMHandlePacket(bool isRequest, void *message, const CAEndpoint_t *
     }
     else if (g_GatewayID == routeOption.destGw)
     {
-        OC_LOG(INFO, RM_TAG, "GatewayId found in destination");
+        OIC_LOG(INFO, RM_TAG, "GatewayId found in destination");
         /*
          * This unicast packet either belongs to us or any of our connected end devices
          * check if packet belongs to end device.
@@ -1055,12 +1055,12 @@ OCStackResult RMHandlePacket(bool isRequest, void *message, const CAEndpoint_t *
         if (0 != routeOption.destEp)
         {
             // forward packet to the client.
-            OC_LOG_V(INFO, RM_TAG, "Forwarding packet to client id [%u]", routeOption.destEp);
+            OIC_LOG_V(INFO, RM_TAG, "Forwarding packet to client id [%u]", routeOption.destEp);
             CAEndpoint_t *clientInfo = RTMGetEndpointEntry(routeOption.destEp,
                                                            g_routingEndpointTable);
             if(!clientInfo)
             {
-                OC_LOG(ERROR, RM_TAG, "Failed to get Client info");
+                OIC_LOG(ERROR, RM_TAG, "Failed to get Client info");
                 return OC_STACK_ERROR;
             }
 
@@ -1072,7 +1072,7 @@ OCStackResult RMHandlePacket(bool isRequest, void *message, const CAEndpoint_t *
         else
         {
             // packet is for us.
-            OC_LOG(INFO, RM_TAG, "Received packet for self");
+            OIC_LOG(INFO, RM_TAG, "Received packet for self");
             forward = false;
             *selfDestination = true;
             goto rewriteandexit;
@@ -1084,11 +1084,11 @@ OCStackResult RMHandlePacket(bool isRequest, void *message, const CAEndpoint_t *
          * This unicast packet belongs to other gateway.
          * we only want to print first 4 bytes of packet as readable GatewayId.
          */
-        OC_LOG_V(INFO, RM_TAG, "Forwarding packet to Gateway: %u", routeOption.destGw);
+        OIC_LOG_V(INFO, RM_TAG, "Forwarding packet to Gateway: %u", routeOption.destGw);
         RTMGatewayId_t *nextHopGw = RTMGetNextHop(routeOption.destGw, g_routingGatewayTable);
         if(!nextHopGw)
         {
-            OC_LOG(ERROR, RM_TAG, "Failed to get next hop");
+            OIC_LOG(ERROR, RM_TAG, "Failed to get next hop");
             return OC_STACK_ERROR;
         }
 
@@ -1096,7 +1096,7 @@ OCStackResult RMHandlePacket(bool isRequest, void *message, const CAEndpoint_t *
         RTMDestIntfInfo_t *address = u_arraylist_get(nextHopGw->destIntfAddr, 0);
         if (!address)
         {
-            OC_LOG(ERROR, RM_TAG, "Failed to get address for next hop");
+            OIC_LOG(ERROR, RM_TAG, "Failed to get address for next hop");
             return OC_STACK_ERROR;
         }
 
@@ -1113,11 +1113,11 @@ rewriteandexit:
         // Don't forward any packet meant for gateway resource.
         if (info->resourceUri && (0 == strcmp(info->resourceUri, OC_RSRVD_GATEWAY_URI)))
         {
-            OC_LOG(ERROR, RM_TAG, "Not forwarding gateway resource packet");
+            OIC_LOG(ERROR, RM_TAG, "Not forwarding gateway resource packet");
         }
         else if (sender->flags & CA_SECURE)
         {
-            OC_LOG(ERROR, RM_TAG, "This is secured request. Not supported by routing manager");
+            OIC_LOG(ERROR, RM_TAG, "This is secured request. Not supported by routing manager");
             return OC_STACK_ERROR;
         }
         else
@@ -1126,7 +1126,7 @@ rewriteandexit:
             res = RMCreateRouteOption(&routeOption, &info->options[routeIndex]);
             if (OC_STACK_OK != res)
             {
-                OC_LOG_V(ERROR, RM_TAG, "Rewriting RM option failed");
+                OIC_LOG_V(ERROR, RM_TAG, "Rewriting RM option failed");
                 return res;
             }
             /*
@@ -1140,7 +1140,7 @@ rewriteandexit:
                 CAResult_t caRes = CASendRequest(&nextHop, msg);
                 if (CA_STATUS_OK != caRes)
                 {
-                    OC_LOG_V(ERROR, RM_TAG, "Failed to forward request to next hop [%d][%s]", caRes,
+                    OIC_LOG_V(ERROR, RM_TAG, "Failed to forward request to next hop [%d][%s]", caRes,
                              nextHop.addr);
                     if(0 == routeOption.destGw)
                     {
@@ -1159,7 +1159,7 @@ rewriteandexit:
                 CAResult_t caRes = CASendResponse(&nextHop, msg);
                 if (CA_STATUS_OK != caRes)
                 {
-                    OC_LOG_V(ERROR, RM_TAG, "Failed to forward response to next hop [%d][%s]",
+                    OIC_LOG_V(ERROR, RM_TAG, "Failed to forward response to next hop [%d][%s]",
                              caRes, nextHop.addr);
                     // Since a response is always unicast, return error here.
                     return OC_STACK_ERROR;
@@ -1168,7 +1168,7 @@ rewriteandexit:
         }
     }
 
-    OC_LOG_V(INFO, RM_TAG, "Sender: [%u] Destination: [%u]", routeOption.srcGw, routeOption.destGw);
+    OIC_LOG_V(INFO, RM_TAG, "Sender: [%u] Destination: [%u]", routeOption.srcGw, routeOption.destGw);
     return OC_STACK_OK;
 }
 
@@ -1177,7 +1177,7 @@ OCStackResult RMHandleRequest(CARequestInfo_t *message, const CAEndpoint_t *send
 {
     if (!g_isRMInitialized)
     {
-        OC_LOG(ERROR, TAG, "RM not initialized");
+        OIC_LOG(ERROR, TAG, "RM not initialized");
         *selfDestination = true;
         return OC_STACK_OK;
     }
@@ -1190,7 +1190,7 @@ OCStackResult RMHandleResponse(CAResponseInfo_t *message, const CAEndpoint_t *se
 {
     if (!g_isRMInitialized)
     {
-        OC_LOG(ERROR, TAG, "RM not initialized");
+        OIC_LOG(ERROR, TAG, "RM not initialized");
         *selfDestination = true;
         return OC_STACK_OK;
     }
index 37e2f34..e0172fb 100644 (file)
@@ -83,14 +83,14 @@ OCConnectivityType RMGetConnectivityType(OCTransportAdapter adapter)
         case OC_DEFAULT_ADAPTER:
             break;
         default:
-            OC_LOG(DEBUG, TAG, "Default option will be selected");
+            OIC_LOG(DEBUG, TAG, "Default option will be selected");
     }
     return CT_DEFAULT;
 }
 
 OCStackResult RMInitGatewayResource()
 {
-    OC_LOG(DEBUG, TAG, "RMInitGatewayResource IN");
+    OIC_LOG(DEBUG, TAG, "RMInitGatewayResource IN");
 
     // Create a Gateway resource
     OCStackResult result = OCCreateResource(&g_gateWayHandle,
@@ -103,16 +103,16 @@ OCStackResult RMInitGatewayResource()
 
     if (OC_STACK_OK != result)
     {
-        OC_LOG_V(ERROR, TAG, "Create resource for gateway failed[%d]", result);
+        OIC_LOG_V(ERROR, TAG, "Create resource for gateway failed[%d]", result);
     }
 
-    OC_LOG(DEBUG, TAG, "RMInitGatewayResource OUT");
+    OIC_LOG(DEBUG, TAG, "RMInitGatewayResource OUT");
     return result;
 }
 
 OCStackResult RMDiscoverGatewayResource()
 {
-    OC_LOG(DEBUG, TAG, "RMDiscoverGatewayResource IN");
+    OIC_LOG(DEBUG, TAG, "RMDiscoverGatewayResource IN");
     OCCallbackData discoverData = {.cb = RMDiscoverGatewayCallback};
     OCStackResult result = OC_STACK_OK;
 
@@ -127,19 +127,19 @@ OCStackResult RMDiscoverGatewayResource()
                               CT_ADAPTER_IP, OC_LOW_QOS, &discoverData, NULL, 0);
         usleep(100000);
     }
-    OC_LOG(DEBUG, TAG, "RMDiscoverGatewayResource OUT");
+    OIC_LOG(DEBUG, TAG, "RMDiscoverGatewayResource OUT");
     return result;
 }
 
 OCStackApplicationResult RMDiscoverGatewayCallback(void* ctx, OCDoHandle handle,
                                                    OCClientResponse * clientResponse)
 {
-    OC_LOG(DEBUG, TAG, "RMDiscoverGatewayCallback IN");
+    OIC_LOG(DEBUG, TAG, "RMDiscoverGatewayCallback IN");
     (void)ctx;
     (void)handle;
     if (NULL == clientResponse)
     {
-        OC_LOG(DEBUG, TAG, "clientResponse is NULL");
+        OIC_LOG(DEBUG, TAG, "clientResponse is NULL");
         return OC_STACK_KEEP_TRANSACTION;
     }
 
@@ -147,7 +147,7 @@ OCStackApplicationResult RMDiscoverGatewayCallback(void* ctx, OCDoHandle handle,
                                                    (OCRepPayload *)clientResponse->payload);
     if (OC_STACK_OK != result)
     {
-        OC_LOG_V(ERROR, TAG, "RMHandleResponsePayload Failed[%d]", result);
+        OIC_LOG_V(ERROR, TAG, "RMHandleResponsePayload Failed[%d]", result);
     }
 
     OCRepPayload *payload = NULL;
@@ -155,21 +155,21 @@ OCStackApplicationResult RMDiscoverGatewayCallback(void* ctx, OCDoHandle handle,
     result= RMGetGatewayPayload(&payload);
     if (OC_STACK_OK != result)
     {
-        OC_LOG_V(ERROR, TAG, "RMGetGatewayPayload Failed[%d]", result);
+        OIC_LOG_V(ERROR, TAG, "RMGetGatewayPayload Failed[%d]", result);
     }
 
     RMSendObserveRequest(&(clientResponse->devAddr), payload);
 
-    OC_LOG(DEBUG, TAG, "RMDiscoverGatewayCallback OUT");
+    OIC_LOG(DEBUG, TAG, "RMDiscoverGatewayCallback OUT");
     return OC_STACK_KEEP_TRANSACTION;
 }
 
 OCStackResult RMSendObserveRequest(const OCDevAddr *devAddr, OCRepPayload *payload)
 {
-    OC_LOG(DEBUG, TAG, "RMSendObserveRequest IN");
-    OC_LOG_V(DEBUG, TAG, "Destination address is %s:%d", devAddr->addr, devAddr->port);
+    OIC_LOG(DEBUG, TAG, "RMSendObserveRequest IN");
+    OIC_LOG_V(DEBUG, TAG, "Destination address is %s:%d", devAddr->addr, devAddr->port);
     OCCallbackData observeData = {.cb = RMObserveRequestCallback};
-    OC_LOG(DEBUG, TAG, "RMSendObserveRequest OUT");
+    OIC_LOG(DEBUG, TAG, "RMSendObserveRequest OUT");
 
     return OCDoResource(NULL, OC_REST_OBSERVE, GW_RESOURCE_URI, devAddr, (OCPayload *)payload,
                         RMGetConnectivityType(devAddr->adapter), OC_HIGH_QOS,
@@ -178,12 +178,12 @@ OCStackResult RMSendObserveRequest(const OCDevAddr *devAddr, OCRepPayload *paylo
 
 OCStackResult RMSendDeleteRequest(const OCDevAddr *devAddr, OCRepPayload *payload)
 {
-    OC_LOG(DEBUG, TAG, "RMSendDeleteRequest IN");
+    OIC_LOG(DEBUG, TAG, "RMSendDeleteRequest IN");
     RM_NULL_CHECK_WITH_RET(payload, TAG, "payload");
-    OC_LOG_V(DEBUG, TAG, "Destination address is %s:%d", devAddr->addr, devAddr->port);
+    OIC_LOG_V(DEBUG, TAG, "Destination address is %s:%d", devAddr->addr, devAddr->port);
 
     OCCallbackData deleteCb = {.cb = RMDiscoverGatewayCallback};
-    OC_LOG(DEBUG, TAG, "RMSendDeleteRequest OUT");
+    OIC_LOG(DEBUG, TAG, "RMSendDeleteRequest OUT");
     return OCDoResource(NULL, OC_REST_DELETE, GW_RESOURCE_URI, devAddr, (OCPayload *)payload,
                     RMGetConnectivityType(devAddr->adapter), OC_LOW_QOS,
                     &deleteCb, NULL, 0);
@@ -192,14 +192,14 @@ OCStackResult RMSendDeleteRequest(const OCDevAddr *devAddr, OCRepPayload *payloa
 OCStackResult RMSendResponse(const OCServerRequest *request, const OCResource *resource,
                              const OCRepPayload *payload)
 {
-    OC_LOG(DEBUG, TAG, "RMSendResponse IN");
+    OIC_LOG(DEBUG, TAG, "RMSendResponse IN");
     OCEntityHandlerResponse response = {.ehResult = OC_EH_OK,
                                         .payload = (OCPayload *)payload,
                                         .persistentBufferFlag = 0,
                                         .requestHandle = (OCRequestHandle) request,
                                         .resourceHandle = (OCResourceHandle) resource
                                         };
-    OC_LOG(DEBUG, TAG, "RMSendResponse OUT");
+    OIC_LOG(DEBUG, TAG, "RMSendResponse OUT");
 
     return OCDoResponse(&response);
 }
@@ -207,31 +207,31 @@ OCStackResult RMSendResponse(const OCServerRequest *request, const OCResource *r
 OCStackResult RMSendNotificationForListofObservers(OCObservationId *obsId, uint8_t obsLen,
                                                    const OCRepPayload *payload)
 {
-    OC_LOG(DEBUG, TAG, "RMSendNotificationForListofObservers IN");
+    OIC_LOG(DEBUG, TAG, "RMSendNotificationForListofObservers IN");
     RM_NULL_CHECK_WITH_RET(obsId, TAG, "obsId");
     RM_NULL_CHECK_WITH_RET(payload, TAG, "payload");
     OCStackResult result = OCNotifyListOfObservers(g_gateWayHandle, obsId, obsLen,
                                                    payload, OC_LOW_QOS);
-    OC_LOG_V(DEBUG, TAG, "Result is %d", result);
-    OC_LOG(DEBUG, TAG, "RMSendNotificationForListofObservers OUT");
+    OIC_LOG_V(DEBUG, TAG, "Result is %d", result);
+    OIC_LOG(DEBUG, TAG, "RMSendNotificationForListofObservers OUT");
     return result;
 }
 
 OCStackApplicationResult RMObserveRequestCallback(void* ctx, OCDoHandle handle,
                                                   OCClientResponse *clientResponse)
 {
-    OC_LOG(DEBUG, TAG, "RMObserveRequestCallback IN");
+    OIC_LOG(DEBUG, TAG, "RMObserveRequestCallback IN");
     (void)ctx;
     (void)handle;
     if (NULL == clientResponse)
     {
-        OC_LOG(DEBUG, TAG, "clientResponse is NULL");
+        OIC_LOG(DEBUG, TAG, "clientResponse is NULL");
         return OC_STACK_KEEP_TRANSACTION;
     }
 
     if (OC_STACK_COMM_ERROR == clientResponse->result)
     {
-        OC_LOG(DEBUG, TAG, "Received TIMEOUT ERROR");
+        OIC_LOG(DEBUG, TAG, "Received TIMEOUT ERROR");
         return OC_STACK_KEEP_TRANSACTION;
     }
 
@@ -239,16 +239,16 @@ OCStackApplicationResult RMObserveRequestCallback(void* ctx, OCDoHandle handle,
                                                    (OCRepPayload *)clientResponse->payload);
     if (OC_STACK_OK != result)
     {
-        OC_LOG_V(ERROR, TAG, "RMHandleResponsePayload Failed[%d]", result);
+        OIC_LOG_V(ERROR, TAG, "RMHandleResponsePayload Failed[%d]", result);
     }
 
-    OC_LOG(DEBUG, TAG, "RMObserveRequestCallback OUT");
+    OIC_LOG(DEBUG, TAG, "RMObserveRequestCallback OUT");
     return OC_STACK_KEEP_TRANSACTION;
 }
 
 OCStackResult RMAddObserverToStack(const OCServerRequest *request, OCObservationId *obsID)
 {
-    OC_LOG(DEBUG, TAG, "RMAddObserverToStack IN");
+    OIC_LOG(DEBUG, TAG, "RMAddObserverToStack IN");
     RM_NULL_CHECK_WITH_RET(request, TAG, "request");
     RM_NULL_CHECK_WITH_RET(obsID, TAG, "obsID");
 
@@ -259,17 +259,17 @@ OCStackResult RMAddObserverToStack(const OCServerRequest *request, OCObservation
     }
     if (OC_STACK_OK != result)
     {
-        OC_LOG_V(DEBUG, TAG, "GenerateObserverId failed[%d]", result);
+        OIC_LOG_V(DEBUG, TAG, "GenerateObserverId failed[%d]", result);
         return result;
     }
 
-    OC_LOG_V(DEBUG, TAG, "Observer ID is %d", *obsID);
+    OIC_LOG_V(DEBUG, TAG, "Observer ID is %d", *obsID);
     // Add the observer
     result = AddObserver((const char*)(request->resourceUrl),
                 (const char *)(request->query),
                 *obsID, request->requestToken, request->tokenLength,
                 (OCResource *)g_gateWayHandle, request->qos, OC_FORMAT_CBOR,
                 &request->devAddr);
-    OC_LOG(DEBUG, TAG, "RMAddObserverToStack OUT");
+    OIC_LOG(DEBUG, TAG, "RMAddObserverToStack OUT");
     return result;
 }
index 485bb6e..7ee337c 100644 (file)
@@ -66,13 +66,13 @@ static const char UPDATE_SEQ_NUM[] = "updateseqnum";
 
 OCStackResult RMPConstructGatewayPayload(uint32_t gatewayId, OCRepPayload **payload)
 {
-    OC_LOG(DEBUG, TAG, "RMPConstructGatewayPayload IN");
+    OIC_LOG(DEBUG, TAG, "RMPConstructGatewayPayload IN");
     RM_NULL_CHECK_WITH_RET(payload, TAG, "payload");
 
     *payload = OCRepPayloadCreate();
     if(!*payload)
     {
-        OC_LOG(ERROR, TAG, "Failed to allocate Payload");
+        OIC_LOG(ERROR, TAG, "Failed to allocate Payload");
         return OC_STACK_ERROR;
     }
 
@@ -80,7 +80,7 @@ OCStackResult RMPConstructGatewayPayload(uint32_t gatewayId, OCRepPayload **payl
     OCRepPayloadSetPropInt(*payload, GATEWAY, gatewayId);
     OCRepPayloadSetPropInt(*payload, LENGTH_PROP, 0);
 
-    OC_LOG(DEBUG, TAG, "RMPConstructGatewayPayload OUT");
+    OIC_LOG(DEBUG, TAG, "RMPConstructGatewayPayload OUT");
 
     return OC_STACK_OK;
 }
@@ -89,13 +89,13 @@ OCStackResult RMPConstructObserveResPayload(uint32_t gatewayId, uint32_t seqNum,
                                             const u_linklist_t *routingtable, bool isUpdateSeqNeeded,
                                             OCRepPayload **payload)
 {
-    OC_LOG(DEBUG, TAG, "RMPConstructObserveResPayload IN");
+    OIC_LOG(DEBUG, TAG, "RMPConstructObserveResPayload IN");
     RM_NULL_CHECK_WITH_RET(payload, TAG, "payload");
 
     *payload =  (OCRepPayload *)OCRepPayloadCreate();
     if(!*payload)
     {
-        OC_LOG(ERROR, TAG, "Failed to allocate Payload");
+        OIC_LOG(ERROR, TAG, "Failed to allocate Payload");
         return OC_STACK_ERROR;
     }
 
@@ -106,7 +106,7 @@ OCStackResult RMPConstructObserveResPayload(uint32_t gatewayId, uint32_t seqNum,
     if (NULL == routingtable)
     {
         OCRepPayloadSetPropInt(*payload, LENGTH_PROP, 0);
-        OC_LOG(DEBUG, TAG, "Routing Table NULL for ObserveRes Payload");
+        OIC_LOG(DEBUG, TAG, "Routing Table NULL for ObserveRes Payload");
         return OC_STACK_OK;
     }
 
@@ -126,7 +126,7 @@ OCStackResult RMPConstructObserveResPayload(uint32_t gatewayId, uint32_t seqNum,
         OCRepPayload *add = OCRepPayloadCreate();
         if(!add)
         {
-            OC_LOG(ERROR, TAG, "Failed to allocate Payload");
+            OIC_LOG(ERROR, TAG, "Failed to allocate Payload");
             return OC_STACK_ERROR;
         }
 
@@ -144,12 +144,12 @@ OCStackResult RMPConstructObserveResPayload(uint32_t gatewayId, uint32_t seqNum,
         bool res = OCRepPayloadSetPropObjectArray(*payload, TABLE, arrayPayload, dimensions);
         if (!res)
         {
-            OC_LOG(ERROR, TAG, "Failed to Construct Observer response Payload");
+            OIC_LOG(ERROR, TAG, "Failed to Construct Observer response Payload");
             return OC_STACK_ERROR;
         }
     }
 
-    OC_LOG(DEBUG, TAG, "RMPConstructObserveResPayload OUT");
+    OIC_LOG(DEBUG, TAG, "RMPConstructObserveResPayload OUT");
     return OC_STACK_OK;
 }
 
@@ -157,7 +157,7 @@ OCStackResult RMPConstructRemovalPayload(uint32_t gatewayId, uint32_t seqNum,
                                          const u_linklist_t *removedGateways, bool isUpdateSeqNeeded,
                                          OCRepPayload **removedPayload)
 {
-    OC_LOG(DEBUG, TAG, "RMPConstructRemovalPayload IN");
+    OIC_LOG(DEBUG, TAG, "RMPConstructRemovalPayload IN");
     RM_NULL_CHECK_WITH_RET(removedGateways, TAG, "removedGateways");
     RM_NULL_CHECK_WITH_RET(removedPayload, TAG, "removedPayload");
 
@@ -167,7 +167,7 @@ OCStackResult RMPConstructRemovalPayload(uint32_t gatewayId, uint32_t seqNum,
     *removedPayload =  OCRepPayloadCreate();
     if(!*removedPayload)
     {
-        OC_LOG(ERROR, TAG, "Failed to allocate Payload");
+        OIC_LOG(ERROR, TAG, "Failed to allocate Payload");
         return OC_STACK_ERROR;
     }
 
@@ -193,12 +193,12 @@ OCStackResult RMPConstructRemovalPayload(uint32_t gatewayId, uint32_t seqNum,
         OCRepPayload *add = OCRepPayloadCreate();
         if(!add)
         {
-            OC_LOG(ERROR, TAG, "Failed to allocate Payload");
+            OIC_LOG(ERROR, TAG, "Failed to allocate Payload");
             return OC_STACK_ERROR;
         }
 
         add->base.type = PAYLOAD_TYPE_REPRESENTATION;
-        OC_LOG_V(DEBUG, TAG, "Removing the gateway entry: %u", entry->destination->gatewayId);
+        OIC_LOG_V(DEBUG, TAG, "Removing the gateway entry: %u", entry->destination->gatewayId);
         OCRepPayloadSetPropInt(add, GATEWAY, entry->destination->gatewayId);
         OCRepPayloadSetPropInt(add, ROUTE_COST, 0);
         arrayPayload[i] = add;
@@ -210,11 +210,11 @@ OCStackResult RMPConstructRemovalPayload(uint32_t gatewayId, uint32_t seqNum,
     bool res = OCRepPayloadSetPropObjectArray(*removedPayload, TABLE, arrayPayload, dimensions);
     if (!res)
     {
-        OC_LOG(ERROR, TAG, "Failed to Construct Removal Payload");
+        OIC_LOG(ERROR, TAG, "Failed to Construct Removal Payload");
         return OC_STACK_ERROR;
     }
 
-    OC_LOG(DEBUG, TAG, "RMPConstructRemovalPayload OUT");
+    OIC_LOG(DEBUG, TAG, "RMPConstructRemovalPayload OUT");
     return OC_STACK_OK;
 }
 
@@ -227,7 +227,7 @@ OCStackResult RMPParseRequestPayload(const uint8_t* payload, size_t payloadSize,
     OCStackResult res = RMPParseResponsePayload(repPayload, gatewayId, NULL, NULL, NULL);
     if (OC_STACK_OK != res)
     {
-        OC_LOG(DEBUG, TAG, "ParseResponsePayload failed");
+        OIC_LOG(DEBUG, TAG, "ParseResponsePayload failed");
     }
 
     return res;
@@ -237,7 +237,7 @@ OCStackResult RMPParseResponsePayload(const OCRepPayload *payload, uint32_t *gat
                                       uint32_t *seqNum, u_linklist_t **gatewayTable,
                                       bool *isUpdateSeqNeeded)
 {
-    OC_LOG(DEBUG, TAG, "RMPParsePayload IN");
+    OIC_LOG(DEBUG, TAG, "RMPParsePayload IN");
     RM_NULL_CHECK_WITH_RET(payload, TAG, "payload");
     RM_NULL_CHECK_WITH_RET(gatewayId, TAG, "gatewayId");
 
@@ -268,13 +268,13 @@ OCStackResult RMPParseResponsePayload(const OCRepPayload *payload, uint32_t *gat
     int len = length;
     if (0 == len)
     {
-        OC_LOG(DEBUG, TAG, "Parsed Gateway Payload");
+        OIC_LOG(DEBUG, TAG, "Parsed Gateway Payload");
         return OC_STACK_OK;
     }
 
     if (NULL == gatewayTable)
     {
-        OC_LOG(DEBUG, TAG, "gatewayTable is NULL");
+        OIC_LOG(DEBUG, TAG, "gatewayTable is NULL");
         return OC_STACK_OK;
     }
 
@@ -285,14 +285,14 @@ OCStackResult RMPParseResponsePayload(const OCRepPayload *payload, uint32_t *gat
 
     if (NULL == *responsePayload)
     {
-        OC_LOG(DEBUG, TAG, "RMPParsePayload OUT");
+        OIC_LOG(DEBUG, TAG, "RMPParsePayload OUT");
         return OC_STACK_OK;
     }
 
     *gatewayTable = u_linklist_create();
     if (NULL == *gatewayTable)
     {
-        OC_LOG(DEBUG, TAG, "Gateway table create failed");
+        OIC_LOG(DEBUG, TAG, "Gateway table create failed");
         return OC_STACK_ERROR;
     }
 
@@ -302,21 +302,21 @@ OCStackResult RMPParseResponsePayload(const OCRepPayload *payload, uint32_t *gat
 
         if (NULL == entry)
         {
-            OC_LOG(DEBUG, TAG, "RTMGatewayEntry_t Calloc failed");
+            OIC_LOG(DEBUG, TAG, "RTMGatewayEntry_t Calloc failed");
             return OC_STACK_ERROR;
         }
         // Filling new Entry
         entry->destination = (RTMGatewayId_t*)OICCalloc(1, sizeof(RTMGatewayId_t));
         if (NULL == entry->destination)
         {
-            OC_LOG(DEBUG, TAG, "Destination Calloc failed");
+            OIC_LOG(DEBUG, TAG, "Destination Calloc failed");
             OICFree(entry);
             return OC_STACK_ERROR;
         }
         entry->nextHop = (RTMGatewayId_t*)OICCalloc(1, sizeof(RTMGatewayId_t));
         if (NULL == entry->nextHop)
         {
-            OC_LOG(DEBUG, TAG, "nextHop Calloc failed");
+            OIC_LOG(DEBUG, TAG, "nextHop Calloc failed");
             OICFree(entry->destination);
             OICFree(entry);
             return OC_STACK_ERROR;
@@ -333,14 +333,14 @@ OCStackResult RMPParseResponsePayload(const OCRepPayload *payload, uint32_t *gat
         entry->routeCost = routeCost;
         u_linklist_add(*gatewayTable, (void *)entry);
     }
-    OC_LOG(DEBUG, TAG, "RMPParsePayload OUT");
+    OIC_LOG(DEBUG, TAG, "RMPParsePayload OUT");
     return OC_STACK_OK;
 }
 
 void RMPFreePayload(OCRepPayload *payload)
 {
-    OC_LOG(DEBUG, TAG, "RMPFreePayload IN");
+    OIC_LOG(DEBUG, TAG, "RMPFreePayload IN");
     RM_NULL_CHECK_VOID(payload, TAG, "payload");
     OCRepPayloadDestroy(payload);
-    OC_LOG(DEBUG, TAG, "RMPFreePayload OUT");
+    OIC_LOG(DEBUG, TAG, "RMPFreePayload OUT");
 }
index 7730d38..4eb8501 100644 (file)
@@ -46,7 +46,7 @@ static const uint64_t USECS_PER_SEC = 1000000;
 
 OCStackResult RTMInitialize(u_linklist_t **gatewayTable, u_linklist_t **endpointTable)
 {
-    OC_LOG(DEBUG, TAG, "RTMInitialize IN");
+    OIC_LOG(DEBUG, TAG, "RTMInitialize IN");
     RM_NULL_CHECK_WITH_RET(gatewayTable, TAG, "gatewayTable");
     RM_NULL_CHECK_WITH_RET(endpointTable, TAG, "endpointTable");
     if (NULL == *gatewayTable)
@@ -54,7 +54,7 @@ OCStackResult RTMInitialize(u_linklist_t **gatewayTable, u_linklist_t **endpoint
         *gatewayTable = u_linklist_create();
         if (NULL == *gatewayTable)
         {
-            OC_LOG(ERROR, TAG, "Creating Routing Table failed");
+            OIC_LOG(ERROR, TAG, "Creating Routing Table failed");
             RTMTerminate(gatewayTable, endpointTable);
             return OC_STACK_ERROR;
         }
@@ -65,12 +65,12 @@ OCStackResult RTMInitialize(u_linklist_t **gatewayTable, u_linklist_t **endpoint
         *endpointTable = u_linklist_create();
         if (NULL == *endpointTable)
         {
-           OC_LOG(ERROR, TAG, "Creating Routing Table failed");
+           OIC_LOG(ERROR, TAG, "Creating Routing Table failed");
             RTMTerminate(gatewayTable, endpointTable);
            return OC_STACK_ERROR;
         }
     }
-    OC_LOG(DEBUG, TAG, "RTMInitialize OUT");
+    OIC_LOG(DEBUG, TAG, "RTMInitialize OUT");
     return OC_STACK_OK;
 }
 
@@ -79,7 +79,7 @@ OCStackResult RTMInitialize(u_linklist_t **gatewayTable, u_linklist_t **endpoint
  */
 OCStackResult RTMFreeGatewayRouteTable(u_linklist_t **gatewayTable)
 {
-    OC_LOG(DEBUG, TAG, "RTMFreeGatewayRouteTable IN");
+    OIC_LOG(DEBUG, TAG, "RTMFreeGatewayRouteTable IN");
     if (NULL == gatewayTable || NULL == *gatewayTable)
     {
         return OC_STACK_OK;
@@ -109,12 +109,12 @@ OCStackResult RTMFreeGatewayRouteTable(u_linklist_t **gatewayTable)
         OCStackResult ret = u_linklist_remove(*gatewayTable, &iterTable);
         if (OC_STACK_OK != ret)
         {
-           OC_LOG(ERROR, TAG, "Deleting Entry from Routing Table failed");
+           OIC_LOG(ERROR, TAG, "Deleting Entry from Routing Table failed");
            return OC_STACK_ERROR;
         }
     }
     u_linklist_free(gatewayTable);
-    OC_LOG(DEBUG, TAG, "RTMFreeGatewayRouteTable OUT");
+    OIC_LOG(DEBUG, TAG, "RTMFreeGatewayRouteTable OUT");
     return OC_STACK_OK;
 }
 
@@ -123,7 +123,7 @@ OCStackResult RTMFreeGatewayRouteTable(u_linklist_t **gatewayTable)
  */
 OCStackResult RTMFreeEndpointRouteTable(u_linklist_t **endpointTable)
 {
-    OC_LOG(DEBUG, TAG, "IN");
+    OIC_LOG(DEBUG, TAG, "IN");
     if (NULL == endpointTable || NULL == *endpointTable)
     {
         return OC_STACK_OK;
@@ -142,18 +142,18 @@ OCStackResult RTMFreeEndpointRouteTable(u_linklist_t **endpointTable)
         OCStackResult ret = u_linklist_remove(*endpointTable, &iterTable);
         if (OC_STACK_OK != ret)
         {
-            OC_LOG(ERROR, TAG, "Deleting Entry from Routing Table failed");
+            OIC_LOG(ERROR, TAG, "Deleting Entry from Routing Table failed");
             return OC_STACK_ERROR;
         }
     }
     u_linklist_free(endpointTable);
-    OC_LOG(DEBUG, TAG, "OUT");
+    OIC_LOG(DEBUG, TAG, "OUT");
     return OC_STACK_OK;
 }
 
 OCStackResult RTMFreeGatewayIdList(u_linklist_t **gatewayIdTable)
 {
-    OC_LOG(DEBUG, TAG, "IN");
+    OIC_LOG(DEBUG, TAG, "IN");
     if (NULL == gatewayIdTable || NULL == *gatewayIdTable)
     {
         return OC_STACK_OK;
@@ -177,7 +177,7 @@ OCStackResult RTMFreeGatewayIdList(u_linklist_t **gatewayIdTable)
             OCStackResult ret = u_linklist_remove(*gatewayIdTable, &iterTable);
             if (OC_STACK_OK != ret)
             {
-               OC_LOG(ERROR, TAG, "Deleting Entry from Routing Table failed");
+               OIC_LOG(ERROR, TAG, "Deleting Entry from Routing Table failed");
                return OC_STACK_ERROR;
             }
         }
@@ -186,12 +186,12 @@ OCStackResult RTMFreeGatewayIdList(u_linklist_t **gatewayIdTable)
             OCStackResult res = u_linklist_remove(*gatewayIdTable, &iterTable);
             if (OC_STACK_OK != res)
             {
-                OC_LOG(ERROR, TAG, "Deleting Entry from Routing Table failed");
+                OIC_LOG(ERROR, TAG, "Deleting Entry from Routing Table failed");
                 return OC_STACK_ERROR;
             }
         }
     }
-    OC_LOG(DEBUG, TAG, "OUT");
+    OIC_LOG(DEBUG, TAG, "OUT");
     return OC_STACK_OK;
 }
 
@@ -200,12 +200,12 @@ OCStackResult RTMFreeGatewayIdList(u_linklist_t **gatewayIdTable)
  */
 OCStackResult RTMTerminate(u_linklist_t **gatewayTable, u_linklist_t **endpointTable)
 {
-    OC_LOG(DEBUG, TAG, "IN");
+    OIC_LOG(DEBUG, TAG, "IN");
 
     OCStackResult ret = RTMFreeGatewayRouteTable(gatewayTable);
     if (OC_STACK_OK != ret)
     {
-        OC_LOG(ERROR, TAG, "Deleting Gateway Routing Table failed");
+        OIC_LOG(ERROR, TAG, "Deleting Gateway Routing Table failed");
     }
     if (NULL != *gatewayTable)
     {
@@ -215,13 +215,13 @@ OCStackResult RTMTerminate(u_linklist_t **gatewayTable, u_linklist_t **endpointT
     ret = RTMFreeEndpointRouteTable(endpointTable);
     if (OC_STACK_OK != ret)
     {
-        OC_LOG(ERROR, TAG, "Deleting Endpoint Routing Table failed");
+        OIC_LOG(ERROR, TAG, "Deleting Endpoint Routing Table failed");
     }
     if (NULL != *endpointTable)
     {
         *endpointTable = NULL;
     }
-    OC_LOG(DEBUG, TAG, "OUT");
+    OIC_LOG(DEBUG, TAG, "OUT");
     return OC_STACK_OK;
 }
 
@@ -235,27 +235,27 @@ OCStackResult RTMTerminate(u_linklist_t **gatewayTable, u_linklist_t **endpointT
 OCStackResult RTMAddGatewayEntry(uint32_t gatewayId, uint32_t nextHop, uint32_t routeCost,
                                  const RTMDestIntfInfo_t *destInterfaces, u_linklist_t **gatewayTable)
 {
-    OC_LOG(DEBUG, TAG, "IN");
+    OIC_LOG(DEBUG, TAG, "IN");
     RM_NULL_CHECK_WITH_RET(gatewayTable, TAG, "gatewayTable");
     if (NULL == *gatewayTable)
     {
         *gatewayTable = u_linklist_create();
         if (NULL == *gatewayTable)
         {
-            OC_LOG(ERROR, TAG, "u_linklist_create failed");
+            OIC_LOG(ERROR, TAG, "u_linklist_create failed");
             return OC_STACK_NO_MEMORY;
         }
     }
 
     if (1 == routeCost && 0 != nextHop)
     {
-        OC_LOG(ERROR, TAG, "Adding Gateway Failed as Next Hop should be 0 for route cost 1");
+        OIC_LOG(ERROR, TAG, "Adding Gateway Failed as Next Hop should be 0 for route cost 1");
         return OC_STACK_ERROR;
     }
 
     if (0 == routeCost)
     {
-        OC_LOG(ERROR, TAG, "Adding Gateway Failed as Route cost shouldnot be less than 1");
+        OIC_LOG(ERROR, TAG, "Adding Gateway Failed as Route cost shouldnot be less than 1");
         return OC_STACK_ERROR;
     }
 
@@ -297,7 +297,7 @@ OCStackResult RTMAddGatewayEntry(uint32_t gatewayId, uint32_t nextHop, uint32_t
 
     if (1 < routeCost && NULL == gatewayNodeMap)
     {
-        OC_LOG(ERROR, TAG, "Adding Gateway Failed as Next Hop is invalid");
+        OIC_LOG(ERROR, TAG, "Adding Gateway Failed as Next Hop is invalid");
         return OC_STACK_ERROR;
     }
 
@@ -310,14 +310,14 @@ OCStackResult RTMAddGatewayEntry(uint32_t gatewayId, uint32_t nextHop, uint32_t
         {
             if (NULL == destInterfaces)
             {
-                OC_LOG(ERROR, TAG, "Not Adding Gateway destInterfaces is NULL");
+                OIC_LOG(ERROR, TAG, "Not Adding Gateway destInterfaces is NULL");
                 return OC_STACK_ERROR;
             }
             OCStackResult update = RTMUpdateDestinationIntfAdr(gatewayId, *destInterfaces, true,
                                                                gatewayTable);
             if (OC_STACK_OK != update)
             {
-                OC_LOG(ERROR, TAG, "RTMUpdateDestinationIntfAdr failed");
+                OIC_LOG(ERROR, TAG, "RTMUpdateDestinationIntfAdr failed");
             }
             return update;
         }
@@ -326,7 +326,7 @@ OCStackResult RTMAddGatewayEntry(uint32_t gatewayId, uint32_t nextHop, uint32_t
             if (entry->routeCost == routeCost && NULL != entry->nextHop &&
                 (nextHop == entry->nextHop->gatewayId))
             {
-                OC_LOG(ERROR, TAG, "Not Adding Gateway As it is Duplicate request");
+                OIC_LOG(ERROR, TAG, "Not Adding Gateway As it is Duplicate request");
                 return OC_STACK_DUPLICATE_REQUEST;
             }
 
@@ -342,12 +342,12 @@ OCStackResult RTMAddGatewayEntry(uint32_t gatewayId, uint32_t nextHop, uint32_t
             {
                 entry->routeCost = 1;
                 // Entry can't be updated if Next hop is not same as existing Destinations of Table.
-                OC_LOG(DEBUG, TAG, "Updating the gateway");
+                OIC_LOG(DEBUG, TAG, "Updating the gateway");
                 entry->nextHop = NULL;
                 entry->destination->destIntfAddr = u_arraylist_create();
                 if (NULL == entry->destination->destIntfAddr)
                 {
-                    OC_LOG(ERROR, TAG, "Failed to create array list");
+                    OIC_LOG(ERROR, TAG, "Failed to create array list");
                     return OC_STACK_ERROR;
                 }
 
@@ -355,7 +355,7 @@ OCStackResult RTMAddGatewayEntry(uint32_t gatewayId, uint32_t nextHop, uint32_t
                     (RTMDestIntfInfo_t *) OICCalloc(1, sizeof(RTMDestIntfInfo_t));
                 if (NULL == destAdr)
                 {
-                    OC_LOG(ERROR, TAG, "Failed to Calloc destAdr");
+                    OIC_LOG(ERROR, TAG, "Failed to Calloc destAdr");
                     return OC_STACK_ERROR;
                 }
 
@@ -366,21 +366,21 @@ OCStackResult RTMAddGatewayEntry(uint32_t gatewayId, uint32_t nextHop, uint32_t
                     u_arraylist_add(entry->destination->destIntfAddr, (void *)destAdr);
                 if (!result)
                 {
-                    OC_LOG(ERROR, TAG, "Adding node to head failed");
+                    OIC_LOG(ERROR, TAG, "Adding node to head failed");
                     OICFree(destAdr);
                     return OC_STACK_ERROR;
                 }
             }
             else
             {
-                OC_LOG(ERROR, TAG, "Adding Gateway Failed as Next hop is invalid");
+                OIC_LOG(ERROR, TAG, "Adding Gateway Failed as Next hop is invalid");
                 return OC_STACK_ERROR;
             }
 
         }
         else if (NULL != entry  && entry->routeCost < routeCost)
         {
-            OC_LOG(ERROR, TAG, "Adding Gateway Failed as Route cost is more than old");
+            OIC_LOG(ERROR, TAG, "Adding Gateway Failed as Route cost is more than old");
             return OC_STACK_ERROR;
         }
 
@@ -390,14 +390,14 @@ OCStackResult RTMAddGatewayEntry(uint32_t gatewayId, uint32_t nextHop, uint32_t
             OCStackResult res = u_linklist_remove(*gatewayTable, &destNode);
             if (OC_STACK_OK != res)
             {
-                OC_LOG(ERROR, TAG, "Removing node failed");
+                OIC_LOG(ERROR, TAG, "Removing node failed");
             }
             else
             {
                 res = u_linklist_add_head(*gatewayTable, (void *)entry);
                 if (OC_STACK_OK != res)
                 {
-                    OC_LOG(ERROR, TAG, "Adding node to head failed");
+                    OIC_LOG(ERROR, TAG, "Adding node to head failed");
                 }
             }
         }
@@ -408,14 +408,14 @@ OCStackResult RTMAddGatewayEntry(uint32_t gatewayId, uint32_t nextHop, uint32_t
         RTMGatewayEntry_t *hopEntry = (RTMGatewayEntry_t *)OICCalloc(1, sizeof(RTMGatewayEntry_t));
         if (NULL == hopEntry)
         {
-            OC_LOG(ERROR, TAG, "Calloc failed for hop entry");
+            OIC_LOG(ERROR, TAG, "Calloc failed for hop entry");
             return OC_STACK_ERROR;
         }
 
         hopEntry->destination = (RTMGatewayId_t*)OICCalloc(1, sizeof(RTMGatewayId_t));
         if (NULL == hopEntry->destination)
         {
-            OC_LOG(ERROR, TAG, "Calloc failed for hop entry destination");
+            OIC_LOG(ERROR, TAG, "Calloc failed for hop entry destination");
             OICFree(hopEntry);
             return OC_STACK_ERROR;
         }
@@ -428,7 +428,7 @@ OCStackResult RTMAddGatewayEntry(uint32_t gatewayId, uint32_t nextHop, uint32_t
                 (RTMDestIntfInfo_t *) OICCalloc(1, sizeof(RTMDestIntfInfo_t));
             if (NULL == destAdr)
             {
-                OC_LOG(ERROR, TAG, "Calloc failed for destAdr");
+                OIC_LOG(ERROR, TAG, "Calloc failed for destAdr");
                 u_arraylist_free(&(hopEntry->destination->destIntfAddr));
                 OICFree(hopEntry->destination);
                 OICFree(hopEntry);
@@ -457,7 +457,7 @@ OCStackResult RTMAddGatewayEntry(uint32_t gatewayId, uint32_t nextHop, uint32_t
         }
         else
         {
-            OC_LOG(ERROR, TAG, "Adding Gateway Failed as Next Hop is invalid");
+            OIC_LOG(ERROR, TAG, "Adding Gateway Failed as Next Hop is invalid");
             while (u_arraylist_length(hopEntry->destination->destIntfAddr) > 0)
             {
                 RTMDestIntfInfo_t *data =
@@ -483,7 +483,7 @@ OCStackResult RTMAddGatewayEntry(uint32_t gatewayId, uint32_t nextHop, uint32_t
 
         if (OC_STACK_OK != ret)
         {
-            OC_LOG(ERROR, TAG, "Adding Gateway Entry to Routing Table failed");
+            OIC_LOG(ERROR, TAG, "Adding Gateway Entry to Routing Table failed");
             while (u_arraylist_length(hopEntry->destination->destIntfAddr) > 0)
             {
                 RTMDestIntfInfo_t *data = u_arraylist_remove(hopEntry->destination->destIntfAddr, 0);
@@ -495,14 +495,14 @@ OCStackResult RTMAddGatewayEntry(uint32_t gatewayId, uint32_t nextHop, uint32_t
             return OC_STACK_ERROR;
         }
     }
-    OC_LOG(DEBUG, TAG, "OUT");
+    OIC_LOG(DEBUG, TAG, "OUT");
     return OC_STACK_OK;
 }
 
 OCStackResult RTMAddEndpointEntry(uint16_t *endpointId, const CAEndpoint_t *destAddr,
                                   u_linklist_t **endpointTable)
 {
-    OC_LOG(DEBUG, TAG, "IN");
+    OIC_LOG(DEBUG, TAG, "IN");
     RM_NULL_CHECK_WITH_RET(endpointId, TAG, "endpointId");
     RM_NULL_CHECK_WITH_RET(destAddr, TAG, "destAddr");
     RM_NULL_CHECK_WITH_RET(endpointTable, TAG, "endpointTable");
@@ -511,7 +511,7 @@ OCStackResult RTMAddEndpointEntry(uint16_t *endpointId, const CAEndpoint_t *dest
         *endpointTable = u_linklist_create();
         if (NULL == *endpointTable)
         {
-            OC_LOG(ERROR, TAG, "u_linklist_create failed");
+            OIC_LOG(ERROR, TAG, "u_linklist_create failed");
             return OC_STACK_NO_MEMORY;
         }
     }
@@ -529,7 +529,7 @@ OCStackResult RTMAddEndpointEntry(uint16_t *endpointId, const CAEndpoint_t *dest
             && destAddr->port == entry->destIntfAddr.port)
         {
             *endpointId = entry->endpointId;
-            OC_LOG(ERROR, TAG, "Adding failed as Enpoint Entry Already present in Table");
+            OIC_LOG(ERROR, TAG, "Adding failed as Enpoint Entry Already present in Table");
             return OC_STACK_DUPLICATE_REQUEST;
         }
         u_linklist_get_next(&iterTable);
@@ -540,7 +540,7 @@ OCStackResult RTMAddEndpointEntry(uint16_t *endpointId, const CAEndpoint_t *dest
 
     if (NULL == hopEntry)
     {
-       OC_LOG(ERROR, TAG, "Malloc failed for hop entry");
+       OIC_LOG(ERROR, TAG, "Malloc failed for hop entry");
        return OC_STACK_ERROR;
     }
 
@@ -550,17 +550,17 @@ OCStackResult RTMAddEndpointEntry(uint16_t *endpointId, const CAEndpoint_t *dest
     OCStackResult ret = u_linklist_add(*endpointTable, (void *)hopEntry);
     if (OC_STACK_OK != ret)
     {
-       OC_LOG(ERROR, TAG, "Adding Enpoint Entry to Routing Table failed");
+       OIC_LOG(ERROR, TAG, "Adding Enpoint Entry to Routing Table failed");
        OICFree(hopEntry);
        return OC_STACK_ERROR;
     }
-    OC_LOG(DEBUG, TAG, "OUT");
+    OIC_LOG(DEBUG, TAG, "OUT");
     return OC_STACK_OK;
 }
 
 OCStackResult RTMAddObserver(uint32_t obsID, CAEndpoint_t devAddr, u_linklist_t **gatewayTable)
 {
-    OC_LOG(DEBUG, TAG, "IN");
+    OIC_LOG(DEBUG, TAG, "IN");
     RM_NULL_CHECK_WITH_RET(gatewayTable, TAG, "gatewayTable");
     RM_NULL_CHECK_WITH_RET(*gatewayTable, TAG, "*gatewayTable");
 
@@ -578,29 +578,29 @@ OCStackResult RTMAddObserver(uint32_t obsID, CAEndpoint_t devAddr, u_linklist_t
                 && devAddr.port == destCheck->destIntfAddr.port)
             {
                 destCheck->observerId = obsID;
-                OC_LOG(DEBUG, TAG, "OUT");
+                OIC_LOG(DEBUG, TAG, "OUT");
                 return OC_STACK_OK;
             }
         }
         u_linklist_get_next(&iterTable);
     }
-    OC_LOG(DEBUG, TAG, "OUT");
+    OIC_LOG(DEBUG, TAG, "OUT");
     return OC_STACK_ERROR;
 }
 
 bool RTMIsObserverPresent(CAEndpoint_t devAddr, OCObservationId *obsID,
                           const u_linklist_t *gatewayTable)
 {
-    OC_LOG(DEBUG, TAG, "IN");
+    OIC_LOG(DEBUG, TAG, "IN");
     if (NULL == obsID)
     {
-        OC_LOG(ERROR, TAG, "obsID is null");
+        OIC_LOG(ERROR, TAG, "obsID is null");
         return false;
     }
 
     if (NULL == gatewayTable)
     {
-        OC_LOG(ERROR, TAG, "gatewayTable is null");
+        OIC_LOG(ERROR, TAG, "gatewayTable is null");
         return false;
     }
 
@@ -611,7 +611,7 @@ bool RTMIsObserverPresent(CAEndpoint_t devAddr, OCObservationId *obsID,
         RTMGatewayEntry_t *entry = u_linklist_get_data(iterTable);
         if (NULL == entry || NULL == entry->destination)
         {
-            OC_LOG(ERROR, TAG, "entry is NULL");
+            OIC_LOG(ERROR, TAG, "entry is NULL");
             return false;
         }
         for (uint32_t i = 0; i < u_arraylist_length(entry->destination->destIntfAddr); i++)
@@ -623,20 +623,20 @@ bool RTMIsObserverPresent(CAEndpoint_t devAddr, OCObservationId *obsID,
                 && devAddr.port == destCheck->destIntfAddr.port && 0 != destCheck->observerId)
             {
                 *obsID = destCheck->observerId;
-                OC_LOG(DEBUG, TAG, "OUT");
+                OIC_LOG(DEBUG, TAG, "OUT");
                 return true;
             }
         }
         u_linklist_get_next(&iterTable);
     }
-    OC_LOG(DEBUG, TAG, "OUT");
+    OIC_LOG(DEBUG, TAG, "OUT");
     return false;
 }
 
 OCStackResult RTMRemoveGatewayEntry(uint32_t gatewayId, u_linklist_t **removedGatewayNodes,
                                     u_linklist_t **gatewayTable)
 {
-    OC_LOG(DEBUG, TAG, "IN");
+    OIC_LOG(DEBUG, TAG, "IN");
     RM_NULL_CHECK_WITH_RET(gatewayTable, TAG, "gatewayTable");
     RM_NULL_CHECK_WITH_RET(*gatewayTable, TAG, "*gatewayTable");
 
@@ -648,7 +648,7 @@ OCStackResult RTMRemoveGatewayEntry(uint32_t gatewayId, u_linklist_t **removedGa
         *removedGatewayNodes = u_linklist_create();
         if (NULL == *removedGatewayNodes)
         {
-            OC_LOG(ERROR, TAG, "u_linklist_create failed");
+            OIC_LOG(ERROR, TAG, "u_linklist_create failed");
             return OC_STACK_NO_MEMORY;
         }
     }
@@ -666,11 +666,11 @@ OCStackResult RTMRemoveGatewayEntry(uint32_t gatewayId, u_linklist_t **removedGa
         if (gatewayId == entry->destination->gatewayId || (NULL != entry->nextHop &&
             (gatewayId == entry->nextHop->gatewayId)))
         {
-            OC_LOG_V(DEBUG, TAG, "Removing the gateway entry: %u", entry->destination->gatewayId);
+            OIC_LOG_V(DEBUG, TAG, "Removing the gateway entry: %u", entry->destination->gatewayId);
             ret = u_linklist_remove(*gatewayTable, &iterTable);
             if (OC_STACK_OK != ret)
             {
-               OC_LOG(ERROR, TAG, "Deleting Entry from Routing Table failed");
+               OIC_LOG(ERROR, TAG, "Deleting Entry from Routing Table failed");
                return OC_STACK_ERROR;
             }
             else
@@ -683,7 +683,7 @@ OCStackResult RTMRemoveGatewayEntry(uint32_t gatewayId, u_linklist_t **removedGa
             u_linklist_get_next(&iterTable);
         }
     }
-    OC_LOG(DEBUG, TAG, "RTMRemoveGatewayEntry OUT");
+    OIC_LOG(DEBUG, TAG, "RTMRemoveGatewayEntry OUT");
     return OC_STACK_OK;
 }
 
@@ -691,7 +691,7 @@ OCStackResult RTMRemoveGatewayDestEntry(uint32_t gatewayId, uint32_t nextHop,
                                         const RTMDestIntfInfo_t *destInfAdr,
                                         RTMGatewayEntry_t **existEntry, u_linklist_t **gatewayTable)
 {
-    OC_LOG(DEBUG, TAG, "IN");
+    OIC_LOG(DEBUG, TAG, "IN");
     RM_NULL_CHECK_WITH_RET(gatewayTable, TAG, "gatewayTable");
     RM_NULL_CHECK_WITH_RET(*gatewayTable, TAG, "*gatewayTable");
     RM_NULL_CHECK_WITH_RET(destInfAdr, TAG, "destInfAdr");
@@ -732,13 +732,13 @@ OCStackResult RTMRemoveGatewayDestEntry(uint32_t gatewayId, uint32_t nextHop,
         // Remove node with given gatewayid and nextHop if not found update exist entry.
         if (NULL != entry->destination && (gatewayId == entry->destination->gatewayId))
         {
-            OC_LOG_V(INFO, TAG, "Remove the gateway ID: %u", entry->destination->gatewayId);
+            OIC_LOG_V(INFO, TAG, "Remove the gateway ID: %u", entry->destination->gatewayId);
             if (NULL != entry->nextHop && nextHop == entry->nextHop->gatewayId)
             {
                 ret = u_linklist_remove(*gatewayTable, &iterTable);
                 if (OC_STACK_OK != ret)
                 {
-                   OC_LOG(ERROR, TAG, "Deleting Entry from Routing Table failed");
+                   OIC_LOG(ERROR, TAG, "Deleting Entry from Routing Table failed");
                    return OC_STACK_ERROR;
                 }
                 OICFree(entry);
@@ -746,19 +746,19 @@ OCStackResult RTMRemoveGatewayDestEntry(uint32_t gatewayId, uint32_t nextHop,
             }
 
             *existEntry = entry;
-            OC_LOG(DEBUG, TAG, "OUT");
+            OIC_LOG(DEBUG, TAG, "OUT");
             return OC_STACK_ERROR;
         }
 
         u_linklist_get_next(&iterTable);
     }
-    OC_LOG(DEBUG, TAG, "OUT");
+    OIC_LOG(DEBUG, TAG, "OUT");
     return OC_STACK_ERROR;
 }
 
 OCStackResult RTMRemoveEndpointEntry(uint16_t endpointId, u_linklist_t **endpointTable)
 {
-    OC_LOG(DEBUG, TAG, "IN");
+    OIC_LOG(DEBUG, TAG, "IN");
     RM_NULL_CHECK_WITH_RET(endpointTable, TAG, "endpointTable");
     RM_NULL_CHECK_WITH_RET(*endpointTable, TAG, "*endpointTable");
 
@@ -772,7 +772,7 @@ OCStackResult RTMRemoveEndpointEntry(uint16_t endpointId, u_linklist_t **endpoin
             OCStackResult ret = u_linklist_remove(*endpointTable, &iterTable);
             if (OC_STACK_OK != ret)
             {
-               OC_LOG(ERROR, TAG, "Deleting Entry from Routing Table failed");
+               OIC_LOG(ERROR, TAG, "Deleting Entry from Routing Table failed");
                return OC_STACK_ERROR;
             }
             OICFree(entry);
@@ -782,52 +782,52 @@ OCStackResult RTMRemoveEndpointEntry(uint16_t endpointId, u_linklist_t **endpoin
             u_linklist_get_next(&iterTable);
         }
     }
-    OC_LOG(DEBUG, TAG, "OUT");
+    OIC_LOG(DEBUG, TAG, "OUT");
     return OC_STACK_OK;
 }
 
 OCStackResult RTMRemoveGateways(u_linklist_t **gatewayTable)
 {
-    OC_LOG(DEBUG, TAG, "IN");
+    OIC_LOG(DEBUG, TAG, "IN");
 
     if (NULL == gatewayTable || NULL == *gatewayTable)
     {
-        OC_LOG(DEBUG, TAG, "OUT");
+        OIC_LOG(DEBUG, TAG, "OUT");
         return OC_STACK_OK;
     }
 
     OCStackResult ret = RTMFreeGatewayRouteTable(gatewayTable);
     if (OC_STACK_OK != ret)
     {
-        OC_LOG(ERROR, TAG, "Removing Gateways failed");
+        OIC_LOG(ERROR, TAG, "Removing Gateways failed");
         return ret;
     }
-    OC_LOG(DEBUG, TAG, "OUT");
+    OIC_LOG(DEBUG, TAG, "OUT");
     return OC_STACK_OK;
 }
 
 OCStackResult RTMRemoveEndpoints(u_linklist_t **endpointTable)
 {
-    OC_LOG(DEBUG, TAG, "IN");
+    OIC_LOG(DEBUG, TAG, "IN");
     if (NULL == endpointTable || NULL == *endpointTable)
     {
-        OC_LOG(DEBUG, TAG, "OUT");
+        OIC_LOG(DEBUG, TAG, "OUT");
         return OC_STACK_OK;
     }
 
     OCStackResult ret = RTMFreeEndpointRouteTable(endpointTable);
     if (OC_STACK_OK != ret)
     {
-        OC_LOG(ERROR, TAG, "Freeing Endpoints failed");
+        OIC_LOG(ERROR, TAG, "Freeing Endpoints failed");
         return OC_STACK_ERROR;
     }
-    OC_LOG(DEBUG, TAG, "OUT");
+    OIC_LOG(DEBUG, TAG, "OUT");
     return OC_STACK_OK;
 }
 
 void RTMFreeGateway(RTMGatewayId_t *gateway, u_linklist_t **gatewayTable)
 {
-    OC_LOG(DEBUG, TAG, "IN");
+    OIC_LOG(DEBUG, TAG, "IN");
     RM_NULL_CHECK_VOID(gateway, TAG, "gateway");
     RM_NULL_CHECK_VOID(gatewayTable, TAG, "gatewayTable");
     RM_NULL_CHECK_VOID(*gatewayTable, TAG, "*gatewayTable");
@@ -838,19 +838,19 @@ void RTMFreeGateway(RTMGatewayId_t *gateway, u_linklist_t **gatewayTable)
     }
     u_arraylist_free(&(gateway->destIntfAddr));
     OICFree(gateway);
-    OC_LOG(DEBUG, TAG, "OUT");
+    OIC_LOG(DEBUG, TAG, "OUT");
 }
 
 void RTMGetNeighbours(u_linklist_t **neighbourNodes, const u_linklist_t *gatewayTable)
 {
-    OC_LOG(DEBUG, TAG, "IN");
+    OIC_LOG(DEBUG, TAG, "IN");
     RM_NULL_CHECK_VOID(neighbourNodes, TAG, "neighbourNodes");
     RM_NULL_CHECK_VOID(gatewayTable, TAG, "gatewayTable");
 
     *neighbourNodes = u_linklist_create();
     if (NULL == *neighbourNodes)
     {
-        OC_LOG(ERROR, TAG, "u_linklist_create failed");
+        OIC_LOG(ERROR, TAG, "u_linklist_create failed");
         return;
     }
     u_linklist_iterator_t *iterTable = NULL;
@@ -864,27 +864,27 @@ void RTMGetNeighbours(u_linklist_t **neighbourNodes, const u_linklist_t *gateway
         }
         else if (NULL != entry && 1 < entry->routeCost)
         {
-            OC_LOG(DEBUG, TAG, "OUT");
+            OIC_LOG(DEBUG, TAG, "OUT");
             return;
         }
 
         u_linklist_get_next(&iterTable);
     }
-    OC_LOG(DEBUG, TAG, "OUT");
+    OIC_LOG(DEBUG, TAG, "OUT");
 }
 
 RTMGatewayId_t *RTMGetNextHop(uint32_t gatewayId, const u_linklist_t *gatewayTable)
 {
-    OC_LOG(DEBUG, TAG, "IN");
+    OIC_LOG(DEBUG, TAG, "IN");
     if (0 == gatewayId)
     {
-        OC_LOG(ERROR, TAG, "gatewayId is invalid");
+        OIC_LOG(ERROR, TAG, "gatewayId is invalid");
         return NULL;
     }
 
     if (NULL == gatewayTable)
     {
-        OC_LOG(ERROR, TAG, "gatewayTable is null");
+        OIC_LOG(ERROR, TAG, "gatewayTable is null");
         return NULL;
     }
 
@@ -897,24 +897,24 @@ RTMGatewayId_t *RTMGetNextHop(uint32_t gatewayId, const u_linklist_t *gatewayTab
         {
             if (1 == entry->routeCost)
             {
-                OC_LOG(DEBUG, TAG, "OUT");
+                OIC_LOG(DEBUG, TAG, "OUT");
                 return entry->destination;
             }
-            OC_LOG(DEBUG, TAG, "OUT");
+            OIC_LOG(DEBUG, TAG, "OUT");
             return entry->nextHop;
         }
         u_linklist_get_next(&iterTable);
     }
-    OC_LOG(DEBUG, TAG, "OUT");
+    OIC_LOG(DEBUG, TAG, "OUT");
     return NULL;
 }
 
 CAEndpoint_t *RTMGetEndpointEntry(uint16_t endpointId, const u_linklist_t *endpointTable)
 {
-    OC_LOG(DEBUG, TAG, "IN");
+    OIC_LOG(DEBUG, TAG, "IN");
     if (NULL == endpointTable)
     {
-        OC_LOG(ERROR, TAG, "endpointTable is null");
+        OIC_LOG(ERROR, TAG, "endpointTable is null");
         return NULL;
     }
 
@@ -926,26 +926,26 @@ CAEndpoint_t *RTMGetEndpointEntry(uint16_t endpointId, const u_linklist_t *endpo
         RTMEndpointEntry_t *entry = u_linklist_get_data(iterTable);
         if (NULL != entry && (endpointId == entry->endpointId))
         {
-            OC_LOG(DEBUG, TAG, "OUT");
+            OIC_LOG(DEBUG, TAG, "OUT");
             return &(entry->destIntfAddr);
         }
         u_linklist_get_next(&iterTable);
     }
-    OC_LOG(DEBUG, TAG, "OUT");
+    OIC_LOG(DEBUG, TAG, "OUT");
     return NULL;
 }
 
 void RTMGetObserverList(OCObservationId **obsList, uint8_t *obsListLen,
                         const u_linklist_t *gatewayTable)
 {
-    OC_LOG(DEBUG, TAG, "IN");
+    OIC_LOG(DEBUG, TAG, "IN");
     RM_NULL_CHECK_VOID(gatewayTable, TAG, "gatewayTable");
     RM_NULL_CHECK_VOID(obsList, TAG, "obsList");
 
     *obsList = (OCObservationId *) OICCalloc(MAX_OBSERVER_LIST_LENGTH, sizeof(OCObservationId));
     if (!(*obsList))
     {
-        OC_LOG(ERROR, TAG, "out of memory");
+        OIC_LOG(ERROR, TAG, "out of memory");
         return;
     }
 
@@ -960,12 +960,12 @@ void RTMGetObserverList(OCObservationId **obsList, uint8_t *obsListLen,
             RTMDestIntfInfo_t *destCheck = u_arraylist_get(entry->destination->destIntfAddr, 0);
             if (NULL == destCheck)
             {
-                OC_LOG(ERROR, TAG, "destCheck is null");
+                OIC_LOG(ERROR, TAG, "destCheck is null");
                 return;
             }
             if (0 != destCheck->observerId)
             {
-                OC_LOG_V(DEBUG, TAG, "Observer ID is %d", destCheck->observerId);
+                OIC_LOG_V(DEBUG, TAG, "Observer ID is %d", destCheck->observerId);
                 *(*obsList + len) = destCheck->observerId;
                 len++;
             }
@@ -979,13 +979,13 @@ void RTMGetObserverList(OCObservationId **obsList, uint8_t *obsListLen,
     }
 
     *obsListLen = len;
-    OC_LOG(DEBUG, TAG, "OUT");
+    OIC_LOG(DEBUG, TAG, "OUT");
 }
 
 OCStackResult RTMUpdateDestinationIntfAdr(uint32_t gatewayId, RTMDestIntfInfo_t destInterfaces,
                                           bool addAdr, u_linklist_t **gatewayTable)
 {
-    OC_LOG(DEBUG, TAG, "IN");
+    OIC_LOG(DEBUG, TAG, "IN");
     RM_NULL_CHECK_WITH_RET(gatewayTable, TAG, "gatewayTable");
     RM_NULL_CHECK_WITH_RET(*gatewayTable, TAG, "*gatewayTable");
 
@@ -1005,7 +1005,7 @@ OCStackResult RTMUpdateDestinationIntfAdr(uint32_t gatewayId, RTMDestIntfInfo_t
                         u_arraylist_get(entry->destination->destIntfAddr, i);
                     if (NULL == destCheck)
                     {
-                        OC_LOG(ERROR, TAG, "Destination adr get failed");
+                        OIC_LOG(ERROR, TAG, "Destination adr get failed");
                         continue;
                     }
 
@@ -1015,7 +1015,7 @@ OCStackResult RTMUpdateDestinationIntfAdr(uint32_t gatewayId, RTMDestIntfInfo_t
                     {
                         destCheck->timeElapsed = RTMGetCurrentTime();
                         destCheck->isValid = true;
-                        OC_LOG(ERROR, TAG, "destInterfaces already present");
+                        OIC_LOG(ERROR, TAG, "destInterfaces already present");
                         return OC_STACK_ERROR;
                     }
                 }
@@ -1024,7 +1024,7 @@ OCStackResult RTMUpdateDestinationIntfAdr(uint32_t gatewayId, RTMDestIntfInfo_t
                         (RTMDestIntfInfo_t *) OICCalloc(1, sizeof(RTMDestIntfInfo_t));
                 if (NULL == destAdr)
                 {
-                    OC_LOG(ERROR, TAG, "Calloc destAdr failed");
+                    OIC_LOG(ERROR, TAG, "Calloc destAdr failed");
                     return OC_STACK_ERROR;
                 }
                 *destAdr = destInterfaces;
@@ -1034,11 +1034,11 @@ OCStackResult RTMUpdateDestinationIntfAdr(uint32_t gatewayId, RTMDestIntfInfo_t
                     u_arraylist_add(entry->destination->destIntfAddr, (void *)destAdr);
                 if (!result)
                 {
-                    OC_LOG(ERROR, TAG, "Updating Destinterface address failed");
+                    OIC_LOG(ERROR, TAG, "Updating Destinterface address failed");
                     OICFree(destAdr);
                     return OC_STACK_ERROR;
                 }
-                OC_LOG(DEBUG, TAG, "OUT");
+                OIC_LOG(DEBUG, TAG, "OUT");
                 return OC_STACK_DUPLICATE_REQUEST;
             }
 
@@ -1063,14 +1063,14 @@ OCStackResult RTMUpdateDestinationIntfAdr(uint32_t gatewayId, RTMDestIntfInfo_t
         }
         u_linklist_get_next(&iterTable);
     }
-    OC_LOG(DEBUG, TAG, "OUT");
+    OIC_LOG(DEBUG, TAG, "OUT");
     return OC_STACK_OK;
 }
 
 OCStackResult RTMUpdateMcastSeqNumber(uint32_t gatewayId, uint16_t seqNum,
                                       u_linklist_t **gatewayTable)
 {
-    OC_LOG(DEBUG, TAG, "IN");
+    OIC_LOG(DEBUG, TAG, "IN");
     RM_NULL_CHECK_WITH_RET(gatewayTable, TAG, "gatewayTable");
     RM_NULL_CHECK_WITH_RET(*gatewayTable, TAG, "*gatewayTable");
 
@@ -1098,7 +1098,7 @@ OCStackResult RTMUpdateMcastSeqNumber(uint32_t gatewayId, uint16_t seqNum,
         }
         u_linklist_get_next(&iterTable);
     }
-    OC_LOG(DEBUG, TAG, "OUT");
+    OIC_LOG(DEBUG, TAG, "OUT");
     return OC_STACK_OK;
 }
 
@@ -1130,7 +1130,7 @@ uint64_t RTMGetCurrentTime()
 
 OCStackResult RTMUpdateDestAddrValidity(u_linklist_t **invalidTable, u_linklist_t **gatewayTable)
 {
-    OC_LOG(DEBUG, TAG, "IN");
+    OIC_LOG(DEBUG, TAG, "IN");
     RM_NULL_CHECK_WITH_RET(invalidTable, TAG, "invalidTable");
     RM_NULL_CHECK_WITH_RET(gatewayTable, TAG, "gatewayTable");
     RM_NULL_CHECK_WITH_RET(*gatewayTable, TAG, "*gatewayTable");
@@ -1138,7 +1138,7 @@ OCStackResult RTMUpdateDestAddrValidity(u_linklist_t **invalidTable, u_linklist_
     *invalidTable = u_linklist_create();
     if (NULL == *invalidTable)
     {
-        OC_LOG(ERROR, TAG, "u_linklist_create failed");
+        OIC_LOG(ERROR, TAG, "u_linklist_create failed");
         return OC_STACK_NO_MEMORY;
     }
 
@@ -1176,13 +1176,13 @@ OCStackResult RTMUpdateDestAddrValidity(u_linklist_t **invalidTable, u_linklist_
         }
         u_linklist_get_next(&iterTable);
     }
-    OC_LOG(DEBUG, TAG, "OUT");
+    OIC_LOG(DEBUG, TAG, "OUT");
     return OC_STACK_OK;
 }
 
 OCStackResult RTMRemoveInvalidGateways(u_linklist_t **invalidTable, u_linklist_t **gatewayTable)
 {
-    OC_LOG(DEBUG, TAG, "IN");
+    OIC_LOG(DEBUG, TAG, "IN");
     RM_NULL_CHECK_WITH_RET(invalidTable, TAG, "invalidTable");
     RM_NULL_CHECK_WITH_RET(gatewayTable, TAG, "gatewayTable");
     RM_NULL_CHECK_WITH_RET(*gatewayTable, TAG, "*gatewayTable");
@@ -1190,7 +1190,7 @@ OCStackResult RTMRemoveInvalidGateways(u_linklist_t **invalidTable, u_linklist_t
     *invalidTable = u_linklist_create();
     if (NULL == *invalidTable)
     {
-        OC_LOG(ERROR, TAG, "u_linklist_create failed");
+        OIC_LOG(ERROR, TAG, "u_linklist_create failed");
         return OC_STACK_NO_MEMORY;
     }
 
@@ -1225,7 +1225,7 @@ OCStackResult RTMRemoveInvalidGateways(u_linklist_t **invalidTable, u_linklist_t
                     RTMRemoveGatewayEntry(entry->destination->gatewayId, invalidTable, gatewayTable);
                 if (OC_STACK_OK != res)
                 {
-                    OC_LOG(ERROR, TAG, "Removing Entries failed");
+                    OIC_LOG(ERROR, TAG, "Removing Entries failed");
                     return OC_STACK_ERROR;
                 }
                 u_linklist_get_next(&iterTable);
@@ -1244,7 +1244,7 @@ OCStackResult RTMRemoveInvalidGateways(u_linklist_t **invalidTable, u_linklist_t
             u_linklist_get_next(&iterTable);
         }
     }
-    OC_LOG(DEBUG, TAG, "OUT");
+    OIC_LOG(DEBUG, TAG, "OUT");
     return OC_STACK_OK;
 }
 
@@ -1252,7 +1252,7 @@ OCStackResult RTMUpdateEntryParameters(uint32_t gatewayId, uint32_t seqNum,
                                        const RTMDestIntfInfo_t *destAdr, u_linklist_t **gatewayTable,
                                        bool forceUpdate)
 {
-    OC_LOG(DEBUG, TAG, "IN");
+    OIC_LOG(DEBUG, TAG, "IN");
     RM_NULL_CHECK_WITH_RET(gatewayTable, TAG, "gatewayTable");
     RM_NULL_CHECK_WITH_RET(*gatewayTable, TAG, "*gatewayTable");
     RM_NULL_CHECK_WITH_RET(destAdr, TAG, "destAdr");
@@ -1295,20 +1295,20 @@ OCStackResult RTMUpdateEntryParameters(uint32_t gatewayId, uint32_t seqNum,
             else
             {
                 entry->seqNum = seqNum;
-                OC_LOG(DEBUG, TAG, "OUT");
+                OIC_LOG(DEBUG, TAG, "OUT");
                 return OC_STACK_OK;
             }
         }
         u_linklist_get_next(&iterTable);
     }
-    OC_LOG(DEBUG, TAG, "OUT");
+    OIC_LOG(DEBUG, TAG, "OUT");
     return OC_STACK_OK;
 }
 
 void RTMPrintTable(const u_linklist_t *gatewayTable, const u_linklist_t *endpointTable)
 {
     RM_NULL_CHECK_VOID(gatewayTable, TAG, "gatewayTable");
-    OC_LOG(DEBUG, RM_TAG, "=================Gateway List table============================\n");
+    OIC_LOG(DEBUG, RM_TAG, "=================Gateway List table============================\n");
     u_linklist_iterator_t *iterTable = NULL;
     u_linklist_init_iterator(gatewayTable, &iterTable);
     while (NULL != iterTable)
@@ -1317,20 +1317,20 @@ void RTMPrintTable(const u_linklist_t *gatewayTable, const u_linklist_t *endpoin
             (RTMGatewayEntry_t *) u_linklist_get_data(iterTable);
         if (NULL == hop)
         {
-            OC_LOG(ERROR, RM_TAG, "Printing Table Failed");
+            OIC_LOG(ERROR, RM_TAG, "Printing Table Failed");
             return;
         }
         if (NULL == hop->nextHop || 0 == hop->nextHop->gatewayId)
         {
-            OC_LOG_V(DEBUG, RM_TAG, "\nDestination : %u\nNextHop : (null)\nHopCount : %d",
+            OIC_LOG_V(DEBUG, RM_TAG, "\nDestination : %u\nNextHop : (null)\nHopCount : %d",
                      hop->destination->gatewayId, hop->routeCost);
-            OC_LOG_V(DEBUG, RM_TAG, "\nSequence Number :%u", hop->seqNum);
+            OIC_LOG_V(DEBUG, RM_TAG, "\nSequence Number :%u", hop->seqNum);
         }
         else
         {
-            OC_LOG_V(DEBUG, RM_TAG, "\nDestination : %u\nNextHop : %u\nHopCount : %d",
+            OIC_LOG_V(DEBUG, RM_TAG, "\nDestination : %u\nNextHop : %u\nHopCount : %d",
                      hop->destination->gatewayId, hop->nextHop->gatewayId, hop->routeCost);
-            OC_LOG_V(DEBUG, RM_TAG, "\nSequence Number :%u", hop->seqNum);
+            OIC_LOG_V(DEBUG, RM_TAG, "\nSequence Number :%u", hop->seqNum);
         }
         if (1 == hop->routeCost && NULL != hop->destination &&
             hop->destination->destIntfAddr != NULL)
@@ -1340,17 +1340,17 @@ void RTMPrintTable(const u_linklist_t *gatewayTable, const u_linklist_t *endpoin
                 RTMDestIntfInfo_t *dest = u_arraylist_get(hop->destination->destIntfAddr, i);
                 if (NULL != dest)
                 {
-                    OC_LOG_V(DEBUG, RM_TAG, "\nDestination interface addresses: %s Port : %d Obs ID: %d",
+                    OIC_LOG_V(DEBUG, RM_TAG, "\nDestination interface addresses: %s Port : %d Obs ID: %d",
                              dest->destIntfAddr.addr, dest->destIntfAddr.port, dest->observerId);
-                    OC_LOG_V(DEBUG, RM_TAG, "Validity: %d", dest->isValid);
+                    OIC_LOG_V(DEBUG, RM_TAG, "Validity: %d", dest->isValid);
                 }
             }
         }
-        OC_LOG(DEBUG, RM_TAG, "********************************************\n");
+        OIC_LOG(DEBUG, RM_TAG, "********************************************\n");
         u_linklist_get_next(&iterTable);
     }
 
-    OC_LOG(DEBUG, RM_TAG, "=================Endpoint List table============================\n");
+    OIC_LOG(DEBUG, RM_TAG, "=================Endpoint List table============================\n");
     u_linklist_iterator_t *iterEndpointTable = NULL;
     u_linklist_init_iterator(endpointTable, &iterEndpointTable);
 
@@ -1361,13 +1361,13 @@ void RTMPrintTable(const u_linklist_t *gatewayTable, const u_linklist_t *endpoin
             (RTMEndpointEntry_t *) u_linklist_get_data(iterEndpointTable);
         if (NULL == hop)
         {
-            OC_LOG(ERROR, RM_TAG, "Printing Table Failed");
+            OIC_LOG(ERROR, RM_TAG, "Printing Table Failed");
             return;
         }
-        OC_LOG_V(DEBUG, RM_TAG, "EndpointId : %u\naddr : %s Port : %d",
+        OIC_LOG_V(DEBUG, RM_TAG, "EndpointId : %u\naddr : %s Port : %d",
                   hop->endpointId, hop->destIntfAddr.addr, hop->destIntfAddr.port);
 
-        OC_LOG(DEBUG, RM_TAG, "********************************************\n");
+        OIC_LOG(DEBUG, RM_TAG, "********************************************\n");
         u_linklist_get_next(&iterEndpointTable);
     }
 }
index df6f121..ca4850e 100644 (file)
@@ -45,7 +45,7 @@
 OCStackResult RMAddInfo(const char *destination, CAHeaderOption_t **options,
                         uint8_t *numOptions)
 {
-    OC_LOG(DEBUG, TAG, "IN");
+    OIC_LOG(DEBUG, TAG, "IN");
     RM_NULL_CHECK_WITH_RET(options, TAG, "options");
     RM_NULL_CHECK_WITH_RET(numOptions, TAG, "numOptions");
 
@@ -56,17 +56,17 @@ OCStackResult RMAddInfo(const char *destination, CAHeaderOption_t **options,
 
     if (-1 < index)
     {
-        OC_LOG(INFO, TAG, "Route option is present");
+        OIC_LOG(INFO, TAG, "Route option is present");
         optionPtr = *options;
     }
     else
     {
-        OC_LOG(INFO, TAG, "Route option is not present");
+        OIC_LOG(INFO, TAG, "Route option is not present");
         index = *numOptions;
         optionPtr = OICCalloc((*numOptions + 1), sizeof(CAHeaderOption_t));
         if (!optionPtr)
         {
-            OC_LOG(ERROR, TAG, "OICCalloc failed");
+            OIC_LOG(ERROR, TAG, "OICCalloc failed");
             return OC_STACK_NO_MEMORY;
         }
 
@@ -77,11 +77,11 @@ OCStackResult RMAddInfo(const char *destination, CAHeaderOption_t **options,
     RMRouteOption_t routeOption = {.destGw = 0};
     if (*numOptions != index)
     {
-        OC_LOG(INFO, TAG, "Route option is already present");
+        OIC_LOG(INFO, TAG, "Route option is already present");
         res = RMParseRouteOption(&optionPtr[index], &routeOption);
         if (OC_STACK_OK != res)
         {
-            OC_LOG(ERROR, TAG, "RMParseRouteOption failed");
+            OIC_LOG(ERROR, TAG, "RMParseRouteOption failed");
             return OC_STACK_ERROR;
         }
     }
@@ -110,7 +110,7 @@ OCStackResult RMAddInfo(const char *destination, CAHeaderOption_t **options,
     res = RMCreateRouteOption(&routeOption, optionPtr + index);
     if (OC_STACK_OK != res)
     {
-        OC_LOG(ERROR, TAG, "Creation of routing option failed");
+        OIC_LOG(ERROR, TAG, "Creation of routing option failed");
         OICFree(optionPtr);
         return res;
     }
@@ -122,14 +122,14 @@ OCStackResult RMAddInfo(const char *destination, CAHeaderOption_t **options,
         *options = optionPtr;
     }
 
-    OC_LOG(DEBUG, TAG, "OUT");
+    OIC_LOG(DEBUG, TAG, "OUT");
     return OC_STACK_OK;
 }
 
 OCStackResult RMUpdateInfo(CAHeaderOption_t **options, uint8_t *numOptions,
                            CAEndpoint_t *endpoint)
 {
-    OC_LOG(DEBUG, TAG, "IN");
+    OIC_LOG(DEBUG, TAG, "IN");
     RM_NULL_CHECK_WITH_RET(options, TAG, "options");
     RM_NULL_CHECK_WITH_RET(*options, TAG, "invalid option");
     RM_NULL_CHECK_WITH_RET(numOptions, TAG, "numOptions");
@@ -137,7 +137,7 @@ OCStackResult RMUpdateInfo(CAHeaderOption_t **options, uint8_t *numOptions,
 
     if (0 >= *numOptions)
     {
-        OC_LOG(ERROR, TAG, "Invalid arguement: numOptions");
+        OIC_LOG(ERROR, TAG, "Invalid arguement: numOptions");
         return OC_STACK_ERROR;
     }
 
@@ -146,7 +146,7 @@ OCStackResult RMUpdateInfo(CAHeaderOption_t **options, uint8_t *numOptions,
 
     if (-1 >= routeIndex)
     {
-        OC_LOG(DEBUG, TAG, "Nothing to remove.");
+        OIC_LOG(DEBUG, TAG, "Nothing to remove.");
         return OC_STACK_OK;
     }
 
@@ -164,7 +164,7 @@ OCStackResult RMUpdateInfo(CAHeaderOption_t **options, uint8_t *numOptions,
         {
             memcpy(endpoint->routeData, (*options + routeIndex)->optionData + count,
                    GATEWAY_ID_LENGTH);
-            OC_LOG_V(DEBUG, TAG, "adding srcgid: %u in endpoint [%d]",
+            OIC_LOG_V(DEBUG, TAG, "adding srcgid: %u in endpoint [%d]",
                      *((uint32_t *)endpoint->routeData), sLen);
 
             count += GATEWAY_ID_LENGTH;
@@ -173,7 +173,7 @@ OCStackResult RMUpdateInfo(CAHeaderOption_t **options, uint8_t *numOptions,
             {
                 memcpy(endpoint->routeData + GATEWAY_ID_LENGTH,
                        (*options + routeIndex)->optionData + count, ENDPOINT_ID_LENGTH);
-                OC_LOG_V(DEBUG, TAG, "adding srceid: %u in endpoint",
+                OIC_LOG_V(DEBUG, TAG, "adding srceid: %u in endpoint",
                          *((uint16_t *)(endpoint->routeData + GATEWAY_ID_LENGTH)));
             }
         }
@@ -192,31 +192,31 @@ OCStackResult RMUpdateInfo(CAHeaderOption_t **options, uint8_t *numOptions,
         OICFree(*options);
         *options = NULL;
     }
-    OC_LOG(DEBUG, TAG, "OUT");
+    OIC_LOG(DEBUG, TAG, "OUT");
     return OC_STACK_OK;
 }
 
 void RMGetRouteOptionIndex(const CAHeaderOption_t *options, uint8_t numOptions, int8_t *index)
 {
-    OC_LOG(DEBUG, TAG, "IN");
+    OIC_LOG(DEBUG, TAG, "IN");
     RM_NULL_CHECK_VOID(options, TAG, "options");
     RM_NULL_CHECK_VOID(index, TAG, "index");
     for (uint32_t i = 0; i < numOptions; i++)
     {
-        OC_LOG_V(DEBUG, TAG, "Request- optionID: %u", options[i].optionID);
+        OIC_LOG_V(DEBUG, TAG, "Request- optionID: %u", options[i].optionID);
         if (RM_OPTION_MESSAGE_SWITCHING == options[i].optionID)
         {
-            OC_LOG_V(INFO, TAG, "Found Option at %d", i);
+            OIC_LOG_V(INFO, TAG, "Found Option at %d", i);
             *index = i;
             break;
         }
     }
-    OC_LOG(DEBUG, TAG, "OUT");
+    OIC_LOG(DEBUG, TAG, "OUT");
 }
 
 OCStackResult RMCreateRouteOption(const RMRouteOption_t *optValue, CAHeaderOption_t *options)
 {
-    OC_LOG(DEBUG, RM_TAG, "IN");
+    OIC_LOG(DEBUG, RM_TAG, "IN");
     RM_NULL_CHECK_WITH_RET(optValue, RM_TAG, "optValue");
     RM_NULL_CHECK_WITH_RET(options, RM_TAG, "options");
 
@@ -225,12 +225,12 @@ OCStackResult RMCreateRouteOption(const RMRouteOption_t *optValue, CAHeaderOptio
     uint8_t sLen = (optValue->srcGw ? GATEWAY_ID_LENGTH:0) +
                         (optValue->srcEp ? ENDPOINT_ID_LENGTH:0);
 
-    OC_LOG_V(DEBUG, RM_TAG, "createoption dlen %u slen [%u]", dLen, sLen);
+    OIC_LOG_V(DEBUG, RM_TAG, "createoption dlen %u slen [%u]", dLen, sLen);
     unsigned int totalLength = MIN_ROUTE_OPTION_LEN + dLen + sLen;
     void *tempData = OICCalloc(totalLength, sizeof(char));
     if (NULL == tempData)
     {
-        OC_LOG(ERROR, RM_TAG, "Calloc failed");
+        OIC_LOG(ERROR, RM_TAG, "Calloc failed");
         return OC_STACK_NO_MEMORY;
     }
     memcpy(tempData, &dLen, sizeof(dLen));
@@ -273,21 +273,21 @@ OCStackResult RMCreateRouteOption(const RMRouteOption_t *optValue, CAHeaderOptio
     options->optionID = RM_OPTION_MESSAGE_SWITCHING;
     options->optionLength = totalLength;
 
-    OC_LOG_V(INFO, RM_TAG, "Option Length is %d", options->optionLength);
+    OIC_LOG_V(INFO, RM_TAG, "Option Length is %d", options->optionLength);
 
     OICFree(tempData);
-    OC_LOG(DEBUG, RM_TAG, "OUT");
+    OIC_LOG(DEBUG, RM_TAG, "OUT");
     return OC_STACK_OK;
 }
 
 OCStackResult RMParseRouteOption(const CAHeaderOption_t *options, RMRouteOption_t *optValue)
 {
-    OC_LOG(DEBUG, RM_TAG, "IN");
+    OIC_LOG(DEBUG, RM_TAG, "IN");
     RM_NULL_CHECK_WITH_RET(options, RM_TAG, "options");
     RM_NULL_CHECK_WITH_RET(optValue, RM_TAG, "optValue");
     if (0 == options->optionLength)
     {
-        OC_LOG(ERROR, RM_TAG, "Option data is not present");
+        OIC_LOG(ERROR, RM_TAG, "Option data is not present");
         return OC_STACK_ERROR;
     }
 
@@ -322,9 +322,9 @@ OCStackResult RMParseRouteOption(const CAHeaderOption_t *options, RMRouteOption_
     }
     memcpy(&optValue->mSeqNum, options->optionData + count, sizeof(optValue->mSeqNum));
 
-    OC_LOG_V(INFO, RM_TAG, "Option hopcount is %d", optValue->mSeqNum);
-    OC_LOG_V(INFO, RM_TAG, "Option Sender Addr is [%u][%u]", optValue->srcGw, optValue->srcEp);
-    OC_LOG_V(INFO, RM_TAG, "Option Dest Addr is [%u][%u]", optValue->destGw, optValue->destEp);
-    OC_LOG(DEBUG, RM_TAG, "OUT");
+    OIC_LOG_V(INFO, RM_TAG, "Option hopcount is %d", optValue->mSeqNum);
+    OIC_LOG_V(INFO, RM_TAG, "Option Sender Addr is [%u][%u]", optValue->srcGw, optValue->srcEp);
+    OIC_LOG_V(INFO, RM_TAG, "Option Dest Addr is [%u][%u]", optValue->destGw, optValue->destEp);
+    OIC_LOG(DEBUG, RM_TAG, "OUT");
     return OC_STACK_OK;
 }
index bb9e943..90c3192 100644 (file)
@@ -41,114 +41,115 @@ extern "C"
 
 #ifdef TB_LOG
     #define OC_LOG_PAYLOAD(level, payload) OCPayloadLog((level),(payload))
+    #define OIC_LOG_PAYLOAD(level, payload) OCPayloadLog((level),(payload))
     #define UUID_SIZE (16)
 const char *convertTriggerEnumToString(OCPresenceTrigger trigger);
 OCPresenceTrigger convertTriggerStringToEnum(const char * triggerStr);
 
 static inline void OCPayloadLogRep(LogLevel level, OCRepPayload* payload)
 {
-    OC_LOG(level, (PL_TAG), "Payload Type: Representation");
+    OIC_LOG(level, (PL_TAG), "Payload Type: Representation");
     OCRepPayload* rep = payload;
     int i = 1;
     while(rep)
     {
-        OC_LOG_V(level, PL_TAG, "\tResource #%d", i);
-        OC_LOG_V(level, PL_TAG, "\tURI:%s", rep->uri);
-        OC_LOG(level, PL_TAG, "\tResource Types:");
+        OIC_LOG_V(level, PL_TAG, "\tResource #%d", i);
+        OIC_LOG_V(level, PL_TAG, "\tURI:%s", rep->uri);
+        OIC_LOG(level, PL_TAG, "\tResource Types:");
         OCStringLL* strll =  rep->types;
         while(strll)
         {
-            OC_LOG_V(level, PL_TAG, "\t\t%s", strll->value);
+            OIC_LOG_V(level, PL_TAG, "\t\t%s", strll->value);
             strll = strll->next;
         }
-        OC_LOG(level, PL_TAG, "\tInterfaces:");
+        OIC_LOG(level, PL_TAG, "\tInterfaces:");
         strll =  rep->interfaces;
         while(strll)
         {
-            OC_LOG_V(level, PL_TAG, "\t\t%s", strll->value);
+            OIC_LOG_V(level, PL_TAG, "\t\t%s", strll->value);
             strll = strll->next;
         }
 
         // TODO Finish Logging: Values
         OCRepPayloadValue* val = rep->values;
 
-        OC_LOG(level, PL_TAG, "\tValues:");
+        OIC_LOG(level, PL_TAG, "\tValues:");
 
         while(val)
         {
             switch(val->type)
             {
                 case OCREP_PROP_NULL:
-                    OC_LOG_V(level, PL_TAG, "\t\t%s: NULL", val->name);
+                    OIC_LOG_V(level, PL_TAG, "\t\t%s: NULL", val->name);
                     break;
                 case OCREP_PROP_INT:
-                    OC_LOG_V(level, PL_TAG, "\t\t%s(int):%zd", val->name, val->i);
+                    OIC_LOG_V(level, PL_TAG, "\t\t%s(int):%zd", val->name, val->i);
                     break;
                 case OCREP_PROP_DOUBLE:
-                    OC_LOG_V(level, PL_TAG, "\t\t%s(double):%f", val->name, val->d);
+                    OIC_LOG_V(level, PL_TAG, "\t\t%s(double):%f", val->name, val->d);
                     break;
                 case OCREP_PROP_BOOL:
-                    OC_LOG_V(level, PL_TAG, "\t\t%s(bool):%s", val->name, val->b ? "true" : "false");
+                    OIC_LOG_V(level, PL_TAG, "\t\t%s(bool):%s", val->name, val->b ? "true" : "false");
                     break;
                 case OCREP_PROP_STRING:
-                    OC_LOG_V(level, PL_TAG, "\t\t%s(string):%s", val->name, val->str);
+                    OIC_LOG_V(level, PL_TAG, "\t\t%s(string):%s", val->name, val->str);
                     break;
                 case OCREP_PROP_BYTE_STRING:
-                    OC_LOG_V(level, PL_TAG, "\t\t%s(binary):", val->name);
-                    OC_LOG_BUFFER(level, PL_TAG, val->ocByteStr.bytes, val->ocByteStr.len);
+                    OIC_LOG_V(level, PL_TAG, "\t\t%s(binary):", val->name);
+                    OIC_LOG_BUFFER(level, PL_TAG, val->ocByteStr.bytes, val->ocByteStr.len);
                     break;
                 case OCREP_PROP_OBJECT:
                     // Note: Only prints the URI (if available), to print further, you'll
                     // need to dig into the object better!
-                    OC_LOG_V(level, PL_TAG, "\t\t%s(OCRep):%s", val->name, val->obj->uri);
+                    OIC_LOG_V(level, PL_TAG, "\t\t%s(OCRep):%s", val->name, val->obj->uri);
                     break;
                 case OCREP_PROP_ARRAY:
                     switch(val->arr.type)
                     {
                         case OCREP_PROP_INT:
-                            OC_LOG_V(level, PL_TAG, "\t\t%s(int array):%zu x %zu x %zu",
+                            OIC_LOG_V(level, PL_TAG, "\t\t%s(int array):%zu x %zu x %zu",
                                     val->name,
                                     val->arr.dimensions[0], val->arr.dimensions[1],
                                     val->arr.dimensions[2]);
                             break;
                         case OCREP_PROP_DOUBLE:
-                            OC_LOG_V(level, PL_TAG, "\t\t%s(double array):%zu x %zu x %zu",
+                            OIC_LOG_V(level, PL_TAG, "\t\t%s(double array):%zu x %zu x %zu",
                                     val->name,
                                     val->arr.dimensions[0], val->arr.dimensions[1],
                                     val->arr.dimensions[2]);
                             break;
                         case OCREP_PROP_BOOL:
-                            OC_LOG_V(level, PL_TAG, "\t\t%s(bool array):%zu x %zu x %zu",
+                            OIC_LOG_V(level, PL_TAG, "\t\t%s(bool array):%zu x %zu x %zu",
                                     val->name,
                                     val->arr.dimensions[0], val->arr.dimensions[1],
                                     val->arr.dimensions[2]);
                             break;
                         case OCREP_PROP_STRING:
-                            OC_LOG_V(level, PL_TAG, "\t\t%s(string array):%zu x %zu x %zu",
+                            OIC_LOG_V(level, PL_TAG, "\t\t%s(string array):%zu x %zu x %zu",
                                     val->name,
                                     val->arr.dimensions[0], val->arr.dimensions[1],
                                     val->arr.dimensions[2]);
                             break;
                         case OCREP_PROP_BYTE_STRING:
-                            OC_LOG_V(level, PL_TAG, "\t\t%s(byte array):%zu x %zu x %zu",
+                            OIC_LOG_V(level, PL_TAG, "\t\t%s(byte array):%zu x %zu x %zu",
                                     val->name,
                                     val->arr.dimensions[0], val->arr.dimensions[1],
                                     val->arr.dimensions[2]);
                             break;
                         case OCREP_PROP_OBJECT:
-                            OC_LOG_V(level, PL_TAG, "\t\t%s(OCRep array):%zu x %zu x %zu",
+                            OIC_LOG_V(level, PL_TAG, "\t\t%s(OCRep array):%zu x %zu x %zu",
                                     val->name,
                                     val->arr.dimensions[0], val->arr.dimensions[1],
                                     val->arr.dimensions[2]);
                             break;
                         default:
-                            OC_LOG_V(ERROR, PL_TAG, "\t\t%s <-- Unknown/unsupported array type!",
+                            OIC_LOG_V(ERROR, PL_TAG, "\t\t%s <-- Unknown/unsupported array type!",
                                     val->name);
                             break;
                     }
                     break;
                 default:
-                    OC_LOG_V(ERROR, PL_TAG, "\t\t%s <-- Unknown type!", val->name);
+                    OIC_LOG_V(ERROR, PL_TAG, "\t\t%s <-- Unknown type!", val->name);
                     break;
             }
             val = val -> next;
@@ -162,41 +163,41 @@ static inline void OCPayloadLogRep(LogLevel level, OCRepPayload* payload)
 
 static inline void OCPayloadLogDiscovery(LogLevel level, OCDiscoveryPayload* payload)
 {
-    OC_LOG(level, PL_TAG, "Payload Type: Discovery");
+    OIC_LOG(level, PL_TAG, "Payload Type: Discovery");
     int i = 1;
 
     if(!payload->resources)
     {
-        OC_LOG(level, PL_TAG, "\tNO Resources");
+        OIC_LOG(level, PL_TAG, "\tNO Resources");
         return;
     }
-    OC_LOG(level, PL_TAG, "\tSID:");
-    OC_LOG_BUFFER(level, PL_TAG, payload->sid, UUID_SIZE);
+    OIC_LOG(level, PL_TAG, "\tSID:");
+    OIC_LOG_BUFFER(level, PL_TAG, payload->sid, UUID_SIZE);
     OCResourcePayload* res = payload->resources;
 
     while(res)
     {
-        OC_LOG_V(level, PL_TAG, "\tResource #%d", i);
-        OC_LOG_V(level, PL_TAG, "\tURI:%s", res->uri);
-        OC_LOG(level, PL_TAG, "\tResource Types:");
+        OIC_LOG_V(level, PL_TAG, "\tResource #%d", i);
+        OIC_LOG_V(level, PL_TAG, "\tURI:%s", res->uri);
+        OIC_LOG(level, PL_TAG, "\tResource Types:");
         OCStringLL* strll =  res->types;
         while(strll)
         {
-            OC_LOG_V(level, PL_TAG, "\t\t%s", strll->value);
+            OIC_LOG_V(level, PL_TAG, "\t\t%s", strll->value);
             strll = strll->next;
         }
-        OC_LOG(level, PL_TAG, "\tInterfaces:");
+        OIC_LOG(level, PL_TAG, "\tInterfaces:");
         strll =  res->interfaces;
         while(strll)
         {
-            OC_LOG_V(level, PL_TAG, "\t\t%s", strll->value);
+            OIC_LOG_V(level, PL_TAG, "\t\t%s", strll->value);
             strll = strll->next;
         }
 
-        OC_LOG_V(level, PL_TAG, "\tBitmap: %u", res->bitmap);
-        OC_LOG_V(level, PL_TAG, "\tSecure?: %s", res->secure ? "true" : "false");
-        OC_LOG_V(level, PL_TAG, "\tPort: %u", res->port);
-        OC_LOG(level, PL_TAG, "");
+        OIC_LOG_V(level, PL_TAG, "\tBitmap: %u", res->bitmap);
+        OIC_LOG_V(level, PL_TAG, "\tSecure?: %s", res->secure ? "true" : "false");
+        OIC_LOG_V(level, PL_TAG, "\tPort: %u", res->port);
+        OIC_LOG(level, PL_TAG, "");
         res = res->next;
         ++i;
     }
@@ -204,44 +205,44 @@ static inline void OCPayloadLogDiscovery(LogLevel level, OCDiscoveryPayload* pay
 
 static inline void OCPayloadLogDevice(LogLevel level, OCDevicePayload* payload)
 {
-    OC_LOG(level, PL_TAG, "Payload Type: Device");
-    OC_LOG(level, PL_TAG, "\tSID:");
-    OC_LOG_BUFFER(level, PL_TAG, payload->sid, UUID_SIZE);
-    OC_LOG_V(level, PL_TAG, "\tDevice Name:%s", payload->deviceName);
-    OC_LOG_V(level, PL_TAG, "\tSpec Version%s", payload->specVersion);
-    OC_LOG_V(level, PL_TAG, "\tData Model Version:%s", payload->dataModelVersion);
+    OIC_LOG(level, PL_TAG, "Payload Type: Device");
+    OIC_LOG(level, PL_TAG, "\tSID:");
+    OIC_LOG_BUFFER(level, PL_TAG, payload->sid, UUID_SIZE);
+    OIC_LOG_V(level, PL_TAG, "\tDevice Name:%s", payload->deviceName);
+    OIC_LOG_V(level, PL_TAG, "\tSpec Version%s", payload->specVersion);
+    OIC_LOG_V(level, PL_TAG, "\tData Model Version:%s", payload->dataModelVersion);
 }
 
 static inline void OCPayloadLogPlatform(LogLevel level, OCPlatformPayload* payload)
 {
-    OC_LOG(level, PL_TAG, "Payload Type: Platform");
-    OC_LOG_V(level, PL_TAG, "\tURI:%s", payload->uri);
-    OC_LOG_V(level, PL_TAG, "\tPlatform ID:%s", payload->info.platformID);
-    OC_LOG_V(level, PL_TAG, "\tMfg Name:%s", payload->info.manufacturerName);
-    OC_LOG_V(level, PL_TAG, "\tMfg URL:%s", payload->info.manufacturerUrl);
-    OC_LOG_V(level, PL_TAG, "\tModel Number:%s", payload->info.modelNumber);
-    OC_LOG_V(level, PL_TAG, "\tDate of Mfg:%s", payload->info.dateOfManufacture);
-    OC_LOG_V(level, PL_TAG, "\tPlatform Version:%s", payload->info.platformVersion);
-    OC_LOG_V(level, PL_TAG, "\tOS Version:%s", payload->info.operatingSystemVersion);
-    OC_LOG_V(level, PL_TAG, "\tHardware Version:%s", payload->info.hardwareVersion);
-    OC_LOG_V(level, PL_TAG, "\tFirmware Version:%s", payload->info.firmwareVersion);
-    OC_LOG_V(level, PL_TAG, "\tSupport URL:%s", payload->info.supportUrl);
-    OC_LOG_V(level, PL_TAG, "\tSystem Time:%s", payload->info.systemTime);
+    OIC_LOG(level, PL_TAG, "Payload Type: Platform");
+    OIC_LOG_V(level, PL_TAG, "\tURI:%s", payload->uri);
+    OIC_LOG_V(level, PL_TAG, "\tPlatform ID:%s", payload->info.platformID);
+    OIC_LOG_V(level, PL_TAG, "\tMfg Name:%s", payload->info.manufacturerName);
+    OIC_LOG_V(level, PL_TAG, "\tMfg URL:%s", payload->info.manufacturerUrl);
+    OIC_LOG_V(level, PL_TAG, "\tModel Number:%s", payload->info.modelNumber);
+    OIC_LOG_V(level, PL_TAG, "\tDate of Mfg:%s", payload->info.dateOfManufacture);
+    OIC_LOG_V(level, PL_TAG, "\tPlatform Version:%s", payload->info.platformVersion);
+    OIC_LOG_V(level, PL_TAG, "\tOS Version:%s", payload->info.operatingSystemVersion);
+    OIC_LOG_V(level, PL_TAG, "\tHardware Version:%s", payload->info.hardwareVersion);
+    OIC_LOG_V(level, PL_TAG, "\tFirmware Version:%s", payload->info.firmwareVersion);
+    OIC_LOG_V(level, PL_TAG, "\tSupport URL:%s", payload->info.supportUrl);
+    OIC_LOG_V(level, PL_TAG, "\tSystem Time:%s", payload->info.systemTime);
 }
 
 static inline void OCPayloadLogPresence(LogLevel level, OCPresencePayload* payload)
 {
-    OC_LOG(level, PL_TAG, "Payload Type: Presence");
-    OC_LOG_V(level, PL_TAG, "\tSequence Number:%u", payload->sequenceNumber);
-    OC_LOG_V(level, PL_TAG, "\tMax Age:%d", payload->maxAge);
-    OC_LOG_V(level, PL_TAG, "\tTrigger:%s", convertTriggerEnumToString(payload->trigger));
-    OC_LOG_V(level, PL_TAG, "\tResource Type:%s", payload->resourceType);
+    OIC_LOG(level, PL_TAG, "Payload Type: Presence");
+    OIC_LOG_V(level, PL_TAG, "\tSequence Number:%u", payload->sequenceNumber);
+    OIC_LOG_V(level, PL_TAG, "\tMax Age:%d", payload->maxAge);
+    OIC_LOG_V(level, PL_TAG, "\tTrigger:%s", convertTriggerEnumToString(payload->trigger));
+    OIC_LOG_V(level, PL_TAG, "\tResource Type:%s", payload->resourceType);
 }
 
 static inline void OCPayloadLogSecurity(LogLevel level, OCSecurityPayload* payload)
 {
-    OC_LOG(level, PL_TAG, "Payload Type: Security");
-    OC_LOG_V(level, PL_TAG, "\tSecurity Data: %s", payload->securityData);
+    OIC_LOG(level, PL_TAG, "Payload Type: Security");
+    OIC_LOG_V(level, PL_TAG, "\tSecurity Data: %s", payload->securityData);
 }
 
 static inline void OCRDPayloadLog(const LogLevel level, const OCRDPayload *payload)
@@ -253,14 +254,14 @@ static inline void OCRDPayloadLog(const LogLevel level, const OCRDPayload *paylo
 
     if (payload->rdDiscovery)
     {
-        OC_LOG(level, PL_TAG, "RD Discovery");
-        OC_LOG_V(level, PL_TAG, "  Device Name : %s", payload->rdDiscovery->n.deviceName);
-        OC_LOG_V(level, PL_TAG, "  Device Identity : %s", payload->rdDiscovery->di.id);
-        OC_LOG_V(level, PL_TAG, "  Bias: %d", payload->rdDiscovery->sel);
+        OIC_LOG(level, PL_TAG, "RD Discovery");
+        OIC_LOG_V(level, PL_TAG, "  Device Name : %s", payload->rdDiscovery->n.deviceName);
+        OIC_LOG_V(level, PL_TAG, "  Device Identity : %s", payload->rdDiscovery->di.id);
+        OIC_LOG_V(level, PL_TAG, "  Bias: %d", payload->rdDiscovery->sel);
     }
     if (payload->rdPublish)
     {
-        OC_LOG(level, PL_TAG, "RD Publish");
+        OIC_LOG(level, PL_TAG, "RD Publish");
         OCResourceCollectionPayload *rdPublish = payload->rdPublish;
         OCTagsLog(level, rdPublish->tags);
         OCLinksLog(level, rdPublish->setLinks);
@@ -271,7 +272,7 @@ static inline void OCPayloadLog(LogLevel level, OCPayload* payload)
 {
     if(!payload)
     {
-        OC_LOG(level, PL_TAG, "NULL Payload");
+        OIC_LOG(level, PL_TAG, "NULL Payload");
         return;
     }
     switch(payload->type)
@@ -298,11 +299,12 @@ static inline void OCPayloadLog(LogLevel level, OCPayload* payload)
             OCRDPayloadLog(level, (OCRDPayload*)payload);
             break;
         default:
-            OC_LOG_V(level, PL_TAG, "Unknown Payload Type: %d", payload->type);
+            OIC_LOG_V(level, PL_TAG, "Unknown Payload Type: %d", payload->type);
             break;
     }
 }
 #else
+    #define OIC_LOG_PAYLOAD(level, payload)
     #define OC_LOG_PAYLOAD(level, payload)
 #endif
 
index 9c9885c..55ed42c 100644 (file)
@@ -79,32 +79,32 @@ int ConnectToNetwork()
     // check for the presence of the shield:
     if (WiFi.status() == WL_NO_SHIELD)
     {
-        OC_LOG(ERROR, TAG, ("WiFi shield not present"));
+        OIC_LOG(ERROR, TAG, ("WiFi shield not present"));
         return -1;
     }
 
     // Verify that WiFi Shield is running the firmware with all UDP fixes
     fwVersion = WiFi.firmwareVersion();
-    OC_LOG_V(INFO, TAG, "WiFi Shield Firmware version %s", fwVersion);
+    OIC_LOG_V(INFO, TAG, "WiFi Shield Firmware version %s", fwVersion);
     if ( strncmp(fwVersion, ARDUINO_WIFI_SHIELD_UDP_FW_VER, sizeof(ARDUINO_WIFI_SHIELD_UDP_FW_VER)) !=0 )
     {
-        OC_LOG(DEBUG, TAG, ("!!!!! Upgrade WiFi Shield Firmware version !!!!!!"));
+        OIC_LOG(DEBUG, TAG, ("!!!!! Upgrade WiFi Shield Firmware version !!!!!!"));
         return -1;
     }
 
     // attempt to connect to Wifi network:
     while (status != WL_CONNECTED)
     {
-        OC_LOG_V(INFO, TAG, "Attempting to connect to SSID: %s", ssid);
+        OIC_LOG_V(INFO, TAG, "Attempting to connect to SSID: %s", ssid);
         status = WiFi.begin(ssid,pass);
 
         // wait 10 seconds for connection:
         delay(10000);
     }
-    OC_LOG(DEBUG, TAG, ("Connected to wifi"));
+    OIC_LOG(DEBUG, TAG, ("Connected to wifi"));
 
     IPAddress ip = WiFi.localIP();
-    OC_LOG_V(INFO, TAG, "IP Address:  %d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);
+    OIC_LOG_V(INFO, TAG, "IP Address:  %d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);
     return 0;
 }
 #elif defined ARDUINOETH
@@ -116,12 +116,12 @@ int ConnectToNetwork()
     uint8_t error = Ethernet.begin(ETHERNET_MAC);
     if (error  == 0)
     {
-        OC_LOG_V(ERROR, TAG, "error is: %d", error);
+        OIC_LOG_V(ERROR, TAG, "error is: %d", error);
         return -1;
     }
 
     IPAddress ip = Ethernet.localIP();
-    OC_LOG_V(INFO, TAG, "IP Address:  %d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);
+    OIC_LOG_V(INFO, TAG, "IP Address:  %d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);
     return 0;
 }
 #endif //ARDUINOWIFI
@@ -139,8 +139,8 @@ void PrintArduinoMemoryStats()
     extern char *__brkval;
     //address of tmp gives us the current stack boundry
     int tmp;
-    OC_LOG_V(INFO, TAG, "Stack: %u         Heap: %u", (unsigned int)&tmp, (unsigned int)__brkval);
-    OC_LOG_V(INFO, TAG, "Unallocated Memory between heap and stack: %u",
+    OIC_LOG_V(INFO, TAG, "Stack: %u         Heap: %u", (unsigned int)&tmp, (unsigned int)__brkval);
+    OIC_LOG_V(INFO, TAG, "Unallocated Memory between heap and stack: %u",
             ((unsigned int)&tmp - (unsigned int)__brkval));
     #endif
 }
@@ -155,13 +155,13 @@ OCEntityHandlerResult OCEntityHandlerCb(OCEntityHandlerFlag flag, OCEntityHandle
     OCRepPayload* payload = OCRepPayloadCreate();
     if(!payload)
     {
-        OC_LOG(ERROR, TAG, ("Failed to allocate Payload"));
+        OIC_LOG(ERROR, TAG, ("Failed to allocate Payload"));
         return OC_EH_ERROR;
     }
 
     if(entityHandlerRequest && (flag & OC_REQUEST_FLAG))
     {
-        OC_LOG (INFO, TAG, ("Flag includes OC_REQUEST_FLAG"));
+        OIC_LOG (INFO, TAG, ("Flag includes OC_REQUEST_FLAG"));
 
         if(OC_REST_GET == entityHandlerRequest->method)
         {
@@ -194,7 +194,7 @@ OCEntityHandlerResult OCEntityHandlerCb(OCEntityHandlerFlag flag, OCEntityHandle
             // Send the response
             if (OCDoResponse(&response) != OC_STACK_OK)
             {
-                OC_LOG(ERROR, TAG, "Error sending response");
+                OIC_LOG(ERROR, TAG, "Error sending response");
                 ehRet = OC_EH_ERROR;
             }
         }
@@ -203,12 +203,12 @@ OCEntityHandlerResult OCEntityHandlerCb(OCEntityHandlerFlag flag, OCEntityHandle
     {
         if (OC_OBSERVE_REGISTER == entityHandlerRequest->obsInfo.action)
         {
-            OC_LOG (INFO, TAG, ("Received OC_OBSERVE_REGISTER from client"));
+            OIC_LOG (INFO, TAG, ("Received OC_OBSERVE_REGISTER from client"));
             gLightUnderObservation = 1;
         }
         else if (OC_OBSERVE_DEREGISTER == entityHandlerRequest->obsInfo.action)
         {
-            OC_LOG (INFO, TAG, ("Received OC_OBSERVE_DEREGISTER from client"));
+            OIC_LOG (INFO, TAG, ("Received OC_OBSERVE_DEREGISTER from client"));
             gLightUnderObservation = 0;
         }
     }
@@ -229,7 +229,7 @@ void *ChangeLightRepresentation (void *param)
         Light.power += 5;
         if (gLightUnderObservation)
         {
-            OC_LOG_V(INFO, TAG, " =====> Notifying stack of new power level %d\n", Light.power);
+            OIC_LOG_V(INFO, TAG, " =====> Notifying stack of new power level %d\n", Light.power);
             result = OCNotifyAllObservers (Light.handle, OC_NA_QOS);
             if (OC_STACK_NO_OBSERVERS == result)
             {
@@ -245,14 +245,14 @@ void setup()
 {
     // Add your initialization code here
     // Note : This will initialize Serial port on Arduino at 115200 bauds
-    OC_LOG_INIT();
-    OC_LOG(DEBUG, TAG, ("OCServer is starting..."));
+    OIC_LOG_INIT();
+    OIC_LOG(DEBUG, TAG, ("OCServer is starting..."));
 
     // Connect to Ethernet or WiFi network
 #if defined(ARDUINOWIFI) || defined(ARDUINOETH)
     if (ConnectToNetwork() != 0)
     {
-        OC_LOG(ERROR, TAG, ("Unable to connect to network"));
+        OIC_LOG(ERROR, TAG, ("Unable to connect to network"));
         return;
     }
 #endif
@@ -260,7 +260,7 @@ void setup()
     // Initialize the OC Stack in Server mode
     if (OCInit(NULL, 0, OC_SERVER) != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, ("OCStack init error"));
+        OIC_LOG(ERROR, TAG, ("OCStack init error"));
         return;
     }
 
@@ -281,7 +281,7 @@ void loop()
     // Give CPU cycles to OCStack to perform send/recv and other OCStack stuff
     if (OCProcess() != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, ("OCStack process error"));
+        OIC_LOG(ERROR, TAG, ("OCStack process error"));
         return;
     }
     ChangeLightRepresentation(NULL);
@@ -297,7 +297,7 @@ void createLightResource()
             OCEntityHandlerCb,
             NULL,
             OC_DISCOVERABLE|OC_OBSERVABLE);
-    OC_LOG_V(INFO, TAG, "Created Light resource with result: %s", getResult(res));
+    OIC_LOG_V(INFO, TAG, "Created Light resource with result: %s", getResult(res));
 }
 
 const char *getResult(OCStackResult result) {
index 5443842..5a4671b 100644 (file)
@@ -99,41 +99,41 @@ OCPayload* putPayload()
 
 static void PrintUsage()
 {
-    OC_LOG(INFO, TAG, "Usage : occlient -u <0|1> -t <1..17> -c <0|1>");
-    OC_LOG(INFO, TAG, "-u <0|1> : Perform multicast/unicast discovery of resources");
-    OC_LOG(INFO, TAG, "-c 0 : Use Default connectivity(IP)");
-    OC_LOG(INFO, TAG, "-c 1 : IP Connectivity Type");
-    OC_LOG(INFO, TAG, "-t 1  :  Discover Resources");
-    OC_LOG(INFO, TAG, "-t 2  :  Discover Resources and Initiate Nonconfirmable Get Request");
-    OC_LOG(INFO, TAG, "-t 3  :  Discover Resources and Initiate Nonconfirmable Get Request"
+    OIC_LOG(INFO, TAG, "Usage : occlient -u <0|1> -t <1..17> -c <0|1>");
+    OIC_LOG(INFO, TAG, "-u <0|1> : Perform multicast/unicast discovery of resources");
+    OIC_LOG(INFO, TAG, "-c 0 : Use Default connectivity(IP)");
+    OIC_LOG(INFO, TAG, "-c 1 : IP Connectivity Type");
+    OIC_LOG(INFO, TAG, "-t 1  :  Discover Resources");
+    OIC_LOG(INFO, TAG, "-t 2  :  Discover Resources and Initiate Nonconfirmable Get Request");
+    OIC_LOG(INFO, TAG, "-t 3  :  Discover Resources and Initiate Nonconfirmable Get Request"
             " with query filter.");
-    OC_LOG(INFO, TAG, "-t 4  :  Discover Resources and Initiate Nonconfirmable Put Requests");
-    OC_LOG(INFO, TAG, "-t 5  :  Discover Resources and Initiate Nonconfirmable Post Requests");
-    OC_LOG(INFO, TAG, "-t 6  :  Discover Resources and Initiate Nonconfirmable Delete Requests");
-    OC_LOG(INFO, TAG, "-t 7  :  Discover Resources and Initiate Nonconfirmable Observe Requests");
-    OC_LOG(INFO, TAG, "-t 8  :  Discover Resources and Initiate Nonconfirmable Get Request "\
+    OIC_LOG(INFO, TAG, "-t 4  :  Discover Resources and Initiate Nonconfirmable Put Requests");
+    OIC_LOG(INFO, TAG, "-t 5  :  Discover Resources and Initiate Nonconfirmable Post Requests");
+    OIC_LOG(INFO, TAG, "-t 6  :  Discover Resources and Initiate Nonconfirmable Delete Requests");
+    OIC_LOG(INFO, TAG, "-t 7  :  Discover Resources and Initiate Nonconfirmable Observe Requests");
+    OIC_LOG(INFO, TAG, "-t 8  :  Discover Resources and Initiate Nonconfirmable Get Request "\
             "for a resource which is unavailable");
-    OC_LOG(INFO, TAG, "-t 9  :  Discover Resources and Initiate Confirmable Get Request");
-    OC_LOG(INFO, TAG, "-t 10 :  Discover Resources and Initiate Confirmable Post Request");
-    OC_LOG(INFO, TAG, "-t 11 :  Discover Resources and Initiate Confirmable Delete Requests");
-    OC_LOG(INFO, TAG, "-t 12 :  Discover Resources and Initiate Confirmable Observe Requests"\
+    OIC_LOG(INFO, TAG, "-t 9  :  Discover Resources and Initiate Confirmable Get Request");
+    OIC_LOG(INFO, TAG, "-t 10 :  Discover Resources and Initiate Confirmable Post Request");
+    OIC_LOG(INFO, TAG, "-t 11 :  Discover Resources and Initiate Confirmable Delete Requests");
+    OIC_LOG(INFO, TAG, "-t 12 :  Discover Resources and Initiate Confirmable Observe Requests"\
             " and cancel with Low QoS");
 
 #ifdef WITH_PRESENCE
-    OC_LOG(INFO, TAG, "-t 13 :  Discover Resources and Initiate Nonconfirmable presence");
-    OC_LOG(INFO, TAG, "-t 14 :  Discover Resources and Initiate Nonconfirmable presence with "\
+    OIC_LOG(INFO, TAG, "-t 13 :  Discover Resources and Initiate Nonconfirmable presence");
+    OIC_LOG(INFO, TAG, "-t 14 :  Discover Resources and Initiate Nonconfirmable presence with "\
             "filter");
-    OC_LOG(INFO, TAG, "-t 15 :  Discover Resources and Initiate Nonconfirmable presence with "\
+    OIC_LOG(INFO, TAG, "-t 15 :  Discover Resources and Initiate Nonconfirmable presence with "\
             "2 filters");
-    OC_LOG(INFO, TAG, "-t 16 :  Discover Resources and Initiate Nonconfirmable multicast presence.");
+    OIC_LOG(INFO, TAG, "-t 16 :  Discover Resources and Initiate Nonconfirmable multicast presence.");
 #endif
 
-    OC_LOG(INFO, TAG, "-t 17 :  Discover Resources and Initiate Nonconfirmable Observe Requests "\
+    OIC_LOG(INFO, TAG, "-t 17 :  Discover Resources and Initiate Nonconfirmable Observe Requests "\
             "then cancel immediately with High QOS");
-    OC_LOG(INFO, TAG, "-t 18 :  Discover Resources and Initiate Nonconfirmable Get Request and "\
+    OIC_LOG(INFO, TAG, "-t 18 :  Discover Resources and Initiate Nonconfirmable Get Request and "\
             "add  vendor specific header options");
-    OC_LOG(INFO, TAG, "-t 19 :  Discover Platform");
-    OC_LOG(INFO, TAG, "-t 20 :  Discover Devices");
+    OIC_LOG(INFO, TAG, "-t 19 :  Discover Platform");
+    OIC_LOG(INFO, TAG, "-t 20 :  Discover Devices");
 }
 
 OCStackResult InvokeOCDoResource(std::ostringstream &query,
@@ -158,7 +158,7 @@ OCStackResult InvokeOCDoResource(std::ostringstream &query,
 
     if (ret != OC_STACK_OK)
     {
-        OC_LOG_V(ERROR, TAG, "OCDoResource returns error %d with method %d", ret, method);
+        OIC_LOG_V(ERROR, TAG, "OCDoResource returns error %d with method %d", ret, method);
     }
 #ifdef WITH_PRESENCE
     else if (method == OC_REST_PRESENCE)
@@ -175,18 +175,18 @@ OCStackApplicationResult putReqCB(void* ctx, OCDoHandle /*handle*/,
 {
     if (ctx == (void*)DEFAULT_CONTEXT_VALUE)
     {
-        OC_LOG(INFO, TAG, "Callback Context for PUT recvd successfully");
+        OIC_LOG(INFO, TAG, "Callback Context for PUT recvd successfully");
     }
 
     if (clientResponse)
     {
-        OC_LOG_V(INFO, TAG, "StackResult: %s",  getResult(clientResponse->result));
-        OC_LOG_PAYLOAD(INFO, clientResponse->payload);
-        OC_LOG(INFO, TAG, ("=============> Put Response"));
+        OIC_LOG_V(INFO, TAG, "StackResult: %s",  getResult(clientResponse->result));
+        OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
+        OIC_LOG(INFO, TAG, ("=============> Put Response"));
     }
     else
     {
-        OC_LOG_V(INFO, TAG, "putReqCB received Null clientResponse");
+        OIC_LOG_V(INFO, TAG, "putReqCB received Null clientResponse");
     }
     return OC_STACK_DELETE_TRANSACTION;
 }
@@ -196,18 +196,18 @@ OCStackApplicationResult postReqCB(void *ctx, OCDoHandle /*handle*/,
 {
     if (ctx == (void*)DEFAULT_CONTEXT_VALUE)
     {
-        OC_LOG(INFO, TAG, "Callback Context for POST recvd successfully");
+        OIC_LOG(INFO, TAG, "Callback Context for POST recvd successfully");
     }
 
     if (clientResponse)
     {
-        OC_LOG_V(INFO, TAG, "StackResult: %s",  getResult(clientResponse->result));
-        OC_LOG_PAYLOAD(INFO, clientResponse->payload);
-        OC_LOG(INFO, TAG, ("=============> Post Response"));
+        OIC_LOG_V(INFO, TAG, "StackResult: %s",  getResult(clientResponse->result));
+        OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
+        OIC_LOG(INFO, TAG, ("=============> Post Response"));
     }
     else
     {
-        OC_LOG_V(INFO, TAG, "postReqCB received Null clientResponse");
+        OIC_LOG_V(INFO, TAG, "postReqCB received Null clientResponse");
     }
     return OC_STACK_DELETE_TRANSACTION;
 }
@@ -218,18 +218,18 @@ OCStackApplicationResult deleteReqCB(void *ctx,
 {
     if (ctx == (void*)DEFAULT_CONTEXT_VALUE)
     {
-        OC_LOG(INFO, TAG, "Callback Context for DELETE recvd successfully");
+        OIC_LOG(INFO, TAG, "Callback Context for DELETE recvd successfully");
     }
 
     if (clientResponse)
     {
-        OC_LOG_V(INFO, TAG, "StackResult: %s",  getResult(clientResponse->result));
-        OC_LOG_PAYLOAD(INFO, clientResponse->payload);
-        OC_LOG(INFO, TAG, ("=============> Delete Response"));
+        OIC_LOG_V(INFO, TAG, "StackResult: %s",  getResult(clientResponse->result));
+        OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
+        OIC_LOG(INFO, TAG, ("=============> Delete Response"));
     }
     else
     {
-        OC_LOG_V(INFO, TAG, "deleteReqCB received Null clientResponse");
+        OIC_LOG_V(INFO, TAG, "deleteReqCB received Null clientResponse");
     }
     return OC_STACK_DELETE_TRANSACTION;
 }
@@ -239,33 +239,33 @@ OCStackApplicationResult getReqCB(void* ctx, OCDoHandle /*handle*/,
 {
     if (clientResponse == NULL)
     {
-        OC_LOG(INFO, TAG, "getReqCB received NULL clientResponse");
+        OIC_LOG(INFO, TAG, "getReqCB received NULL clientResponse");
         return   OC_STACK_DELETE_TRANSACTION;
     }
 
     if (ctx == (void*)DEFAULT_CONTEXT_VALUE)
     {
-        OC_LOG(INFO, TAG, "Callback Context for GET query recvd successfully");
+        OIC_LOG(INFO, TAG, "Callback Context for GET query recvd successfully");
     }
 
-    OC_LOG_V(INFO, TAG, "StackResult: %s",  getResult(clientResponse->result));
-    OC_LOG_V(INFO, TAG, "SEQUENCE NUMBER: %d", clientResponse->sequenceNumber);
-    OC_LOG_PAYLOAD(INFO, clientResponse->payload);
-    OC_LOG(INFO, TAG, ("=============> Get Response"));
+    OIC_LOG_V(INFO, TAG, "StackResult: %s",  getResult(clientResponse->result));
+    OIC_LOG_V(INFO, TAG, "SEQUENCE NUMBER: %d", clientResponse->sequenceNumber);
+    OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
+    OIC_LOG(INFO, TAG, ("=============> Get Response"));
 
     if (clientResponse->numRcvdVendorSpecificHeaderOptions > 0)
     {
-        OC_LOG (INFO, TAG, "Received vendor specific options");
+        OIC_LOG (INFO, TAG, "Received vendor specific options");
         uint8_t i = 0;
         OCHeaderOption * rcvdOptions = clientResponse->rcvdVendorSpecificHeaderOptions;
         for( i = 0; i < clientResponse->numRcvdVendorSpecificHeaderOptions; i++)
         {
             if (((OCHeaderOption)rcvdOptions[i]).protocolID == OC_COAP_ID)
             {
-                OC_LOG_V(INFO, TAG, "Received option with OC_COAP_ID and ID %u with",
+                OIC_LOG_V(INFO, TAG, "Received option with OC_COAP_ID and ID %u with",
                         ((OCHeaderOption)rcvdOptions[i]).optionID );
 
-                OC_LOG_BUFFER(INFO, TAG, ((OCHeaderOption)rcvdOptions[i]).optionData,
+                OIC_LOG_BUFFER(INFO, TAG, ((OCHeaderOption)rcvdOptions[i]).optionData,
                     MAX_HEADER_OPTION_DATA_LENGTH);
             }
         }
@@ -278,56 +278,56 @@ OCStackApplicationResult obsReqCB(void* ctx, OCDoHandle handle,
 {
     if (ctx == (void*)DEFAULT_CONTEXT_VALUE)
     {
-        OC_LOG(INFO, TAG, "Callback Context for OBS query recvd successfully");
+        OIC_LOG(INFO, TAG, "Callback Context for OBS query recvd successfully");
     }
 
     if (clientResponse)
     {
-        OC_LOG_V(INFO, TAG, "StackResult: %s",  getResult(clientResponse->result));
-        OC_LOG_V(INFO, TAG, "SEQUENCE NUMBER: %d", clientResponse->sequenceNumber);
-        OC_LOG_V(INFO, TAG, "Callback Context for OBSERVE notification recvd successfully %d",
+        OIC_LOG_V(INFO, TAG, "StackResult: %s",  getResult(clientResponse->result));
+        OIC_LOG_V(INFO, TAG, "SEQUENCE NUMBER: %d", clientResponse->sequenceNumber);
+        OIC_LOG_V(INFO, TAG, "Callback Context for OBSERVE notification recvd successfully %d",
                 gNumObserveNotifies);
-        OC_LOG_PAYLOAD(INFO, clientResponse->payload);
-        OC_LOG(INFO, TAG, ("=============> Obs Response"));
+        OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
+        OIC_LOG(INFO, TAG, ("=============> Obs Response"));
         gNumObserveNotifies++;
         if (gNumObserveNotifies > 15) //large number to test observing in DELETE case.
         {
             if (TestCase == TEST_OBS_REQ_NON || TestCase == TEST_OBS_REQ_CON)
             {
-                OC_LOG(ERROR, TAG, "Cancelling with LOW QOS");
+                OIC_LOG(ERROR, TAG, "Cancelling with LOW QOS");
                 if (OCCancel (handle, OC_LOW_QOS, NULL, 0) != OC_STACK_OK)
                 {
-                    OC_LOG(ERROR, TAG, "Observe cancel error");
+                    OIC_LOG(ERROR, TAG, "Observe cancel error");
                 }
                 return OC_STACK_DELETE_TRANSACTION;
             }
             else if (TestCase == TEST_OBS_REQ_NON_CANCEL_IMM)
             {
-                OC_LOG(ERROR, TAG, "Cancelling with HIGH QOS");
+                OIC_LOG(ERROR, TAG, "Cancelling with HIGH QOS");
                 if (OCCancel (handle, OC_HIGH_QOS, NULL, 0) != OC_STACK_OK)
                 {
-                    OC_LOG(ERROR, TAG, "Observe cancel error");
+                    OIC_LOG(ERROR, TAG, "Observe cancel error");
                 }
             }
         }
         if (clientResponse->sequenceNumber == OC_OBSERVE_REGISTER)
         {
-            OC_LOG(INFO, TAG, "This also serves as a registration confirmation");
+            OIC_LOG(INFO, TAG, "This also serves as a registration confirmation");
         }
         else if (clientResponse->sequenceNumber == OC_OBSERVE_DEREGISTER)
         {
-            OC_LOG(INFO, TAG, "This also serves as a deregistration confirmation");
+            OIC_LOG(INFO, TAG, "This also serves as a deregistration confirmation");
             return OC_STACK_DELETE_TRANSACTION;
         }
         else if (clientResponse->sequenceNumber == OC_OBSERVE_NO_OPTION)
         {
-            OC_LOG(INFO, TAG, "This also tells you that registration/deregistration failed");
+            OIC_LOG(INFO, TAG, "This also tells you that registration/deregistration failed");
             return OC_STACK_DELETE_TRANSACTION;
         }
     }
     else
     {
-        OC_LOG_V(INFO, TAG, "obsReqCB received Null clientResponse");
+        OIC_LOG_V(INFO, TAG, "obsReqCB received Null clientResponse");
     }
     return OC_STACK_KEEP_TRANSACTION;
 }
@@ -337,29 +337,29 @@ OCStackApplicationResult presenceCB(void* ctx, OCDoHandle /*handle*/,
 {
     if (ctx == (void*) DEFAULT_CONTEXT_VALUE)
     {
-        OC_LOG(INFO, TAG, "Callback Context for Presence recvd successfully");
+        OIC_LOG(INFO, TAG, "Callback Context for Presence recvd successfully");
     }
 
     if (clientResponse)
     {
-        OC_LOG_V(INFO, TAG, "StackResult: %s", getResult(clientResponse->result));
-        OC_LOG_V(INFO, TAG, "Callback Context for Presence notification recvd successfully %d",
+        OIC_LOG_V(INFO, TAG, "StackResult: %s", getResult(clientResponse->result));
+        OIC_LOG_V(INFO, TAG, "Callback Context for Presence notification recvd successfully %d",
                 gNumPresenceNotifies);
-        OC_LOG_PAYLOAD(INFO, clientResponse->payload);
-        OC_LOG(INFO, TAG, ("=============> Presence Response"));
+        OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
+        OIC_LOG(INFO, TAG, ("=============> Presence Response"));
         gNumPresenceNotifies++;
         if (gNumPresenceNotifies == 20)
         {
             if (OCCancel(gPresenceHandle, OC_LOW_QOS, NULL, 0) != OC_STACK_OK)
             {
-                OC_LOG(ERROR, TAG, "Presence cancel error");
+                OIC_LOG(ERROR, TAG, "Presence cancel error");
             }
             return OC_STACK_DELETE_TRANSACTION;
         }
     }
     else
     {
-        OC_LOG_V(INFO, TAG, "presenceCB received Null clientResponse");
+        OIC_LOG_V(INFO, TAG, "presenceCB received Null clientResponse");
     }
     return OC_STACK_KEEP_TRANSACTION;
 }
@@ -371,20 +371,20 @@ OCStackApplicationResult discoveryReqCB(void* ctx, OCDoHandle /*handle*/,
 {
     if (ctx == (void*) DEFAULT_CONTEXT_VALUE)
     {
-        OC_LOG(INFO, TAG, "Callback Context for DISCOVER query recvd successfully");
+        OIC_LOG(INFO, TAG, "Callback Context for DISCOVER query recvd successfully");
     }
 
     if (clientResponse)
     {
-        OC_LOG_V(INFO, TAG, "StackResult: %s", getResult(clientResponse->result));
+        OIC_LOG_V(INFO, TAG, "StackResult: %s", getResult(clientResponse->result));
 
         std::string connectionType = getConnectivityType (clientResponse->connType);
-        OC_LOG_V(INFO, TAG, "Discovered on %s", connectionType.c_str());
-        OC_LOG_V(INFO, TAG,
+        OIC_LOG_V(INFO, TAG, "Discovered on %s", connectionType.c_str());
+        OIC_LOG_V(INFO, TAG,
                 "Device =============> Discovered @ %s:%d",
                 clientResponse->devAddr.addr,
                 clientResponse->devAddr.port);
-        OC_LOG_PAYLOAD(INFO, clientResponse->payload);
+        OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
 
         ConnType = clientResponse->connType;
         serverAddr = clientResponse->devAddr;
@@ -398,7 +398,7 @@ OCStackApplicationResult discoveryReqCB(void* ctx, OCDoHandle /*handle*/,
         OCResourcePayload *resource = (OCResourcePayload*) payload->resources;
         if (!resource)
         {
-            OC_LOG_V (INFO, TAG, "No resources in payload");
+            OIC_LOG_V (INFO, TAG, "No resources in payload");
             return OC_STACK_DELETE_TRANSACTION;
         }
         coapServerResource =  resource->uri;
@@ -463,7 +463,7 @@ OCStackApplicationResult discoveryReqCB(void* ctx, OCDoHandle /*handle*/,
     }
     else
     {
-        OC_LOG_V(INFO, TAG, "discoveryReqCB received Null clientResponse");
+        OIC_LOG_V(INFO, TAG, "discoveryReqCB received Null clientResponse");
     }
     return OC_STACK_KEEP_TRANSACTION;
 }
@@ -474,17 +474,17 @@ OCStackApplicationResult PlatformDiscoveryReqCB(void* ctx,
 {
     if (ctx == (void*) DEFAULT_CONTEXT_VALUE)
     {
-        OC_LOG(INFO, TAG, "Callback Context for Platform DISCOVER query recvd successfully");
+        OIC_LOG(INFO, TAG, "Callback Context for Platform DISCOVER query recvd successfully");
     }
 
     if (clientResponse)
     {
-        OC_LOG(INFO, TAG, ("Discovery Response:"));
-        OC_LOG_PAYLOAD(INFO, clientResponse->payload);
+        OIC_LOG(INFO, TAG, ("Discovery Response:"));
+        OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
     }
     else
     {
-        OC_LOG_V(INFO, TAG, "PlatformDiscoveryReqCB received Null clientResponse");
+        OIC_LOG_V(INFO, TAG, "PlatformDiscoveryReqCB received Null clientResponse");
     }
 
     return (UnicastDiscovery) ? OC_STACK_DELETE_TRANSACTION : OC_STACK_KEEP_TRANSACTION;
@@ -495,17 +495,17 @@ OCStackApplicationResult DeviceDiscoveryReqCB(void* ctx, OCDoHandle /*handle*/,
 {
     if (ctx == (void*) DEFAULT_CONTEXT_VALUE)
     {
-        OC_LOG(INFO, TAG, "Callback Context for Device DISCOVER query recvd successfully");
+        OIC_LOG(INFO, TAG, "Callback Context for Device DISCOVER query recvd successfully");
     }
 
     if (clientResponse)
     {
-        OC_LOG(INFO, TAG, ("Discovery Response:"));
-        OC_LOG_PAYLOAD(INFO, clientResponse->payload);
+        OIC_LOG(INFO, TAG, ("Discovery Response:"));
+        OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
     }
     else
     {
-        OC_LOG_V(INFO, TAG, "PlatformDiscoveryReqCB received Null clientResponse");
+        OIC_LOG_V(INFO, TAG, "PlatformDiscoveryReqCB received Null clientResponse");
     }
 
     return (UnicastDiscovery) ? OC_STACK_DELETE_TRANSACTION : OC_STACK_KEEP_TRANSACTION;
@@ -515,7 +515,7 @@ OCStackApplicationResult DeviceDiscoveryReqCB(void* ctx, OCDoHandle /*handle*/,
 int InitPresence()
 {
     OCStackResult result = OC_STACK_OK;
-    OC_LOG_V(INFO, TAG, "\n\nExecuting %s", __func__);
+    OIC_LOG_V(INFO, TAG, "\n\nExecuting %s", __func__);
     std::ostringstream query;
     std::ostringstream querySuffix;
     query << OC_RSRVD_PRESENCE_URI;
@@ -560,7 +560,7 @@ int InitGetRequestToUnavailableResource(OCQualityOfService qos)
 {
     std::ostringstream query;
     query << "/SomeUnknownResource";
-    OC_LOG_V(INFO, TAG, "\nExecuting %s with query %s", __func__, query.str().c_str());
+    OIC_LOG_V(INFO, TAG, "\nExecuting %s with query %s", __func__, query.str().c_str());
     return (InvokeOCDoResource(query, &serverAddr, OC_REST_GET, (qos == OC_HIGH_QOS)? OC_HIGH_QOS:OC_LOW_QOS,
             getReqCB, NULL, 0));
 }
@@ -569,7 +569,7 @@ int InitObserveRequest(OCQualityOfService qos)
 {
     std::ostringstream query;
     query << coapServerResource;
-    OC_LOG_V(INFO, TAG, "\nExecuting %s with query %s", __func__, query.str().c_str());
+    OIC_LOG_V(INFO, TAG, "\nExecuting %s with query %s", __func__, query.str().c_str());
     return (InvokeOCDoResource(query, &serverAddr, OC_REST_OBSERVE,
               (qos == OC_HIGH_QOS)? OC_HIGH_QOS:OC_LOW_QOS, obsReqCB, NULL, 0));
 }
@@ -578,7 +578,7 @@ int InitPutRequest(OCQualityOfService qos)
 {
     std::ostringstream query;
     query << coapServerResource;
-    OC_LOG_V(INFO, TAG, "\nExecuting %s with query %s", __func__, query.str().c_str());
+    OIC_LOG_V(INFO, TAG, "\nExecuting %s with query %s", __func__, query.str().c_str());
     return (InvokeOCDoResource(query, &serverAddr, OC_REST_PUT, (qos == OC_HIGH_QOS)? OC_HIGH_QOS:OC_LOW_QOS,
             putReqCB, NULL, 0));
 }
@@ -590,7 +590,7 @@ int InitPostRequest(OCQualityOfService qos)
     std::ostringstream query;
     query << coapServerResource;
 
-    OC_LOG_V(INFO, TAG, "\nExecuting %s with query %s", __func__, query.str().c_str());
+    OIC_LOG_V(INFO, TAG, "\nExecuting %s with query %s", __func__, query.str().c_str());
     // First POST operation (to create an Light instance)
     result = InvokeOCDoResource(query, &serverAddr, OC_REST_POST,
                                ((qos == OC_HIGH_QOS) ? OC_HIGH_QOS: OC_LOW_QOS),
@@ -598,7 +598,7 @@ int InitPostRequest(OCQualityOfService qos)
     if (OC_STACK_OK != result)
     {
         // Error can happen if for example, network connectivity is down
-        OC_LOG(INFO, TAG, "First POST call did not succeed");
+        OIC_LOG(INFO, TAG, "First POST call did not succeed");
     }
 
     // Second POST operation (to create an Light instance)
@@ -607,7 +607,7 @@ int InitPostRequest(OCQualityOfService qos)
                                postReqCB, NULL, 0);
     if (OC_STACK_OK != result)
     {
-        OC_LOG(INFO, TAG, "Second POST call did not succeed");
+        OIC_LOG(INFO, TAG, "Second POST call did not succeed");
     }
 
     // This POST operation will update the original resourced /a/light
@@ -622,7 +622,7 @@ void* RequestDeleteDeathResourceTask(void* myqos)
     std::ostringstream query;
     query << coapServerResource;
 
-    OC_LOG_V(INFO, TAG, "\nExecuting %s with query %s", __func__, query.str().c_str());
+    OIC_LOG_V(INFO, TAG, "\nExecuting %s with query %s", __func__, query.str().c_str());
 
     // Second DELETE operation to delete the resource that might have been removed already.
     OCQualityOfService qos;
@@ -641,7 +641,7 @@ void* RequestDeleteDeathResourceTask(void* myqos)
 
     if (OC_STACK_OK != result)
     {
-        OC_LOG(INFO, TAG, "Second DELETE call did not succeed");
+        OIC_LOG(INFO, TAG, "Second DELETE call did not succeed");
     }
 
     return NULL;
@@ -653,7 +653,7 @@ int InitDeleteRequest(OCQualityOfService qos)
     std::ostringstream query;
     query << coapServerResource;
 
-    OC_LOG_V(INFO, TAG, "\nExecuting %s with query %s", __func__, query.str().c_str());
+    OIC_LOG_V(INFO, TAG, "\nExecuting %s with query %s", __func__, query.str().c_str());
 
     // First DELETE operation
     result = InvokeOCDoResource(query, &serverAddr, OC_REST_DELETE,
@@ -662,7 +662,7 @@ int InitDeleteRequest(OCQualityOfService qos)
     if (OC_STACK_OK != result)
     {
         // Error can happen if for example, network connectivity is down
-        OC_LOG(INFO, TAG, "First DELETE call did not succeed");
+        OIC_LOG(INFO, TAG, "First DELETE call did not succeed");
     }
     else
     {
@@ -671,7 +671,7 @@ int InitDeleteRequest(OCQualityOfService qos)
         pthread_create (&threadId, NULL, RequestDeleteDeathResourceTask, (void*)qos);
     }
 
-    OC_LOG_V(INFO, TAG, "\n\nExit  %s", __func__);
+    OIC_LOG_V(INFO, TAG, "\n\nExit  %s", __func__);
     return result;
 }
 
@@ -686,10 +686,10 @@ int InitGetRequest(OCQualityOfService qos, uint8_t withVendorSpecificHeaderOptio
     // ocserver is written to only process "power<X" query.
     if (getWithQuery)
     {
-        OC_LOG(INFO, TAG, "Using query power<50");
+        OIC_LOG(INFO, TAG, "Using query power<50");
         query << "?power<50";
     }
-    OC_LOG_V(INFO, TAG, "\nExecuting %s with query %s", __func__, query.str().c_str());
+    OIC_LOG_V(INFO, TAG, "\nExecuting %s with query %s", __func__, query.str().c_str());
 
     if (withVendorSpecificHeaderOptions)
     {
@@ -719,7 +719,7 @@ int InitGetRequest(OCQualityOfService qos, uint8_t withVendorSpecificHeaderOptio
 
 int InitPlatformDiscovery(OCQualityOfService qos)
 {
-    OC_LOG_V(INFO, TAG, "\n\nExecuting %s", __func__);
+    OIC_LOG_V(INFO, TAG, "\n\nExecuting %s", __func__);
 
     OCStackResult ret;
     OCCallbackData cbData;
@@ -736,7 +736,7 @@ int InitPlatformDiscovery(OCQualityOfService qos)
                        &cbData, NULL, 0);
     if (ret != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack device error");
+        OIC_LOG(ERROR, TAG, "OCStack device error");
     }
 
     return ret;
@@ -744,7 +744,7 @@ int InitPlatformDiscovery(OCQualityOfService qos)
 
 int InitDeviceDiscovery(OCQualityOfService qos)
 {
-    OC_LOG_V(INFO, TAG, "\n\nExecuting %s", __func__);
+    OIC_LOG_V(INFO, TAG, "\n\nExecuting %s", __func__);
 
     OCStackResult ret;
     OCCallbackData cbData;
@@ -761,7 +761,7 @@ int InitDeviceDiscovery(OCQualityOfService qos)
                        &cbData, NULL, 0);
     if (ret != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack device error");
+        OIC_LOG(ERROR, TAG, "OCStack device error");
     }
 
     return ret;
@@ -784,7 +784,7 @@ int InitDiscovery(OCQualityOfService qos)
                        &cbData, NULL, 0);
     if (ret != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack resource error");
+        OIC_LOG(ERROR, TAG, "OCStack resource error");
     }
     return ret;
 }
@@ -822,7 +822,7 @@ int main(int argc, char* argv[])
 
     if (OCInit1(OC_CLIENT, OC_DEFAULT_FLAGS, OC_DEFAULT_FLAGS) != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack init error");
+        OIC_LOG(ERROR, TAG, "OCStack init error");
         return 0;
     }
 
@@ -835,7 +835,7 @@ int main(int argc, char* argv[])
     {
         if (OC_STACK_OK != OCProcess())
         {
-            OC_LOG(ERROR, TAG, "OCStack process error");
+            OIC_LOG(ERROR, TAG, "OCStack process error");
             return 0;
         }
         usleep(SLEEP_DURATION);
@@ -847,7 +847,7 @@ int main(int argc, char* argv[])
     }
     else
     {
-        OC_LOG(INFO, TAG, "Default Connectivity type selected...");
+        OIC_LOG(INFO, TAG, "Default Connectivity type selected...");
         PrintUsage();
     }
 
@@ -855,9 +855,9 @@ int main(int argc, char* argv[])
 
     if (UnicastDiscovery)
     {
-        OC_LOG(INFO, TAG, "Enter IP address of server with optional port number");
-        OC_LOG(INFO, TAG, "IPv4: 192.168.0.15:45454\n");
-        OC_LOG(INFO, TAG, "IPv6: [fe80::20c:29ff:fe1b:9c5]:45454\n");
+        OIC_LOG(INFO, TAG, "Enter IP address of server with optional port number");
+        OIC_LOG(INFO, TAG, "IPv4: 192.168.0.15:45454\n");
+        OIC_LOG(INFO, TAG, "IPv6: [fe80::20c:29ff:fe1b:9c5]:45454\n");
 
         if (fgets(discoveryAddr, sizeof (discoveryAddr), stdin))
         {
@@ -866,7 +866,7 @@ int main(int argc, char* argv[])
         }
         else
         {
-            OC_LOG(ERROR, TAG, "!! Bad input for IP address. !!");
+            OIC_LOG(ERROR, TAG, "!! Bad input for IP address. !!");
             return OC_STACK_INVALID_PARAM;
         }
     }
@@ -885,25 +885,25 @@ int main(int argc, char* argv[])
     }
 
     // Break from loop with Ctrl+C
-    OC_LOG(INFO, TAG, "Entering occlient main loop...");
+    OIC_LOG(INFO, TAG, "Entering occlient main loop...");
     signal(SIGINT, handleSigInt);
     while (!gQuitFlag)
     {
 
         if (OCProcess() != OC_STACK_OK)
         {
-            OC_LOG(ERROR, TAG, "OCStack process error");
+            OIC_LOG(ERROR, TAG, "OCStack process error");
             return 0;
         }
 #ifndef ROUTING_GATEAWAY
         sleep(1);
 #endif
     }
-    OC_LOG(INFO, TAG, "Exiting occlient main loop...");
+    OIC_LOG(INFO, TAG, "Exiting occlient main loop...");
 
     if (OCStop() != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack stop error");
+        OIC_LOG(ERROR, TAG, "OCStack stop error");
     }
 
     return 0;
index 419593a..61622eb 100644 (file)
@@ -78,15 +78,15 @@ OCPayload* putPayload()
 
 static void PrintUsage()
 {
-    OC_LOG(INFO, TAG, "Usage : occlient -u <0|1> -t <1|2|3> -c <0|1>");
-    OC_LOG(INFO, TAG, "-u <0|1> : Perform multicast/unicast discovery of resources");
-    OC_LOG(INFO, TAG, "-t 1 : Discover Resources");
-    OC_LOG(INFO, TAG, "-t 2 : Discover Resources and"
+    OIC_LOG(INFO, TAG, "Usage : occlient -u <0|1> -t <1|2|3> -c <0|1>");
+    OIC_LOG(INFO, TAG, "-u <0|1> : Perform multicast/unicast discovery of resources");
+    OIC_LOG(INFO, TAG, "-t 1 : Discover Resources");
+    OIC_LOG(INFO, TAG, "-t 2 : Discover Resources and"
             " Initiate Nonconfirmable Get/Put/Post Requests");
-    OC_LOG(INFO, TAG, "-t 3 : Discover Resources and Initiate "
+    OIC_LOG(INFO, TAG, "-t 3 : Discover Resources and Initiate "
             "Confirmable Get/Put/Post Requests");
-    OC_LOG(INFO, TAG, "-c 0 : Default auto-selection");
-    OC_LOG(INFO, TAG, "-c 1 : IP Connectivity Type");
+    OIC_LOG(INFO, TAG, "-c 0 : Default auto-selection");
+    OIC_LOG(INFO, TAG, "-c 1 : IP Connectivity Type");
 }
 
 /*
@@ -117,7 +117,7 @@ OCStackResult InvokeOCDoResource(std::ostringstream &query,
 
     if (ret != OC_STACK_OK)
     {
-        OC_LOG_V(ERROR, TAG, "OCDoResource returns error %d with method %d",
+        OIC_LOG_V(ERROR, TAG, "OCDoResource returns error %d with method %d",
                  ret, method);
     }
 
@@ -129,21 +129,21 @@ OCStackApplicationResult putReqCB(void* ctx, OCDoHandle /*handle*/,
 {
     if(ctx == (void*)DEFAULT_CONTEXT_VALUE)
     {
-        OC_LOG(INFO, TAG, "<====Callback Context for PUT received successfully====>");
+        OIC_LOG(INFO, TAG, "<====Callback Context for PUT received successfully====>");
     }
     else
     {
-        OC_LOG(ERROR, TAG, "<====Callback Context for PUT fail====>");
+        OIC_LOG(ERROR, TAG, "<====Callback Context for PUT fail====>");
     }
 
     if(clientResponse)
     {
-        OC_LOG_PAYLOAD(INFO, clientResponse->payload);
-        OC_LOG(INFO, TAG, ("=============> Put Response"));
+        OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
+        OIC_LOG(INFO, TAG, ("=============> Put Response"));
     }
     else
     {
-        OC_LOG(ERROR, TAG, "<====PUT Callback fail to receive clientResponse====>\n");
+        OIC_LOG(ERROR, TAG, "<====PUT Callback fail to receive clientResponse====>\n");
     }
     return OC_STACK_DELETE_TRANSACTION;
 }
@@ -153,21 +153,21 @@ OCStackApplicationResult postReqCB(void *ctx, OCDoHandle /*handle*/,
 {
     if(ctx == (void*)DEFAULT_CONTEXT_VALUE)
     {
-        OC_LOG(INFO, TAG, "<====Callback Context for POST received successfully====>");
+        OIC_LOG(INFO, TAG, "<====Callback Context for POST received successfully====>");
     }
     else
     {
-        OC_LOG(ERROR, TAG, "<====Callback Context for POST fail====>");
+        OIC_LOG(ERROR, TAG, "<====Callback Context for POST fail====>");
     }
 
     if(clientResponse)
     {
-        OC_LOG_PAYLOAD(INFO, clientResponse->payload);
-        OC_LOG(INFO, TAG, ("=============> Post Response"));
+        OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
+        OIC_LOG(INFO, TAG, ("=============> Post Response"));
     }
     else
     {
-        OC_LOG(ERROR, TAG, "<====POST Callback fail to receive clientResponse====>\n");
+        OIC_LOG(ERROR, TAG, "<====POST Callback fail to receive clientResponse====>\n");
     }
 
     return OC_STACK_DELETE_TRANSACTION;
@@ -178,33 +178,33 @@ OCStackApplicationResult getReqCB(void* ctx, OCDoHandle /*handle*/,
 {
     if (ctx == (void*) DEFAULT_CONTEXT_VALUE)
     {
-        OC_LOG(INFO, TAG, "<====Callback Context for GET received successfully====>");
+        OIC_LOG(INFO, TAG, "<====Callback Context for GET received successfully====>");
     }
     else
     {
-        OC_LOG(ERROR, TAG, "<====Callback Context for GET fail====>");
+        OIC_LOG(ERROR, TAG, "<====Callback Context for GET fail====>");
     }
 
     if (clientResponse)
     {
-        OC_LOG_V(INFO, TAG, "StackResult: %s",  getResult(clientResponse->result));
-        OC_LOG_V(INFO, TAG, "SEQUENCE NUMBER: %d", clientResponse->sequenceNumber);
-        OC_LOG_PAYLOAD(INFO, clientResponse->payload);
-        OC_LOG(INFO, TAG, ("=============> Get Response"));
+        OIC_LOG_V(INFO, TAG, "StackResult: %s",  getResult(clientResponse->result));
+        OIC_LOG_V(INFO, TAG, "SEQUENCE NUMBER: %d", clientResponse->sequenceNumber);
+        OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
+        OIC_LOG(INFO, TAG, ("=============> Get Response"));
 
         if (clientResponse->numRcvdVendorSpecificHeaderOptions > 0 )
         {
-            OC_LOG (INFO, TAG, "Received vendor specific options");
+            OIC_LOG (INFO, TAG, "Received vendor specific options");
             uint8_t i = 0;
             OCHeaderOption * rcvdOptions = clientResponse->rcvdVendorSpecificHeaderOptions;
             for (i = 0; i < clientResponse->numRcvdVendorSpecificHeaderOptions; i++)
             {
                 if (((OCHeaderOption) rcvdOptions[i]).protocolID == OC_COAP_ID)
                 {
-                    OC_LOG_V(INFO, TAG, "Received option with OC_COAP_ID and ID %u with",
+                    OIC_LOG_V(INFO, TAG, "Received option with OC_COAP_ID and ID %u with",
                             ((OCHeaderOption)rcvdOptions[i]).optionID );
 
-                    OC_LOG_BUFFER(INFO, TAG, ((OCHeaderOption)rcvdOptions[i]).optionData,
+                    OIC_LOG_BUFFER(INFO, TAG, ((OCHeaderOption)rcvdOptions[i]).optionData,
                         MAX_HEADER_OPTION_DATA_LENGTH);
                 }
             }
@@ -212,7 +212,7 @@ OCStackApplicationResult getReqCB(void* ctx, OCDoHandle /*handle*/,
     }
     else
     {
-        OC_LOG(ERROR, TAG, "<====GET Callback fail to receive clientResponse====>\n");
+        OIC_LOG(ERROR, TAG, "<====GET Callback fail to receive clientResponse====>\n");
     }
     return OC_STACK_DELETE_TRANSACTION;
 }
@@ -225,27 +225,27 @@ OCStackApplicationResult discoveryReqCB(void* ctx, OCDoHandle /*handle*/,
 {
     if (ctx == (void*)DEFAULT_CONTEXT_VALUE)
     {
-        OC_LOG(INFO, TAG, "\n<====Callback Context for DISCOVERY query "
+        OIC_LOG(INFO, TAG, "\n<====Callback Context for DISCOVERY query "
                "received successfully====>");
     }
     else
     {
-        OC_LOG(ERROR, TAG, "\n<====Callback Context for DISCOVERY fail====>");
+        OIC_LOG(ERROR, TAG, "\n<====Callback Context for DISCOVERY fail====>");
     }
 
     if (clientResponse)
     {
-        OC_LOG_V(INFO, TAG,
+        OIC_LOG_V(INFO, TAG,
                 "Device =============> Discovered @ %s:%d",
                 clientResponse->devAddr.addr,
                 clientResponse->devAddr.port);
-        OC_LOG_PAYLOAD(INFO, clientResponse->payload);
+        OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
 
         collectUniqueResource(clientResponse);
     }
     else
     {
-        OC_LOG(ERROR, TAG, "<====DISCOVERY Callback fail to receive clientResponse====>\n");
+        OIC_LOG(ERROR, TAG, "<====DISCOVERY Callback fail to receive clientResponse====>\n");
     }
     return (UnicastDiscovery) ?
            OC_STACK_DELETE_TRANSACTION : OC_STACK_KEEP_TRANSACTION ;
@@ -259,11 +259,11 @@ int InitPutRequest(OCQualityOfService qos)
 
     if(!resource)
     {
-        OC_LOG_V(ERROR, TAG, "Resource null, can't do PUT request\n");
+        OIC_LOG_V(ERROR, TAG, "Resource null, can't do PUT request\n");
         return -1;
     }
     query << resource->uri;
-    OC_LOG_V(INFO, TAG,"Executing InitPutRequest, Query: %s", query.str().c_str());
+    OIC_LOG_V(INFO, TAG,"Executing InitPutRequest, Query: %s", query.str().c_str());
 
     return (InvokeOCDoResource(query, OC_REST_PUT, &resource->endpoint,
            ((qos == OC_HIGH_QOS) ? OC_HIGH_QOS: OC_LOW_QOS),
@@ -279,12 +279,12 @@ int InitPostRequest(OCQualityOfService qos)
 
     if(!resource)
     {
-        OC_LOG_V(ERROR, TAG, "Resource null, can't do POST request\n");
+        OIC_LOG_V(ERROR, TAG, "Resource null, can't do POST request\n");
         return -1;
     }
 
     query << resource->uri;
-    OC_LOG_V(INFO, TAG,"Executing InitPostRequest, Query: %s", query.str().c_str());
+    OIC_LOG_V(INFO, TAG,"Executing InitPostRequest, Query: %s", query.str().c_str());
 
     // First POST operation (to create an LED instance)
     result = InvokeOCDoResource(query, OC_REST_POST, &resource->endpoint,
@@ -293,7 +293,7 @@ int InitPostRequest(OCQualityOfService qos)
     if (OC_STACK_OK != result)
     {
         // Error can happen if for example, network connectivity is down
-        OC_LOG(ERROR, TAG, "First POST call did not succeed");
+        OIC_LOG(ERROR, TAG, "First POST call did not succeed");
     }
 
     // Second POST operation (to create an LED instance)
@@ -302,7 +302,7 @@ int InitPostRequest(OCQualityOfService qos)
             postReqCB, NULL, 0);
     if (OC_STACK_OK != result)
     {
-        OC_LOG(ERROR, TAG, "Second POST call did not succeed");
+        OIC_LOG(ERROR, TAG, "Second POST call did not succeed");
     }
 
     // This POST operation will update the original resourced /a/led
@@ -319,11 +319,11 @@ int InitGetRequest(OCQualityOfService qos)
 
     if(!resource)
     {
-        OC_LOG_V(ERROR, TAG, "Resource null, can't do GET request\n");
+        OIC_LOG_V(ERROR, TAG, "Resource null, can't do GET request\n");
         return -1;
     }
     query << resource->uri;
-    OC_LOG_V(INFO, TAG,"Executing InitGetRequest, Query: %s", query.str().c_str());
+    OIC_LOG_V(INFO, TAG,"Executing InitGetRequest, Query: %s", query.str().c_str());
 
     return (InvokeOCDoResource(query, OC_REST_GET, &resource->endpoint,
             (qos == OC_HIGH_QOS)?OC_HIGH_QOS:OC_LOW_QOS, getReqCB, NULL, 0));
@@ -338,9 +338,9 @@ int InitDiscovery()
 
     if (UnicastDiscovery)
     {
-        OC_LOG(INFO, TAG, "Enter IP address (with optional port) of the Server hosting resource\n");
-        OC_LOG(INFO, TAG, "IPv4: 192.168.0.15:45454\n");
-        OC_LOG(INFO, TAG, "IPv6: [fe80::20c:29ff:fe1b:9c5]:45454\n");
+        OIC_LOG(INFO, TAG, "Enter IP address (with optional port) of the Server hosting resource\n");
+        OIC_LOG(INFO, TAG, "IPv4: 192.168.0.15:45454\n");
+        OIC_LOG(INFO, TAG, "IPv6: [fe80::20c:29ff:fe1b:9c5]:45454\n");
 
         if (fgets(ipaddr, sizeof (ipaddr), stdin))
         {
@@ -348,7 +348,7 @@ int InitDiscovery()
         }
         else
         {
-            OC_LOG(ERROR, TAG, "!! Bad input for IP address. !!");
+            OIC_LOG(ERROR, TAG, "!! Bad input for IP address. !!");
             return OC_STACK_INVALID_PARAM;
         }
     }
@@ -363,7 +363,7 @@ int InitDiscovery()
                        OC_LOW_QOS, &cbData, NULL, 0);
     if (ret != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack resource error");
+        OIC_LOG(ERROR, TAG, "OCStack resource error");
     }
     return ret;
 }
@@ -416,17 +416,17 @@ void collectUniqueResource(const OCClientResponse * clientResponse)
         {
             if(insertResource(sidStr, res->uri, clientResponse) == 1)
             {
-                OC_LOG_V(INFO,TAG,"%s%s%s%s\n",sidStr, ":", res->uri, " is new");
+                OIC_LOG_V(INFO,TAG,"%s%s%s%s\n",sidStr, ":", res->uri, " is new");
                 printResourceList();
                 queryResource();
             }
             else {
-                OC_LOG_V(INFO,TAG,"%s%s%s%s\n",sidStr, ":", res->uri, " is old");
+                OIC_LOG_V(INFO,TAG,"%s%s%s%s\n",sidStr, ":", res->uri, " is old");
             }
         }
         else
         {
-            OC_LOG(ERROR, TAG, "Could Not Retrieve the Server ID");
+            OIC_LOG(ERROR, TAG, "Could Not Retrieve the Server ID");
         }
 
         res = res->next;
@@ -469,7 +469,7 @@ int insertResource(const char * sid, char const * uri,
     }
     else
     {
-        OC_LOG(ERROR, TAG, "Memory not allocated to ResourceNode");
+        OIC_LOG(ERROR, TAG, "Memory not allocated to ResourceNode");
         OICFree(sid_cpy);
         OICFree(uri_cpy);
         return -1;
@@ -492,37 +492,37 @@ void printResourceList()
 {
     ResourceNode * iter;
     iter = resourceList;
-    OC_LOG(INFO, TAG, "Resource List: ");
+    OIC_LOG(INFO, TAG, "Resource List: ");
     while(iter)
     {
-        OC_LOG(INFO, TAG, "*****************************************************");
-        OC_LOG_V(INFO, TAG, "sid = %s",iter->sid);
-        OC_LOG_V(INFO, TAG, "uri = %s", iter->uri);
-        OC_LOG_V(INFO, TAG, "ip = %s", iter->endpoint.addr);
-        OC_LOG_V(INFO, TAG, "port = %d", iter->endpoint.port);
+        OIC_LOG(INFO, TAG, "*****************************************************");
+        OIC_LOG_V(INFO, TAG, "sid = %s",iter->sid);
+        OIC_LOG_V(INFO, TAG, "uri = %s", iter->uri);
+        OIC_LOG_V(INFO, TAG, "ip = %s", iter->endpoint.addr);
+        OIC_LOG_V(INFO, TAG, "port = %d", iter->endpoint.port);
         switch (iter->endpoint.adapter)
         {
             case OC_ADAPTER_IP:
-                OC_LOG(INFO, TAG, "connType = Default (IPv4)");
+                OIC_LOG(INFO, TAG, "connType = Default (IPv4)");
                 break;
             case OC_ADAPTER_GATT_BTLE:
-                OC_LOG(INFO, TAG, "connType = BLE");
+                OIC_LOG(INFO, TAG, "connType = BLE");
                 break;
             case OC_ADAPTER_RFCOMM_BTEDR:
-                OC_LOG(INFO, TAG, "connType = BT");
+                OIC_LOG(INFO, TAG, "connType = BT");
                 break;
             default:
-                OC_LOG(INFO, TAG, "connType = Invalid connType");
+                OIC_LOG(INFO, TAG, "connType = Invalid connType");
                 break;
         }
-        OC_LOG(INFO, TAG, "*****************************************************");
+        OIC_LOG(INFO, TAG, "*****************************************************");
         iter = iter->next;
     }
 }
 
 void freeResourceList()
 {
-    OC_LOG(INFO, TAG, "Freeing ResourceNode List");
+    OIC_LOG(INFO, TAG, "Freeing ResourceNode List");
     ResourceNode * temp;
     while(resourceList)
     {
@@ -570,7 +570,7 @@ int main(int argc, char* argv[])
     /* Initialize OCStack*/
     if (OCInit1(OC_CLIENT, OC_DEFAULT_FLAGS, OC_DEFAULT_FLAGS) != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack init error");
+        OIC_LOG(ERROR, TAG, "OCStack init error");
         return 0;
     }
 
@@ -580,7 +580,7 @@ int main(int argc, char* argv[])
     }
     else
     {
-        OC_LOG(INFO, TAG, "Default Connectivity type selected");
+        OIC_LOG(INFO, TAG, "Default Connectivity type selected");
         PrintUsage();
     }
 
@@ -593,17 +593,17 @@ int main(int argc, char* argv[])
     {
         if (OCProcess() != OC_STACK_OK)
         {
-            OC_LOG(ERROR, TAG, "OCStack process error");
+            OIC_LOG(ERROR, TAG, "OCStack process error");
             return 0;
         }
         sleep(2);
     }
 
     freeResourceList();
-    OC_LOG(INFO, TAG, "Exiting occlient main loop...");
+    OIC_LOG(INFO, TAG, "Exiting occlient main loop...");
     if (OCStop() != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack stop error");
+        OIC_LOG(ERROR, TAG, "OCStack stop error");
     }
     return 0;
 }
index ff404d9..fee8870 100644 (file)
@@ -132,26 +132,26 @@ OCPayload* putPayload()
 
 void PrintUsage()
 {
-    OC_LOG(INFO, TAG, "Usage : occlientcoll -t <Test Case> -c <CA connectivity Type>");
-    OC_LOG(INFO, TAG, "-c 0 : Default auto-selection");
-    OC_LOG(INFO, TAG, "-c 1 : IP Connectivity Type");
-    OC_LOG(INFO, TAG, "Test Case 1 : Discover Resources && Initiate GET Request on an "\
+    OIC_LOG(INFO, TAG, "Usage : occlientcoll -t <Test Case> -c <CA connectivity Type>");
+    OIC_LOG(INFO, TAG, "-c 0 : Default auto-selection");
+    OIC_LOG(INFO, TAG, "-c 1 : IP Connectivity Type");
+    OIC_LOG(INFO, TAG, "Test Case 1 : Discover Resources && Initiate GET Request on an "\
             "available resource using default interface.");
-    OC_LOG(INFO, TAG, "Test Case 2 : Discover Resources && Initiate GET Request on an "\
+    OIC_LOG(INFO, TAG, "Test Case 2 : Discover Resources && Initiate GET Request on an "\
                  "available resource using batch interface.");
-    OC_LOG(INFO, TAG, "Test Case 3 : Discover Resources && Initiate GET Request on an "\
+    OIC_LOG(INFO, TAG, "Test Case 3 : Discover Resources && Initiate GET Request on an "\
                  "available resource using link list interface.");
-    OC_LOG(INFO, TAG, "Test Case 4 : Discover Resources && Initiate GET & PUT Request on an "\
+    OIC_LOG(INFO, TAG, "Test Case 4 : Discover Resources && Initiate GET & PUT Request on an "\
                  "available resource using default interface.");
-    OC_LOG(INFO, TAG, "Test Case 5 : Discover Resources && Initiate GET & PUT Request on an "\
+    OIC_LOG(INFO, TAG, "Test Case 5 : Discover Resources && Initiate GET & PUT Request on an "\
                  "available resource using batch interface.");
-    OC_LOG(INFO, TAG, "Test Case 6 : Discover Resources && Initiate GET & PUT Request on an "\
+    OIC_LOG(INFO, TAG, "Test Case 6 : Discover Resources && Initiate GET & PUT Request on an "\
                  "available resource using link list interface.");
-    OC_LOG(INFO, TAG, "Test Case 7 : Discover Resources && Initiate GET Request on an "\
+    OIC_LOG(INFO, TAG, "Test Case 7 : Discover Resources && Initiate GET Request on an "\
                  "unavailable resource using default interface.");
-    OC_LOG(INFO, TAG, "Test Case 8 : Discover Resources && Initiate GET Request on an "\
+    OIC_LOG(INFO, TAG, "Test Case 8 : Discover Resources && Initiate GET Request on an "\
                  "unavailable resource using batch interface.");
-    OC_LOG(INFO, TAG, "Test Case 9 : Discover Resources && Initiate GET Request on an "\
+    OIC_LOG(INFO, TAG, "Test Case 9 : Discover Resources && Initiate GET Request on an "\
                  "unavailable resource using link list interface.");
 }
 
@@ -160,13 +160,13 @@ OCStackApplicationResult putReqCB(void* ctx, OCDoHandle /*handle*/,
 {
     if(clientResponse == NULL)
     {
-        OC_LOG(INFO, TAG, "The clientResponse is NULL");
+        OIC_LOG(INFO, TAG, "The clientResponse is NULL");
         return   OC_STACK_DELETE_TRANSACTION;
     }
     if(ctx == (void*)DEFAULT_CONTEXT_VALUE)
     {
-        OC_LOG_V(INFO, TAG, "Callback Context for PUT query recvd successfully");
-        OC_LOG_PAYLOAD(INFO, clientResponse->payload);
+        OIC_LOG_V(INFO, TAG, "Callback Context for PUT query recvd successfully");
+        OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
     }
 
     return OC_STACK_KEEP_TRANSACTION;
@@ -175,27 +175,27 @@ OCStackApplicationResult putReqCB(void* ctx, OCDoHandle /*handle*/,
 OCStackApplicationResult getReqCB(void* ctx, OCDoHandle /*handle*/,
                                   OCClientResponse * clientResponse)
 {
-    OC_LOG_V(INFO, TAG, "StackResult: %s",
+    OIC_LOG_V(INFO, TAG, "StackResult: %s",
             getResult(clientResponse->result));
     if(ctx == (void*)DEFAULT_CONTEXT_VALUE)
     {
-        OC_LOG_V(INFO, TAG, "SEQUENCE NUMBER: %d", clientResponse->sequenceNumber);
+        OIC_LOG_V(INFO, TAG, "SEQUENCE NUMBER: %d", clientResponse->sequenceNumber);
         if(clientResponse->sequenceNumber == 0)
         {
-            OC_LOG_V(INFO, TAG, "Callback Context for GET query recvd successfully");
-            OC_LOG_PAYLOAD(INFO, clientResponse->payload);
+            OIC_LOG_V(INFO, TAG, "Callback Context for GET query recvd successfully");
+            OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
         }
         else
         {
-            OC_LOG_V(INFO, TAG, "Callback Context for Get recvd successfully %d",
+            OIC_LOG_V(INFO, TAG, "Callback Context for Get recvd successfully %d",
                     gNumObserveNotifies);
-            OC_LOG_PAYLOAD(INFO, clientResponse->payload);;
+            OIC_LOG_PAYLOAD(INFO, clientResponse->payload);;
             gNumObserveNotifies++;
             if (gNumObserveNotifies == 3)
             {
                 if (OCCancel (gObserveDoHandle, OC_LOW_QOS, NULL, 0) != OC_STACK_OK)
                 {
-                    OC_LOG(ERROR, TAG, "Observe cancel error");
+                    OIC_LOG(ERROR, TAG, "Observe cancel error");
                 }
             }
         }
@@ -211,21 +211,21 @@ OCStackApplicationResult getReqCB(void* ctx, OCDoHandle /*handle*/,
 OCStackApplicationResult discoveryReqCB(void* ctx, OCDoHandle /*handle*/,
                                         OCClientResponse * clientResponse)
 {
-    OC_LOG(INFO, TAG,
+    OIC_LOG(INFO, TAG,
             "Entering discoveryReqCB (Application Layer CB)");
-    OC_LOG_V(INFO, TAG, "StackResult: %s",
+    OIC_LOG_V(INFO, TAG, "StackResult: %s",
             getResult(clientResponse->result));
 
     if (ctx == (void*) DEFAULT_CONTEXT_VALUE)
     {
-        OC_LOG_V(INFO, TAG, "Callback Context recvd successfully");
+        OIC_LOG_V(INFO, TAG, "Callback Context recvd successfully");
     }
 
-    OC_LOG_V(INFO, TAG,
+    OIC_LOG_V(INFO, TAG,
             "Device =============> Discovered @ %s:%d",
             clientResponse->devAddr.addr,
             clientResponse->devAddr.port);
-    OC_LOG_PAYLOAD(INFO, clientResponse->payload);
+    OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
 
     ConnType = clientResponse->connType;
 
@@ -257,7 +257,7 @@ int InitGetRequestToUnavailableResource(OCClientResponse * clientResponse)
                        &cbData, NULL, 0);
     if (ret != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack resource error");
+        OIC_LOG(ERROR, TAG, "OCStack resource error");
     }
     return ret;
 }
@@ -273,9 +273,9 @@ int InitObserveRequest(OCClientResponse * clientResponse)
     cbData.cb = getReqCB;
     cbData.context = (void*)DEFAULT_CONTEXT_VALUE;
     cbData.cd = NULL;
-    OC_LOG_V(INFO, TAG, "OBSERVE payload from client =");
+    OIC_LOG_V(INFO, TAG, "OBSERVE payload from client =");
     OCPayload* payload = putPayload();
-    OC_LOG_PAYLOAD(INFO, payload);
+    OIC_LOG_PAYLOAD(INFO, payload);
     OCPayloadDestroy(payload);
 
     ret = OCDoResource(&handle, OC_REST_OBSERVE, obsReg.str().c_str(),
@@ -283,7 +283,7 @@ int InitObserveRequest(OCClientResponse * clientResponse)
                        OC_LOW_QOS, &cbData, NULL, 0);
     if (ret != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack resource error");
+        OIC_LOG(ERROR, TAG, "OCStack resource error");
     }
     else
     {
@@ -305,9 +305,9 @@ int InitPutRequest(OCClientResponse * clientResponse)
     cbData.cb = putReqCB;
     cbData.context = (void*)DEFAULT_CONTEXT_VALUE;
     cbData.cd = NULL;
-    OC_LOG_V(INFO, TAG, "PUT payload from client = ");
+    OIC_LOG_V(INFO, TAG, "PUT payload from client = ");
     OCPayload* payload = putPayload();
-    OC_LOG_PAYLOAD(INFO, payload);
+    OIC_LOG_PAYLOAD(INFO, payload);
     OCPayloadDestroy(payload);
 
     ret = OCDoResource(NULL, OC_REST_PUT, getQuery.str().c_str(),
@@ -315,7 +315,7 @@ int InitPutRequest(OCClientResponse * clientResponse)
                        OC_LOW_QOS, &cbData, NULL, 0);
     if (ret != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack resource error");
+        OIC_LOG(ERROR, TAG, "OCStack resource error");
     }
     return ret;
 }
@@ -340,7 +340,7 @@ int InitGetRequest(OCClientResponse * clientResponse)
                        &cbData, NULL, 0);
     if (ret != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack resource error");
+        OIC_LOG(ERROR, TAG, "OCStack resource error");
     }
     return ret;
 }
@@ -362,7 +362,7 @@ int InitDiscovery()
             &cbData, NULL, 0);
     if (ret != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack resource error");
+        OIC_LOG(ERROR, TAG, "OCStack resource error");
     }
     return ret;
 }
@@ -396,7 +396,7 @@ int main(int argc, char* argv[])
     /* Initialize OCStack*/
     if (OCInit(NULL, 0, OC_CLIENT) != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack init error");
+        OIC_LOG(ERROR, TAG, "OCStack init error");
         return 0;
     }
 
@@ -406,30 +406,30 @@ int main(int argc, char* argv[])
     }
     else
     {
-        OC_LOG(INFO, TAG, "Default Connectivity type selected...");
+        OIC_LOG(INFO, TAG, "Default Connectivity type selected...");
         ConnType = CT_ADAPTER_IP;
     }
 
     InitDiscovery();
 
     // Break from loop with Ctrl+C
-    OC_LOG(INFO, TAG, "Entering occlient main loop...");
+    OIC_LOG(INFO, TAG, "Entering occlient main loop...");
     signal(SIGINT, handleSigInt);
     while (!gQuitFlag)
     {
 
         if (OCProcess() != OC_STACK_OK)
         {
-            OC_LOG(ERROR, TAG, "OCStack process error");
+            OIC_LOG(ERROR, TAG, "OCStack process error");
             return 0;
         }
 
         sleep(2);
-    } OC_LOG(INFO, TAG, "Exiting occlient main loop...");
+    } OIC_LOG(INFO, TAG, "Exiting occlient main loop...");
 
     if (OCStop() != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack stop error");
+        OIC_LOG(ERROR, TAG, "OCStack stop error");
     }
 
     return 0;
index 3a7f26e..572b9e3 100644 (file)
@@ -59,15 +59,15 @@ void handleSigInt(int signum)
 
 static void PrintUsage()
 {
-    OC_LOG(INFO, TAG, "Usage : occlient -c <0|1> -u <0|1> -t <1|2|3>");
-    OC_LOG(INFO, TAG, "-c 0 : Default auto-selection");
-    OC_LOG(INFO, TAG, "-c 1 : IP Connectivity Type");
-    OC_LOG(INFO, TAG, "-u <0|1> : Perform multicast/unicast discovery of resources");
-    OC_LOG(INFO, TAG, "-t 1 : Discover Resources");
-    OC_LOG(INFO, TAG, "-t 2 : Discover Resources and Initiate Nonconfirmable Get Request");
-    OC_LOG(INFO, TAG, "-t 3 : Discover Resources and Initiate Confirmable Get Request");
-    OC_LOG(INFO, TAG, "-t 4 : Discover Resources and Initiate NonConfirmable Put Request");
-    OC_LOG(INFO, TAG, "-t 5 : Discover Resources and Initiate Confirmable Put Request");
+    OIC_LOG(INFO, TAG, "Usage : occlient -c <0|1> -u <0|1> -t <1|2|3>");
+    OIC_LOG(INFO, TAG, "-c 0 : Default auto-selection");
+    OIC_LOG(INFO, TAG, "-c 1 : IP Connectivity Type");
+    OIC_LOG(INFO, TAG, "-u <0|1> : Perform multicast/unicast discovery of resources");
+    OIC_LOG(INFO, TAG, "-t 1 : Discover Resources");
+    OIC_LOG(INFO, TAG, "-t 2 : Discover Resources and Initiate Nonconfirmable Get Request");
+    OIC_LOG(INFO, TAG, "-t 3 : Discover Resources and Initiate Confirmable Get Request");
+    OIC_LOG(INFO, TAG, "-t 4 : Discover Resources and Initiate NonConfirmable Put Request");
+    OIC_LOG(INFO, TAG, "-t 5 : Discover Resources and Initiate Confirmable Put Request");
 }
 
 OCPayload* putPayload()
@@ -103,7 +103,7 @@ OCStackResult InvokeOCDoResource(std::ostringstream &query,
 
     if (ret != OC_STACK_OK)
     {
-        OC_LOG_V(ERROR, TAG, "OCDoResource returns error %d with method %d", ret, method);
+        OIC_LOG_V(ERROR, TAG, "OCDoResource returns error %d with method %d", ret, method);
     }
 
     return ret;
@@ -114,33 +114,33 @@ OCStackApplicationResult getReqCB(void* ctx,
 {
     if(clientResponse == NULL)
     {
-        OC_LOG(INFO, TAG, "The clientResponse is NULL");
+        OIC_LOG(INFO, TAG, "The clientResponse is NULL");
         return   OC_STACK_DELETE_TRANSACTION;
     }
     if(ctx == (void*)DEFAULT_CONTEXT_VALUE)
     {
-        OC_LOG(INFO, TAG, "Callback Context for GET query recvd successfully");
+        OIC_LOG(INFO, TAG, "Callback Context for GET query recvd successfully");
     }
 
-    OC_LOG_V(INFO, TAG, "StackResult: %s",  getResult(clientResponse->result));
-    OC_LOG_V(INFO, TAG, "SEQUENCE NUMBER: %d", clientResponse->sequenceNumber);
-    OC_LOG(INFO, TAG, "Get Response =============> ");
-    OC_LOG_PAYLOAD(INFO, clientResponse->payload);
+    OIC_LOG_V(INFO, TAG, "StackResult: %s",  getResult(clientResponse->result));
+    OIC_LOG_V(INFO, TAG, "SEQUENCE NUMBER: %d", clientResponse->sequenceNumber);
+    OIC_LOG(INFO, TAG, "Get Response =============> ");
+    OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
 
     if(clientResponse->rcvdVendorSpecificHeaderOptions &&
             clientResponse->numRcvdVendorSpecificHeaderOptions)
     {
-        OC_LOG (INFO, TAG, "Received vendor specific options");
+        OIC_LOG (INFO, TAG, "Received vendor specific options");
         uint8_t i = 0;
         OCHeaderOption * rcvdOptions = clientResponse->rcvdVendorSpecificHeaderOptions;
         for( i = 0; i < clientResponse->numRcvdVendorSpecificHeaderOptions; i++)
         {
             if(((OCHeaderOption)rcvdOptions[i]).protocolID == OC_COAP_ID)
             {
-                OC_LOG_V(INFO, TAG, "Received option with OC_COAP_ID and ID %u with",
+                OIC_LOG_V(INFO, TAG, "Received option with OC_COAP_ID and ID %u with",
                         ((OCHeaderOption)rcvdOptions[i]).optionID );
 
-                OC_LOG_BUFFER(INFO, TAG, ((OCHeaderOption)rcvdOptions[i]).optionData,
+                OIC_LOG_BUFFER(INFO, TAG, ((OCHeaderOption)rcvdOptions[i]).optionData,
                     MAX_HEADER_OPTION_DATA_LENGTH);
             }
         }
@@ -154,16 +154,16 @@ OCStackApplicationResult discoveryReqCB(void* ctx, OCDoHandle /*handle*/,
 {
     if (ctx == (void*) DEFAULT_CONTEXT_VALUE)
     {
-        OC_LOG(INFO, TAG, "Callback Context for DISCOVER query recvd successfully");
+        OIC_LOG(INFO, TAG, "Callback Context for DISCOVER query recvd successfully");
     }
 
     if (clientResponse)
     {
-        OC_LOG_V(INFO, TAG, "StackResult: %s", getResult(clientResponse->result));
+        OIC_LOG_V(INFO, TAG, "StackResult: %s", getResult(clientResponse->result));
 
-        OC_LOG_V(INFO, TAG, "Discovered @ %s:%u =============> ",
+        OIC_LOG_V(INFO, TAG, "Discovered @ %s:%u =============> ",
             clientResponse->devAddr.addr, clientResponse->devAddr.port);
-        OC_LOG_PAYLOAD (INFO, clientResponse->payload);
+        OIC_LOG_PAYLOAD (INFO, clientResponse->payload);
 
         endpoint = clientResponse->devAddr;
 
@@ -193,10 +193,10 @@ OCStackApplicationResult discoveryReqCB(void* ctx, OCDoHandle /*handle*/,
 
 int InitGetRequest(OCQualityOfService qos)
 {
-    OC_LOG_V(INFO, TAG, "\n\nExecuting %s", __func__);
+    OIC_LOG_V(INFO, TAG, "\n\nExecuting %s", __func__);
     std::ostringstream query;
     query << coapServerResource;
-    OC_LOG_V (INFO, TAG, "Performing GET with query : %s", query.str().c_str());
+    OIC_LOG_V (INFO, TAG, "Performing GET with query : %s", query.str().c_str());
     return (InvokeOCDoResource(query, OC_REST_GET, &endpoint,
                                (qos == OC_HIGH_QOS)? OC_HIGH_QOS : OC_LOW_QOS,
                                getReqCB, NULL, 0));
@@ -204,10 +204,10 @@ int InitGetRequest(OCQualityOfService qos)
 
 int InitPutRequest(OCQualityOfService qos)
 {
-    OC_LOG_V(INFO, TAG, "\n\nExecuting %s", __func__);
+    OIC_LOG_V(INFO, TAG, "\n\nExecuting %s", __func__);
     std::ostringstream query;
     query << coapServerResource;
-    OC_LOG_V (INFO, TAG, "Performing PUT with query : %s", query.str().c_str());
+    OIC_LOG_V (INFO, TAG, "Performing PUT with query : %s", query.str().c_str());
     return (InvokeOCDoResource(query, OC_REST_PUT, &endpoint,
                                (qos == OC_HIGH_QOS)?  OC_HIGH_QOS:OC_LOW_QOS,
                                getReqCB, NULL, 0));
@@ -222,9 +222,9 @@ int InitDiscovery()
 
     if (UnicastDiscovery)
     {
-        OC_LOG(INFO, TAG, "Enter IP address (with optional port) of the Server hosting resource\n");
-        OC_LOG(INFO, TAG, "IPv4: 192.168.0.15:45454\n");
-        OC_LOG(INFO, TAG, "IPv6: [fe80::20c:29ff:fe1b:9c5]:45454\n");
+        OIC_LOG(INFO, TAG, "Enter IP address (with optional port) of the Server hosting resource\n");
+        OIC_LOG(INFO, TAG, "IPv4: 192.168.0.15:45454\n");
+        OIC_LOG(INFO, TAG, "IPv6: [fe80::20c:29ff:fe1b:9c5]:45454\n");
 
         if (fgets(ipaddr, sizeof (ipaddr), stdin))
         {
@@ -232,7 +232,7 @@ int InitDiscovery()
         }
         else
         {
-            OC_LOG(ERROR, TAG, "!! Bad input for IP address. !!");
+            OIC_LOG(ERROR, TAG, "!! Bad input for IP address. !!");
             return OC_STACK_INVALID_PARAM;
         }
     }
@@ -247,7 +247,7 @@ int InitDiscovery()
                        OC_LOW_QOS, &cbData, NULL, 0);
     if (ret != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack resource error");
+        OIC_LOG(ERROR, TAG, "OCStack resource error");
     }
     return ret;
 }
@@ -286,7 +286,7 @@ int main(int argc, char* argv[])
     /* Initialize OCStack*/
     if (OCInit(NULL, 0, OC_CLIENT) != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack init error");
+        OIC_LOG(ERROR, TAG, "OCStack init error");
         return 0;
     }
 
@@ -296,30 +296,30 @@ int main(int argc, char* argv[])
     }
     else
     {
-        OC_LOG(INFO, TAG, "Default Connectivity type selected...");
+        OIC_LOG(INFO, TAG, "Default Connectivity type selected...");
         AdapterType = CT_ADAPTER_IP;
     }
 
     InitDiscovery();
 
     // Break from loop with Ctrl+C
-    OC_LOG(INFO, TAG, "Entering occlient main loop...");
+    OIC_LOG(INFO, TAG, "Entering occlient main loop...");
     signal(SIGINT, handleSigInt);
     while (!gQuitFlag)
     {
         if (OCProcess() != OC_STACK_OK)
         {
-            OC_LOG(ERROR, TAG, "OCStack process error");
+            OIC_LOG(ERROR, TAG, "OCStack process error");
             return 0;
         }
 
         sleep(2);
     }
-    OC_LOG(INFO, TAG, "Exiting occlient main loop...");
+    OIC_LOG(INFO, TAG, "Exiting occlient main loop...");
 
     if (OCStop() != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack stop error");
+        OIC_LOG(ERROR, TAG, "OCStack stop error");
     }
 
     return 0;
index 94a8ad3..c3a7059 100644 (file)
@@ -85,15 +85,15 @@ OCPayload* putPayload()
 
 static void PrintUsage()
 {
-    OC_LOG(INFO, TAG, "This sample makes all requests via the remote access adapter");
-    OC_LOG(INFO, TAG, "Usage : ocremoteaccessclient -t <number>");
-    OC_LOG(INFO, TAG, "-t 1  :  Discover Resources");
-    OC_LOG(INFO, TAG, "-t 2  :  Discover & Get");
-    OC_LOG(INFO, TAG, "-t 3  :  Discover & Put");
-    OC_LOG(INFO, TAG, "-t 4  :  Discover & Post");
-    OC_LOG(INFO, TAG, "-t 5  :  Discover & Delete");
-    OC_LOG(INFO, TAG, "-t 6  :  Discover & Observe");
-    OC_LOG(INFO, TAG, "-t 7  :  Discover & Observe then cancel immediately with High QOS");
+    OIC_LOG(INFO, TAG, "This sample makes all requests via the remote access adapter");
+    OIC_LOG(INFO, TAG, "Usage : ocremoteaccessclient -t <number>");
+    OIC_LOG(INFO, TAG, "-t 1  :  Discover Resources");
+    OIC_LOG(INFO, TAG, "-t 2  :  Discover & Get");
+    OIC_LOG(INFO, TAG, "-t 3  :  Discover & Put");
+    OIC_LOG(INFO, TAG, "-t 4  :  Discover & Post");
+    OIC_LOG(INFO, TAG, "-t 5  :  Discover & Delete");
+    OIC_LOG(INFO, TAG, "-t 6  :  Discover & Observe");
+    OIC_LOG(INFO, TAG, "-t 7  :  Discover & Observe then cancel immediately with High QOS");
 }
 
 OCStackResult InvokeOCDoResource(std::ostringstream &query,
@@ -124,7 +124,7 @@ OCStackResult InvokeOCDoResource(std::ostringstream &query,
 
     if (ret != OC_STACK_OK)
     {
-        OC_LOG_V(ERROR, TAG, "OCDoResource returns error %d with method %d", ret, method);
+        OIC_LOG_V(ERROR, TAG, "OCDoResource returns error %d with method %d", ret, method);
     }
     else if (method == OC_REST_OBSERVE || method == OC_REST_OBSERVE_ALL)
     {
@@ -145,21 +145,21 @@ OCStackApplicationResult restRequestCB(void* ctx,
 {
     if(clientResponse == NULL)
     {
-        OC_LOG(INFO, TAG, "Received NULL response");
+        OIC_LOG(INFO, TAG, "Received NULL response");
         return   OC_STACK_DELETE_TRANSACTION;
     }
     if(ctx == (void*)DEFAULT_CONTEXT_VALUE)
     {
-        OC_LOG(INFO, TAG, "Callback Context recvd successfully");
+        OIC_LOG(INFO, TAG, "Callback Context recvd successfully");
     }
 
-    OC_LOG_V(INFO, TAG, "StackResult: %s",  getResult(clientResponse->result));
-    OC_LOG_V(INFO, TAG, "SEQUENCE NUMBER: %d", clientResponse->sequenceNumber);
-    OC_LOG_PAYLOAD(INFO, clientResponse->payload);
+    OIC_LOG_V(INFO, TAG, "StackResult: %s",  getResult(clientResponse->result));
+    OIC_LOG_V(INFO, TAG, "SEQUENCE NUMBER: %d", clientResponse->sequenceNumber);
+    OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
 
     if(clientResponse->numRcvdVendorSpecificHeaderOptions > 0)
     {
-        OC_LOG (INFO, TAG, "Received vendor specific options. Ignoring");
+        OIC_LOG (INFO, TAG, "Received vendor specific options. Ignoring");
     }
     SET_BUT_NOT_USED(handle);
     return OC_STACK_DELETE_TRANSACTION;
@@ -169,23 +169,23 @@ OCStackApplicationResult obsReqCB(void* ctx, OCDoHandle handle, OCClientResponse
 {
     if(!clientResponse)
     {
-        OC_LOG_V(INFO, TAG, "obsReqCB received NULL response");
+        OIC_LOG_V(INFO, TAG, "obsReqCB received NULL response");
     }
     if(ctx == (void*)DEFAULT_CONTEXT_VALUE)
     {
-        OC_LOG(INFO, TAG, "Callback Context recvd successfully");
+        OIC_LOG(INFO, TAG, "Callback Context recvd successfully");
     }
-    OC_LOG_V(INFO, TAG, "StackResult: %s",  getResult(clientResponse->result));
-    OC_LOG_V(INFO, TAG, "SEQUENCE NUMBER: %d", clientResponse->sequenceNumber);
-    OC_LOG_V(INFO, TAG, "OBSERVE notification %d recvd", gNumObserveNotifies);
-    OC_LOG_PAYLOAD(INFO, clientResponse->payload);
+    OIC_LOG_V(INFO, TAG, "StackResult: %s",  getResult(clientResponse->result));
+    OIC_LOG_V(INFO, TAG, "SEQUENCE NUMBER: %d", clientResponse->sequenceNumber);
+    OIC_LOG_V(INFO, TAG, "OBSERVE notification %d recvd", gNumObserveNotifies);
+    OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
 
     gNumObserveNotifies++;
     if (gNumObserveNotifies == maxNotification)
     {
         if (OCCancel (gObserveDoHandle, OC_LOW_QOS, NULL, 0) != OC_STACK_OK)
         {
-            OC_LOG(ERROR, TAG, "Observe cancel error");
+            OIC_LOG(ERROR, TAG, "Observe cancel error");
         }
         return OC_STACK_DELETE_TRANSACTION;
     }
@@ -193,21 +193,21 @@ OCStackApplicationResult obsReqCB(void* ctx, OCDoHandle handle, OCClientResponse
     {
         if (OCCancel (gObserveDoHandle, OC_HIGH_QOS, NULL, 0) != OC_STACK_OK)
         {
-            OC_LOG(ERROR, TAG, "Observe cancel error");
+            OIC_LOG(ERROR, TAG, "Observe cancel error");
         }
     }
     if(clientResponse->sequenceNumber == OC_OBSERVE_REGISTER)
     {
-        OC_LOG(INFO, TAG, "Registration confirmed");
+        OIC_LOG(INFO, TAG, "Registration confirmed");
     }
     else if(clientResponse->sequenceNumber == OC_OBSERVE_DEREGISTER)
     {
-        OC_LOG(INFO, TAG, "de-registration confirmed");
+        OIC_LOG(INFO, TAG, "de-registration confirmed");
         return OC_STACK_DELETE_TRANSACTION;
     }
     else if(clientResponse->sequenceNumber == OC_OBSERVE_NO_OPTION)
     {
-        OC_LOG(INFO, TAG, "Registration/deregistration failed");
+        OIC_LOG(INFO, TAG, "Registration/deregistration failed");
         return OC_STACK_DELETE_TRANSACTION;
     }
 
@@ -220,29 +220,29 @@ OCStackApplicationResult presenceCB(void* ctx,
 {
     if(ctx == (void*)DEFAULT_CONTEXT_VALUE)
     {
-        OC_LOG(INFO, TAG, "Callback Context recvd successfully");
+        OIC_LOG(INFO, TAG, "Callback Context recvd successfully");
     }
 
     if (clientResponse)
     {
-        OC_LOG_V(INFO, TAG, "StackResult: %s", getResult(clientResponse->result));
-        OC_LOG_V(INFO, TAG, "NONCE NUMBER: %u", clientResponse->sequenceNumber);
-        OC_LOG_V(INFO, TAG, "PRESENCE notification %d recvd", gNumPresenceNotifies);
-        OC_LOG_PAYLOAD(INFO, clientResponse->payload);
+        OIC_LOG_V(INFO, TAG, "StackResult: %s", getResult(clientResponse->result));
+        OIC_LOG_V(INFO, TAG, "NONCE NUMBER: %u", clientResponse->sequenceNumber);
+        OIC_LOG_V(INFO, TAG, "PRESENCE notification %d recvd", gNumPresenceNotifies);
+        OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
 
         gNumPresenceNotifies++;
         if (gNumPresenceNotifies == maxNotification)
         {
             if (OCCancel(gPresenceHandle, OC_LOW_QOS, NULL, 0) != OC_STACK_OK)
             {
-                OC_LOG(ERROR, TAG, "Presence cancel error");
+                OIC_LOG(ERROR, TAG, "Presence cancel error");
             }
             return OC_STACK_DELETE_TRANSACTION;
         }
     }
     else
     {
-        OC_LOG_V(INFO, TAG, "presenceCB received Null clientResponse");
+        OIC_LOG_V(INFO, TAG, "presenceCB received Null clientResponse");
     }
     SET_BUT_NOT_USED(handle);
     return OC_STACK_KEEP_TRANSACTION;
@@ -255,22 +255,22 @@ OCStackApplicationResult discoveryReqCB(void* ctx, OCDoHandle handle,
 {
     if (ctx == (void*) DEFAULT_CONTEXT_VALUE)
     {
-        OC_LOG(INFO, TAG, "DISCOVER  callback recvd");
+        OIC_LOG(INFO, TAG, "DISCOVER  callback recvd");
     }
 
     if (!clientResponse)
     {
-        OC_LOG_V(INFO, TAG, "discoveryReqCB received Null clientResponse");
+        OIC_LOG_V(INFO, TAG, "discoveryReqCB received Null clientResponse");
     }
 
-    OC_LOG_V(INFO, TAG, "StackResult: %s", getResult(clientResponse->result));
-    OC_LOG_PAYLOAD(INFO, clientResponse->payload);
+    OIC_LOG_V(INFO, TAG, "StackResult: %s", getResult(clientResponse->result));
+    OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
 
     responseAddr = clientResponse->devAddr;
 
     switch(TEST_CASE)
     {
-        OC_LOG_V(INFO, TAG, "TEST_CASE %u\n", TEST_CASE);
+        OIC_LOG_V(INFO, TAG, "TEST_CASE %u\n", TEST_CASE);
         case TEST_GET_REQ_NON:
             InitGetRequest(OC_LOW_QOS);
             break;
@@ -300,16 +300,16 @@ OCStackApplicationResult PlatformDiscoveryReqCB (void* ctx, OCDoHandle handle,
 {
     if (ctx == (void*) DEFAULT_CONTEXT_VALUE)
     {
-        OC_LOG(INFO, TAG, "Callback Context for Platform DISCOVER query recvd successfully");
+        OIC_LOG(INFO, TAG, "Callback Context for Platform DISCOVER query recvd successfully");
     }
 
     if(clientResponse)
     {
-        OC_LOG_PAYLOAD(INFO, clientResponse->payload);
+        OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
     }
     else
     {
-        OC_LOG_V(INFO, TAG, "PlatformDiscoveryReqCB received Null clientResponse");
+        OIC_LOG_V(INFO, TAG, "PlatformDiscoveryReqCB received Null clientResponse");
     }
 
     SET_BUT_NOT_USED(handle);
@@ -321,16 +321,16 @@ OCStackApplicationResult DeviceDiscoveryReqCB (void* ctx, OCDoHandle handle,
 {
     if (ctx == (void*) DEFAULT_CONTEXT_VALUE)
     {
-        OC_LOG(INFO, TAG, "Callback Context for Device DISCOVER query recvd successfully");
+        OIC_LOG(INFO, TAG, "Callback Context for Device DISCOVER query recvd successfully");
     }
 
     if(clientResponse)
     {
-        OC_LOG_PAYLOAD(INFO, clientResponse->payload);
+        OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
     }
     else
     {
-        OC_LOG_V(INFO, TAG, "PlatformDiscoveryReqCB received Null clientResponse");
+        OIC_LOG_V(INFO, TAG, "PlatformDiscoveryReqCB received Null clientResponse");
     }
 
     SET_BUT_NOT_USED(handle);
@@ -339,7 +339,7 @@ OCStackApplicationResult DeviceDiscoveryReqCB (void* ctx, OCDoHandle handle,
 
 int InitObserveRequest(OCQualityOfService qos)
 {
-    OC_LOG_V(INFO, TAG, "\n\nExecuting %s", __func__);
+    OIC_LOG_V(INFO, TAG, "\n\nExecuting %s", __func__);
     std::ostringstream query;
     query << coapServerResource;
     return (InvokeOCDoResource(query,
@@ -348,7 +348,7 @@ int InitObserveRequest(OCQualityOfService qos)
 
 int InitPutRequest(OCQualityOfService qos)
 {
-    OC_LOG_V(INFO, TAG, "\n\nExecuting %s", __func__);
+    OIC_LOG_V(INFO, TAG, "\n\nExecuting %s", __func__);
     std::ostringstream query;
     query << coapServerResource;
     return (InvokeOCDoResource(query, OC_REST_PUT, (qos == OC_HIGH_QOS)? OC_HIGH_QOS:OC_LOW_QOS,
@@ -357,7 +357,7 @@ int InitPutRequest(OCQualityOfService qos)
 
 int InitPostRequest(OCQualityOfService qos)
 {
-    OC_LOG_V(INFO, TAG, "\n\nExecuting %s", __func__);
+    OIC_LOG_V(INFO, TAG, "\n\nExecuting %s", __func__);
     std::ostringstream query;
     query << coapServerResource;
     // First POST operation (to create an Light instance)
@@ -367,7 +367,7 @@ int InitPostRequest(OCQualityOfService qos)
     if (OC_STACK_OK != result)
     {
         // Error can happen if for example, network connectivity is down
-        OC_LOG(INFO, TAG, "First POST call did not succeed");
+        OIC_LOG(INFO, TAG, "First POST call did not succeed");
     }
 
     // Second POST operation (to create an Light instance)
@@ -376,7 +376,7 @@ int InitPostRequest(OCQualityOfService qos)
                                restRequestCB, NULL, 0);
     if (OC_STACK_OK != result)
     {
-        OC_LOG(INFO, TAG, "Second POST call did not succeed");
+        OIC_LOG(INFO, TAG, "Second POST call did not succeed");
     }
 
     // This POST operation will update the original resourced /a/light
@@ -389,7 +389,7 @@ int InitDeleteRequest(OCQualityOfService qos)
 {
     std::ostringstream query;
     query << coapServerResource;
-    OC_LOG_V(INFO, TAG, "\n\nExecuting %s", __func__);
+    OIC_LOG_V(INFO, TAG, "\n\nExecuting %s", __func__);
 
     // First DELETE operation
     OCStackResult result = InvokeOCDoResource(query, OC_REST_DELETE,
@@ -398,14 +398,14 @@ int InitDeleteRequest(OCQualityOfService qos)
     if (OC_STACK_OK != result)
     {
         // Error can happen if for example, network connectivity is down
-        OC_LOG(INFO, TAG, "DELETE call did not succeed");
+        OIC_LOG(INFO, TAG, "DELETE call did not succeed");
     }
     return result;
 }
 
 int InitGetRequest(OCQualityOfService qos)
 {
-    OC_LOG_V(INFO, TAG, "\n\nExecuting %s", __func__);
+    OIC_LOG_V(INFO, TAG, "\n\nExecuting %s", __func__);
     std::ostringstream query;
     query << coapServerResource;
     return (InvokeOCDoResource(query, OC_REST_GET,
@@ -438,14 +438,14 @@ int InitDiscovery(OCQualityOfService qos)
 
     if (ret != OC_STACK_OK)
     {
-        OC_LOG_V(ERROR, TAG, "Error %u in OCDoResource with discovery", ret);
+        OIC_LOG_V(ERROR, TAG, "Error %u in OCDoResource with discovery", ret);
     }
     return ret;
 }
 
 static void jidbound(char *jid)
 {
-    OC_LOG_V(INFO, TAG, "\n\n    Bound JID: %s\n\n", jid);
+    OIC_LOG_V(INFO, TAG, "\n\n    Bound JID: %s\n\n", jid);
 }
 
 int main(int argc, char* argv[])
@@ -502,7 +502,7 @@ int main(int argc, char* argv[])
 
     if (OCSetRAInfo(&rainfo) != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "Error initiating remote access adapter");
+        OIC_LOG(ERROR, TAG, "Error initiating remote access adapter");
         return 0;
     }
 
@@ -514,41 +514,41 @@ int main(int argc, char* argv[])
 
     if (OCInit(NULL, 0, OC_CLIENT) != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack init error");
+        OIC_LOG(ERROR, TAG, "OCStack init error");
         return 0;
     }
 
-    OC_LOG(INFO, TAG, "Enter JID of remote server");
+    OIC_LOG(INFO, TAG, "Enter JID of remote server");
     if (fgets(remoteServerJabberID, MAX_ADDR_STR_SIZE, stdin))
     {
         StripNewLineChar(remoteServerJabberID);
     }
     else
     {
-        OC_LOG(ERROR, TAG, "Bad input for jabberID");
+        OIC_LOG(ERROR, TAG, "Bad input for jabberID");
         return OC_STACK_INVALID_PARAM;
     }
 
     InitDiscovery(OC_LOW_QOS);
 
     // Break from loop with Ctrl+C
-    OC_LOG(INFO, TAG, "Press CTRL+C to stop the stack");
+    OIC_LOG(INFO, TAG, "Press CTRL+C to stop the stack");
     signal(SIGINT, handleSigInt);
     while (!gQuitFlag)
     {
         if (OCProcess() != OC_STACK_OK)
         {
-            OC_LOG(ERROR, TAG, "OCStack process error");
+            OIC_LOG(ERROR, TAG, "OCStack process error");
             return 0;
         }
 
         sleep(2);
     }
-    OC_LOG(INFO, TAG, "Exiting ocremoteaccessclient main loop...");
+    OIC_LOG(INFO, TAG, "Exiting ocremoteaccessclient main loop...");
 
     if (OCStop() != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack stop error");
+        OIC_LOG(ERROR, TAG, "OCStack stop error");
     }
 
     return 0;
index 282adc2..0df6a43 100644 (file)
@@ -46,16 +46,16 @@ void handleSigInt(int signum)
 
 int main()
 {
-    OC_LOG(DEBUG, TAG, "OCRouting sample is starting...");
+    OIC_LOG(DEBUG, TAG, "OCRouting sample is starting...");
 
     if (OCInit(NULL, 0, OC_GATEWAY) != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack init error");
+        OIC_LOG(ERROR, TAG, "OCStack init error");
         return 0;
     }
 
     // Break from loop with Ctrl-C
-    OC_LOG(INFO, TAG, "Entering ocrouting main loop...");
+    OIC_LOG(INFO, TAG, "Entering ocrouting main loop...");
 
     signal(SIGINT, handleSigInt);
 
@@ -63,16 +63,16 @@ int main()
     {
         if (OCProcess() != OC_STACK_OK)
         {
-            OC_LOG(ERROR, TAG, "OCStack process error");
+            OIC_LOG(ERROR, TAG, "OCStack process error");
             return 0;
         }
     }
 
-    OC_LOG(INFO, TAG, "Exiting ocrouting main loop...");
+    OIC_LOG(INFO, TAG, "Exiting ocrouting main loop...");
 
     if (OCStop() != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack process error");
+        OIC_LOG(ERROR, TAG, "OCStack process error");
     }
 
     return 0;
index ab37a10..018d34d 100644 (file)
@@ -88,7 +88,7 @@ OCRepPayload* getPayload(const char* uri, int64_t power, bool state)
     OCRepPayload* payload = OCRepPayloadCreate();
     if(!payload)
     {
-        OC_LOG(ERROR, TAG, PCF("Failed to allocate Payload"));
+        OIC_LOG(ERROR, TAG, PCF("Failed to allocate Payload"));
         return nullptr;
     }
 
@@ -104,7 +104,7 @@ OCRepPayload* constructResponse(OCEntityHandlerRequest *ehRequest)
 {
     if(ehRequest->payload && ehRequest->payload->type != PAYLOAD_TYPE_REPRESENTATION)
     {
-        OC_LOG(ERROR, TAG, PCF("Incoming payload not a representation"));
+        OIC_LOG(ERROR, TAG, PCF("Incoming payload not a representation"));
         return nullptr;
     }
 
@@ -163,7 +163,7 @@ bool checkIfQueryForPowerPassed(char * query)
             int powerRequested = atoi(pointerToOperator + 1);
             if (Light.power > powerRequested)
             {
-                OC_LOG_V(INFO, TAG, "Current power: %d. Requested: <%d", Light.power
+                OIC_LOG_V(INFO, TAG, "Current power: %d. Requested: <%d", Light.power
                             , powerRequested);
                 return false;
             }
@@ -177,8 +177,8 @@ bool checkIfQueryForPowerPassed(char * query)
  */
 OCEntityHandlerResult ValidateQueryParams (OCEntityHandlerRequest *entityHandlerRequest)
 {
-    OC_LOG_V(INFO, TAG, PCF("Received query %s"), entityHandlerRequest->query);
-    OC_LOG(INFO, TAG, PCF("Not processing query"));
+    OIC_LOG_V(INFO, TAG, PCF("Received query %s"), entityHandlerRequest->query);
+    OIC_LOG(INFO, TAG, PCF("Not processing query"));
     return OC_EH_OK;
 }
 
@@ -194,7 +194,7 @@ OCEntityHandlerResult ProcessGetRequest (OCEntityHandlerRequest *ehRequest,
         OCRepPayload *getResp = constructResponse(ehRequest);
         if(!getResp)
         {
-            OC_LOG(ERROR, TAG, "constructResponse failed");
+            OIC_LOG(ERROR, TAG, "constructResponse failed");
             return OC_EH_ERROR;
         }
 
@@ -217,7 +217,7 @@ OCEntityHandlerResult ProcessPutRequest (OCEntityHandlerRequest *ehRequest,
 
     if(!putResp)
     {
-        OC_LOG(ERROR, TAG, "Failed to construct Json response");
+        OIC_LOG(ERROR, TAG, "Failed to construct Json response");
         return OC_EH_ERROR;
     }
 
@@ -258,7 +258,7 @@ OCEntityHandlerResult ProcessPostRequest (OCEntityHandlerRequest *ehRequest,
 
             if (0 == createLightResource (newLightUri, &gLightInstance[gCurrLightInstance]))
             {
-                OC_LOG (INFO, TAG, "Created new Light instance\n");
+                OIC_LOG (INFO, TAG, "Created new Light instance\n");
                 gLightInstance[gCurrLightInstance].state = 0;
                 gLightInstance[gCurrLightInstance].power = 0;
                 gCurrLightInstance++;
@@ -301,7 +301,7 @@ OCEntityHandlerResult ProcessPostRequest (OCEntityHandlerRequest *ehRequest,
     }
     else
     {
-        OC_LOG(INFO, TAG, "Payload was NULL");
+        OIC_LOG(INFO, TAG, "Payload was NULL");
         ehResult = OC_EH_ERROR;
     }
 
@@ -312,12 +312,12 @@ OCEntityHandlerResult ProcessDeleteRequest (OCEntityHandlerRequest *ehRequest)
 {
     if(ehRequest == NULL)
     {
-        OC_LOG(INFO, TAG, "The ehRequest is NULL");
+        OIC_LOG(INFO, TAG, "The ehRequest is NULL");
         return OC_EH_ERROR;
     }
     OCEntityHandlerResult ehResult = OC_EH_OK;
 
-    OC_LOG_V(INFO, TAG, "\n\nExecuting %s for resource %p ", __func__, ehRequest->resource);
+    OIC_LOG_V(INFO, TAG, "\n\nExecuting %s for resource %p ", __func__, ehRequest->resource);
 
     /*
      * In the sample below, the application will:
@@ -335,7 +335,7 @@ OCEntityHandlerResult ProcessDeleteRequest (OCEntityHandlerRequest *ehRequest)
 
         if (result == OC_STACK_OK)
         {
-            OC_LOG (INFO, TAG, "\n\nDelete Resource operation succeeded.");
+            OIC_LOG (INFO, TAG, "\n\nDelete Resource operation succeeded.");
             ehResult = OC_EH_OK;
 
             //Step 2: clear observers who wanted to observe this resource at the app level.
@@ -351,12 +351,12 @@ OCEntityHandlerResult ProcessDeleteRequest (OCEntityHandlerRequest *ehRequest)
         }
         else if (result == OC_STACK_NO_RESOURCE)
         {
-            OC_LOG(INFO, TAG, "\n\nThe resource doesn't exist or it might have been deleted.");
+            OIC_LOG(INFO, TAG, "\n\nThe resource doesn't exist or it might have been deleted.");
             ehResult = OC_EH_RESOURCE_DELETED;
         }
         else
         {
-            OC_LOG(INFO, TAG, "\n\nEncountered error from OCDeleteResource().");
+            OIC_LOG(INFO, TAG, "\n\nEncountered error from OCDeleteResource().");
             ehResult = OC_EH_ERROR;
         }
     }
@@ -364,7 +364,7 @@ OCEntityHandlerResult ProcessDeleteRequest (OCEntityHandlerRequest *ehRequest)
     {
         //Let's this app not supporting DELETE on some resources so
         //consider the DELETE request is received for a non-support resource.
-        OC_LOG_V(INFO, TAG, "\n\nThe request is received for a non-support resource.");
+        OIC_LOG_V(INFO, TAG, "\n\nThe request is received for a non-support resource.");
         ehResult = OC_EH_FORBIDDEN;
     }
 
@@ -373,14 +373,14 @@ OCEntityHandlerResult ProcessDeleteRequest (OCEntityHandlerRequest *ehRequest)
 
 OCEntityHandlerResult ProcessNonExistingResourceRequest(OCEntityHandlerRequest * /*ehRequest*/)
 {
-    OC_LOG_V(INFO, TAG, "\n\nExecuting %s ", __func__);
+    OIC_LOG_V(INFO, TAG, "\n\nExecuting %s ", __func__);
 
     return OC_EH_RESOURCE_NOT_FOUND;
 }
 
 void ProcessObserveRegister (OCEntityHandlerRequest *ehRequest)
 {
-    OC_LOG_V (INFO, TAG, "Received observation registration request with observation Id %d",
+    OIC_LOG_V (INFO, TAG, "Received observation registration request with observation Id %d",
             ehRequest->obsInfo.obsId);
 
     if (!observeThreadStarted)
@@ -404,7 +404,7 @@ void ProcessObserveDeregister (OCEntityHandlerRequest *ehRequest)
 {
     bool clientStillObserving = false;
 
-    OC_LOG_V (INFO, TAG, "Received observation deregistration request for observation Id %d",
+    OIC_LOG_V (INFO, TAG, "Received observation deregistration request for observation Id %d",
             ehRequest->obsInfo.obsId);
     for (uint8_t i = 0; i < SAMPLE_MAX_NUM_OBSERVATIONS; i++)
     {
@@ -428,7 +428,7 @@ OCDeviceEntityHandlerCb (OCEntityHandlerFlag flag,
                          char* uri,
                          void* /*callbackParam*/)
 {
-    OC_LOG_V (INFO, TAG, "Inside device default entity handler - flags: 0x%x, uri: %s", flag, uri);
+    OIC_LOG_V (INFO, TAG, "Inside device default entity handler - flags: 0x%x, uri: %s", flag, uri);
 
     OCEntityHandlerResult ehResult = OC_EH_OK;
     OCEntityHandlerResponse response;
@@ -436,7 +436,7 @@ OCDeviceEntityHandlerCb (OCEntityHandlerFlag flag,
     // Validate pointer
     if (!entityHandlerRequest)
     {
-        OC_LOG (ERROR, TAG, "Invalid request pointer");
+        OIC_LOG (ERROR, TAG, "Invalid request pointer");
         return OC_EH_ERROR;
     }
     // Initialize certain response fields
@@ -449,31 +449,31 @@ OCDeviceEntityHandlerCb (OCEntityHandlerFlag flag,
 
     if (flag & OC_REQUEST_FLAG)
     {
-        OC_LOG (INFO, TAG, "Flag includes OC_REQUEST_FLAG");
+        OIC_LOG (INFO, TAG, "Flag includes OC_REQUEST_FLAG");
 
         if (entityHandlerRequest->resource == NULL)
         {
-            OC_LOG (INFO, TAG, "Received request from client to a non-existing resource");
+            OIC_LOG (INFO, TAG, "Received request from client to a non-existing resource");
             ehResult = ProcessNonExistingResourceRequest(entityHandlerRequest);
         }
         else if (OC_REST_GET == entityHandlerRequest->method)
         {
-            OC_LOG (INFO, TAG, "Received OC_REST_GET from client");
+            OIC_LOG (INFO, TAG, "Received OC_REST_GET from client");
             ehResult = ProcessGetRequest (entityHandlerRequest, &payload);
         }
         else if (OC_REST_PUT == entityHandlerRequest->method)
         {
-            OC_LOG (INFO, TAG, "Received OC_REST_PUT from client");
+            OIC_LOG (INFO, TAG, "Received OC_REST_PUT from client");
             ehResult = ProcessPutRequest (entityHandlerRequest, &payload);
         }
         else if (OC_REST_DELETE == entityHandlerRequest->method)
         {
-            OC_LOG (INFO, TAG, "Received OC_REST_DELETE from client");
+            OIC_LOG (INFO, TAG, "Received OC_REST_DELETE from client");
             ehResult = ProcessDeleteRequest (entityHandlerRequest);
         }
         else
         {
-            OC_LOG_V (INFO, TAG, "Received unsupported method %d from client",
+            OIC_LOG_V (INFO, TAG, "Received unsupported method %d from client",
                       entityHandlerRequest->method);
             ehResult = OC_EH_ERROR;
         }
@@ -491,21 +491,21 @@ OCDeviceEntityHandlerCb (OCEntityHandlerFlag flag,
             // Send the response
             if (OCDoResponse(&response) != OC_STACK_OK)
             {
-                OC_LOG(ERROR, TAG, "Error sending response");
+                OIC_LOG(ERROR, TAG, "Error sending response");
                 ehResult = OC_EH_ERROR;
             }
         }
     }
     if (flag & OC_OBSERVE_FLAG)
     {
-        OC_LOG(INFO, TAG, "Flag includes OC_OBSERVE_FLAG");
+        OIC_LOG(INFO, TAG, "Flag includes OC_OBSERVE_FLAG");
         if (OC_OBSERVE_REGISTER == entityHandlerRequest->obsInfo.action)
         {
-            OC_LOG (INFO, TAG, "Received OC_OBSERVE_REGISTER from client");
+            OIC_LOG (INFO, TAG, "Received OC_OBSERVE_REGISTER from client");
         }
         else if (OC_OBSERVE_DEREGISTER == entityHandlerRequest->obsInfo.action)
         {
-            OC_LOG (INFO, TAG, "Received OC_OBSERVE_DEREGISTER from client");
+            OIC_LOG (INFO, TAG, "Received OC_OBSERVE_DEREGISTER from client");
         }
     }
 
@@ -526,7 +526,7 @@ OCEntityHandlerResult
 OCEntityHandlerCb (OCEntityHandlerFlag flag,
         OCEntityHandlerRequest *entityHandlerRequest, void* /*callback*/)
 {
-    OC_LOG_V (INFO, TAG, "Inside entity handler - flags: 0x%x", flag);
+    OIC_LOG_V (INFO, TAG, "Inside entity handler - flags: 0x%x", flag);
 
     OCEntityHandlerResult ehResult = OC_EH_OK;
     OCEntityHandlerResponse response = { 0, 0, OC_EH_ERROR, 0, 0, { },{ 0 }, false };
@@ -534,7 +534,7 @@ OCEntityHandlerCb (OCEntityHandlerFlag flag,
     // Validate pointer
     if (!entityHandlerRequest)
     {
-        OC_LOG (ERROR, TAG, "Invalid request pointer");
+        OIC_LOG (ERROR, TAG, "Invalid request pointer");
         return OC_EH_ERROR;
     }
 
@@ -547,31 +547,31 @@ OCEntityHandlerCb (OCEntityHandlerFlag flag,
 
     if (flag & OC_REQUEST_FLAG)
     {
-        OC_LOG (INFO, TAG, "Flag includes OC_REQUEST_FLAG");
+        OIC_LOG (INFO, TAG, "Flag includes OC_REQUEST_FLAG");
 
         if (OC_REST_GET == entityHandlerRequest->method)
         {
-            OC_LOG (INFO, TAG, "Received OC_REST_GET from client");
+            OIC_LOG (INFO, TAG, "Received OC_REST_GET from client");
             ehResult = ProcessGetRequest (entityHandlerRequest, &payload);
         }
         else if (OC_REST_PUT == entityHandlerRequest->method)
         {
-            OC_LOG (INFO, TAG, "Received OC_REST_PUT from client");
+            OIC_LOG (INFO, TAG, "Received OC_REST_PUT from client");
             ehResult = ProcessPutRequest (entityHandlerRequest, &payload);
         }
         else if (OC_REST_POST == entityHandlerRequest->method)
         {
-            OC_LOG (INFO, TAG, "Received OC_REST_POST from client");
+            OIC_LOG (INFO, TAG, "Received OC_REST_POST from client");
             ehResult = ProcessPostRequest (entityHandlerRequest, &response, &payload);
         }
         else if (OC_REST_DELETE == entityHandlerRequest->method)
         {
-            OC_LOG (INFO, TAG, "Received OC_REST_DELETE from client");
+            OIC_LOG (INFO, TAG, "Received OC_REST_DELETE from client");
             ehResult = ProcessDeleteRequest (entityHandlerRequest);
         }
         else
         {
-            OC_LOG_V (INFO, TAG, "Received unsupported method %d from client",
+            OIC_LOG_V (INFO, TAG, "Received unsupported method %d from client",
                       entityHandlerRequest->method);
             ehResult = OC_EH_ERROR;
         }
@@ -590,7 +590,7 @@ OCEntityHandlerCb (OCEntityHandlerFlag flag,
             if(entityHandlerRequest->rcvdVendorSpecificHeaderOptions &&
                     entityHandlerRequest->numRcvdVendorSpecificHeaderOptions)
             {
-                OC_LOG (INFO, TAG, "Received vendor specific options");
+                OIC_LOG (INFO, TAG, "Received vendor specific options");
                 uint8_t i = 0;
                 OCHeaderOption * rcvdOptions =
                         entityHandlerRequest->rcvdVendorSpecificHeaderOptions;
@@ -598,10 +598,10 @@ OCEntityHandlerCb (OCEntityHandlerFlag flag,
                 {
                     if(((OCHeaderOption)rcvdOptions[i]).protocolID == OC_COAP_ID)
                     {
-                        OC_LOG_V(INFO, TAG, "Received option with OC_COAP_ID and ID %u with",
+                        OIC_LOG_V(INFO, TAG, "Received option with OC_COAP_ID and ID %u with",
                                 ((OCHeaderOption)rcvdOptions[i]).optionID );
 
-                        OC_LOG_BUFFER(INFO, TAG, ((OCHeaderOption)rcvdOptions[i]).optionData,
+                        OIC_LOG_BUFFER(INFO, TAG, ((OCHeaderOption)rcvdOptions[i]).optionData,
                             MAX_HEADER_OPTION_DATA_LENGTH);
                     }
                 }
@@ -622,23 +622,23 @@ OCEntityHandlerCb (OCEntityHandlerFlag flag,
             // Send the response
             if (OCDoResponse(&response) != OC_STACK_OK)
             {
-                OC_LOG(ERROR, TAG, "Error sending response");
+                OIC_LOG(ERROR, TAG, "Error sending response");
                 ehResult = OC_EH_ERROR;
             }
         }
     }
     if (flag & OC_OBSERVE_FLAG)
     {
-        OC_LOG(INFO, TAG, "Flag includes OC_OBSERVE_FLAG");
+        OIC_LOG(INFO, TAG, "Flag includes OC_OBSERVE_FLAG");
 
         if (OC_OBSERVE_REGISTER == entityHandlerRequest->obsInfo.action)
         {
-            OC_LOG (INFO, TAG, "Received OC_OBSERVE_REGISTER from client");
+            OIC_LOG (INFO, TAG, "Received OC_OBSERVE_REGISTER from client");
             ProcessObserveRegister (entityHandlerRequest);
         }
         else if (OC_OBSERVE_DEREGISTER == entityHandlerRequest->obsInfo.action)
         {
-            OC_LOG (INFO, TAG, "Received OC_OBSERVE_DEREGISTER from client");
+            OIC_LOG (INFO, TAG, "Received OC_OBSERVE_DEREGISTER from client");
             ProcessObserveDeregister (entityHandlerRequest);
         }
     }
@@ -671,7 +671,7 @@ void *ChangeLightRepresentation (void *param)
         Light.power += 5;
         if (gLightUnderObservation)
         {
-            OC_LOG_V(INFO, TAG, " =====> Notifying stack of new power level %d\n", Light.power);
+            OIC_LOG_V(INFO, TAG, " =====> Notifying stack of new power level %d\n", Light.power);
             if (gObserveNotifyType == 1)
             {
                 // Notify list of observers. Alternate observers on the list will be notified.
@@ -696,14 +696,14 @@ void *ChangeLightRepresentation (void *param)
                 result = OCNotifyAllObservers (Light.handle, OC_NA_QOS);
                 if (OC_STACK_NO_OBSERVERS == result)
                 {
-                    OC_LOG (INFO, TAG,
+                    OIC_LOG (INFO, TAG,
                             "=======> No more observers exist, stop sending observations");
                     gLightUnderObservation = 0;
                 }
             }
             else
             {
-                OC_LOG (ERROR, TAG, "Incorrect notification type selected");
+                OIC_LOG (ERROR, TAG, "Incorrect notification type selected");
             }
         }
     }
@@ -714,7 +714,7 @@ void *ChangeLightRepresentation (void *param)
 void *presenceNotificationGenerator(void *param)
 {
     uint8_t secondsBeforePresence = 10;
-    OC_LOG_V(INFO, TAG, "Will send out presence in %u seconds", secondsBeforePresence);
+    OIC_LOG_V(INFO, TAG, "Will send out presence in %u seconds", secondsBeforePresence);
     sleep(secondsBeforePresence);
     (void)param;
     OCDoHandle presenceNotificationHandles[numPresenceResources];
@@ -742,12 +742,12 @@ void *presenceNotificationGenerator(void *param)
         }
         if(res != OC_STACK_OK)
         {
-            OC_LOG_V(ERROR, TAG, "\"Presence Notification Generator\" failed to create resource "
+            OIC_LOG_V(ERROR, TAG, "\"Presence Notification Generator\" failed to create resource "
                     "%s with result %s.", presenceNotificationResources.at(i).c_str(),
                     getResult(res));
             break;
         }
-        OC_LOG_V(INFO, TAG, PCF("Created %s for presence notification"),
+        OIC_LOG_V(INFO, TAG, PCF("Created %s for presence notification"),
                                 presenceNotificationUris[i].c_str());
     }
     sleep(5);
@@ -759,15 +759,15 @@ void *presenceNotificationGenerator(void *param)
         }
         if(res != OC_STACK_OK)
         {
-            OC_LOG_V(ERROR, TAG, "\"Presence Notification Generator\" failed to delete "\
+            OIC_LOG_V(ERROR, TAG, "\"Presence Notification Generator\" failed to delete "\
                     "resource %s.", presenceNotificationResources.at(i).c_str());
             break;
         }
-        OC_LOG_V(INFO, TAG, PCF("Deleted %s for presence notification"),
+        OIC_LOG_V(INFO, TAG, PCF("Deleted %s for presence notification"),
                                 presenceNotificationUris[i].c_str());
     }
 
-    OC_LOG(INFO, TAG, "================ stopping presence");
+    OIC_LOG(INFO, TAG, "================ stopping presence");
     OCStopPresence();
 
     return NULL;
@@ -778,7 +778,7 @@ int createLightResource (char *uri, LightResource *lightResource)
 {
     if (!uri)
     {
-        OC_LOG(ERROR, TAG, "Resource URI cannot be NULL");
+        OIC_LOG(ERROR, TAG, "Resource URI cannot be NULL");
         return -1;
     }
 
@@ -791,7 +791,7 @@ int createLightResource (char *uri, LightResource *lightResource)
             OCEntityHandlerCb,
             NULL,
             OC_DISCOVERABLE|OC_OBSERVABLE);
-    OC_LOG_V(INFO, TAG, "Created Light resource with result: %s", getResult(res));
+    OIC_LOG_V(INFO, TAG, "Created Light resource with result: %s", getResult(res));
 
     return 0;
 }
@@ -928,15 +928,15 @@ OCStackResult SetDeviceInfo(const char* deviceName)
 
 static void PrintUsage()
 {
-    OC_LOG(INFO, TAG, "Usage : ocserver -o <0|1>");
-    OC_LOG(INFO, TAG, "-o 0 : Notify all observers");
-    OC_LOG(INFO, TAG, "-o 1 : Notify list of observers");
+    OIC_LOG(INFO, TAG, "Usage : ocserver -o <0|1>");
+    OIC_LOG(INFO, TAG, "-o 0 : Notify all observers");
+    OIC_LOG(INFO, TAG, "-o 1 : Notify list of observers");
 }
 
 #ifdef RA_ADAPTER
 static void jidbound(char *jid)
 {
-    OC_LOG_V(INFO, TAG, "\n\n    Bound JID: %s\n\n", jid);
+    OIC_LOG_V(INFO, TAG, "\n\n    Bound JID: %s\n\n", jid);
 }
 #endif
 
@@ -1007,17 +1007,17 @@ int main(int argc, char* argv[])
     OCSetRAInfo(&rainfo);
 #endif
 
-    OC_LOG(DEBUG, TAG, "OCServer is starting...");
+    OIC_LOG(DEBUG, TAG, "OCServer is starting...");
 
     if (OCInit(NULL, 0, OC_SERVER) != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack init error");
+        OIC_LOG(ERROR, TAG, "OCStack init error");
         return 0;
     }
 #ifdef WITH_PRESENCE
     if (OCStartPresence(0) != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack presence/discovery error");
+        OIC_LOG(ERROR, TAG, "OCStack presence/discovery error");
         return 0;
     }
 #endif
@@ -1031,7 +1031,7 @@ int main(int argc, char* argv[])
 
     if (registrationResult != OC_STACK_OK)
     {
-        OC_LOG(INFO, TAG, "Platform info setting failed locally!");
+        OIC_LOG(INFO, TAG, "Platform info setting failed locally!");
         exit (EXIT_FAILURE);
     }
 
@@ -1039,7 +1039,7 @@ int main(int argc, char* argv[])
 
     if (registrationResult != OC_STACK_OK)
     {
-        OC_LOG(INFO, TAG, "Platform Registration failed!");
+        OIC_LOG(INFO, TAG, "Platform Registration failed!");
         exit (EXIT_FAILURE);
     }
 
@@ -1047,7 +1047,7 @@ int main(int argc, char* argv[])
 
     if (registrationResult != OC_STACK_OK)
     {
-        OC_LOG(INFO, TAG, "Device info setting failed locally!");
+        OIC_LOG(INFO, TAG, "Device info setting failed locally!");
         exit (EXIT_FAILURE);
     }
 
@@ -1055,7 +1055,7 @@ int main(int argc, char* argv[])
 
     if (registrationResult != OC_STACK_OK)
     {
-        OC_LOG(INFO, TAG, "Device Registration failed!");
+        OIC_LOG(INFO, TAG, "Device Registration failed!");
         exit (EXIT_FAILURE);
     }
 
@@ -1081,7 +1081,7 @@ int main(int argc, char* argv[])
     #endif
 
     // Break from loop with Ctrl-C
-    OC_LOG(INFO, TAG, "Entering ocserver main loop...");
+    OIC_LOG(INFO, TAG, "Entering ocserver main loop...");
 
     DeletePlatformInfo();
     DeleteDeviceInfo();
@@ -1092,7 +1092,7 @@ int main(int argc, char* argv[])
     {
         if (OCProcess() != OC_STACK_OK)
         {
-            OC_LOG(ERROR, TAG, "OCStack process error");
+            OIC_LOG(ERROR, TAG, "OCStack process error");
             return 0;
         }
     }
@@ -1106,11 +1106,11 @@ int main(int argc, char* argv[])
     pthread_cancel(threadId_presence);
     pthread_join(threadId_presence, NULL);
 
-    OC_LOG(INFO, TAG, "Exiting ocserver main loop...");
+    OIC_LOG(INFO, TAG, "Exiting ocserver main loop...");
 
     if (OCStop() != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack process error");
+        OIC_LOG(ERROR, TAG, "OCStack process error");
     }
 
     return 0;
index 2c3cfdb..9c4aef5 100644 (file)
@@ -49,7 +49,7 @@ OCRepPayload* getPayload(const char* uri, int64_t power, bool state)
     OCRepPayload* payload = OCRepPayloadCreate();
     if(!payload)
     {
-        OC_LOG(ERROR, TAG, PCF("Failed to allocate Payload"));
+        OIC_LOG(ERROR, TAG, PCF("Failed to allocate Payload"));
         return nullptr;
     }
 
@@ -65,7 +65,7 @@ OCRepPayload* constructResponse (OCEntityHandlerRequest *ehRequest)
 {
     if(ehRequest->payload && ehRequest->payload->type != PAYLOAD_TYPE_REPRESENTATION)
     {
-        OC_LOG(ERROR, TAG, PCF("Incoming payload not a representation"));
+        OIC_LOG(ERROR, TAG, PCF("Incoming payload not a representation"));
         return nullptr;
     }
 
@@ -172,7 +172,7 @@ OCEntityHandlerResult ProcessPostRequest (OCEntityHandlerRequest *ehRequest,
 
             if (0 == createLEDResource (newLedUri, &gLedInstance[gCurrLedInstance], false, 0))
             {
-                OC_LOG (INFO, TAG, "Created new LED instance");
+                OIC_LOG (INFO, TAG, "Created new LED instance");
                 gLedInstance[gCurrLedInstance].state = 0;
                 gLedInstance[gCurrLedInstance].power = 0;
                 gCurrLedInstance++;
@@ -211,7 +211,7 @@ OCEntityHandlerResult ProcessPostRequest (OCEntityHandlerRequest *ehRequest,
     }
     else
     {
-        OC_LOG_V (INFO, TAG, "Payload was NULL");
+        OIC_LOG_V (INFO, TAG, "Payload was NULL");
         ehResult = OC_EH_ERROR;
     }
 
@@ -223,7 +223,7 @@ OCEntityHandlerCb (OCEntityHandlerFlag flag,
                    OCEntityHandlerRequest *entityHandlerRequest,
                    void* /*callbackParam*/)
 {
-    OC_LOG_V (INFO, TAG, "Inside entity handler - flags: 0x%x", flag);
+    OIC_LOG_V (INFO, TAG, "Inside entity handler - flags: 0x%x", flag);
 
     OCEntityHandlerResult ehResult = OC_EH_ERROR;
     OCEntityHandlerResponse response = { 0, 0, OC_EH_ERROR, 0, 0, { },{ 0 }, false };
@@ -231,7 +231,7 @@ OCEntityHandlerCb (OCEntityHandlerFlag flag,
     // Validate pointer
     if (!entityHandlerRequest)
     {
-        OC_LOG (ERROR, TAG, "Invalid request pointer");
+        OIC_LOG (ERROR, TAG, "Invalid request pointer");
         return OC_EH_ERROR;
     }
 
@@ -239,27 +239,27 @@ OCEntityHandlerCb (OCEntityHandlerFlag flag,
 
     if (flag & OC_REQUEST_FLAG)
     {
-        OC_LOG (INFO, TAG, "Flag includes OC_REQUEST_FLAG");
+        OIC_LOG (INFO, TAG, "Flag includes OC_REQUEST_FLAG");
         if (entityHandlerRequest)
         {
             if (OC_REST_GET == entityHandlerRequest->method)
             {
-                OC_LOG (INFO, TAG, "Received OC_REST_GET from client");
+                OIC_LOG (INFO, TAG, "Received OC_REST_GET from client");
                 ehResult = ProcessGetRequest (entityHandlerRequest, &payload);
             }
             else if (OC_REST_PUT == entityHandlerRequest->method)
             {
-                OC_LOG (INFO, TAG, "Received OC_REST_PUT from client");
+                OIC_LOG (INFO, TAG, "Received OC_REST_PUT from client");
                 ehResult = ProcessPutRequest (entityHandlerRequest, &payload);
             }
             else if (OC_REST_POST == entityHandlerRequest->method)
             {
-                OC_LOG (INFO, TAG, "Received OC_REST_POST from client");
+                OIC_LOG (INFO, TAG, "Received OC_REST_POST from client");
                 ehResult = ProcessPostRequest (entityHandlerRequest, &response, &payload);
             }
             else
             {
-                OC_LOG_V (INFO, TAG, "Received unsupported method %d from client",
+                OIC_LOG_V (INFO, TAG, "Received unsupported method %d from client",
                         entityHandlerRequest->method);
             }
 
@@ -279,7 +279,7 @@ OCEntityHandlerCb (OCEntityHandlerFlag flag,
                 // Send the response
                 if (OCDoResponse(&response) != OC_STACK_OK)
                 {
-                    OC_LOG(ERROR, TAG, "Error sending response");
+                    OIC_LOG(ERROR, TAG, "Error sending response");
                     ehResult = OC_EH_ERROR;
                 }
             }
@@ -301,10 +301,10 @@ void handleSigInt(int signum)
 
 int main(int /*argc*/, char* /*argv*/[])
 {
-    OC_LOG(DEBUG, TAG, "OCServer is starting...");
+    OIC_LOG(DEBUG, TAG, "OCServer is starting...");
     if (OCInit(NULL, 0, OC_SERVER) != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack init error");
+        OIC_LOG(ERROR, TAG, "OCStack init error");
         return 0;
     }
 
@@ -314,24 +314,24 @@ int main(int /*argc*/, char* /*argv*/[])
     createLEDResource(gResourceUri, &LED, false, 0);
 
     // Break from loop with Ctrl-C
-    OC_LOG(INFO, TAG, "Entering ocserver main loop...");
+    OIC_LOG(INFO, TAG, "Entering ocserver main loop...");
     signal(SIGINT, handleSigInt);
     while (!gQuitFlag)
     {
         if (OCProcess() != OC_STACK_OK)
         {
-            OC_LOG(ERROR, TAG, "OCStack process error");
+            OIC_LOG(ERROR, TAG, "OCStack process error");
             return 0;
         }
 
         sleep(2);
     }
 
-    OC_LOG(INFO, TAG, "Exiting ocserver main loop...");
+    OIC_LOG(INFO, TAG, "Exiting ocserver main loop...");
 
     if (OCStop() != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack process error");
+        OIC_LOG(ERROR, TAG, "OCStack process error");
     }
 
     return 0;
@@ -341,7 +341,7 @@ int createLEDResource (char *uri, LEDResource *ledResource, bool resourceState,
 {
     if (!uri)
     {
-        OC_LOG(ERROR, TAG, "Resource URI cannot be NULL");
+        OIC_LOG(ERROR, TAG, "Resource URI cannot be NULL");
         return -1;
     }
 
@@ -354,7 +354,7 @@ int createLEDResource (char *uri, LEDResource *ledResource, bool resourceState,
             OCEntityHandlerCb,
             NULL,
             OC_DISCOVERABLE|OC_OBSERVABLE);
-    OC_LOG_V(INFO, TAG, "Created LED resource with result: %s", getResult(res));
+    OIC_LOG_V(INFO, TAG, "Created LED resource with result: %s", getResult(res));
 
     return 0;
 }
index eca2ad1..792b7d2 100644 (file)
@@ -59,10 +59,10 @@ typedef enum
 
 void PrintUsage()
 {
-    OC_LOG(INFO, TAG, "Usage : ocservercoll -t <Test Case>");
-    OC_LOG(INFO, TAG,
+    OIC_LOG(INFO, TAG, "Usage : ocservercoll -t <Test Case>");
+    OIC_LOG(INFO, TAG,
             "Test Case 1 : Create room resource with default collection entity handler.");
-    OC_LOG(INFO, TAG,
+    OIC_LOG(INFO, TAG,
             "Test Case 2 : Create room resource with application collection entity handler.");
 }
 
@@ -99,7 +99,7 @@ PrintReceivedMsgInfo(OCEntityHandlerFlag flag, OCEntityHandlerRequest * ehReques
         typeOfMethod = "OC_REST_PUT";
     }
 
-    OC_LOG_V(INFO, TAG, "Receiving message type: %s, method %s", typeOfMessage,
+    OIC_LOG_V(INFO, TAG, "Receiving message type: %s, method %s", typeOfMessage,
             typeOfMethod);
 }
 
@@ -108,25 +108,25 @@ OCEntityHandlerResult
 OCDeviceEntityHandlerCb (OCEntityHandlerFlag flag,
         OCEntityHandlerRequest *entityHandlerRequest, char* uri, void* /*callbackParam*/)
 {
-    OC_LOG_V(INFO, TAG, "Inside device default entity handler - flags: 0x%x, uri: %s", flag, uri);
+    OIC_LOG_V(INFO, TAG, "Inside device default entity handler - flags: 0x%x, uri: %s", flag, uri);
 
     OCEntityHandlerResult ehResult = OC_EH_OK;
     OCEntityHandlerResponse response;
 
     if (!entityHandlerRequest)
     {
-        OC_LOG(ERROR, TAG, "Invalid request pointer");
+        OIC_LOG(ERROR, TAG, "Invalid request pointer");
         return OC_EH_ERROR;
     }
 
     if (entityHandlerRequest->resource == NULL)
     {
-        OC_LOG(INFO, TAG, "Received request from client to a non-existing resource");
+        OIC_LOG(INFO, TAG, "Received request from client to a non-existing resource");
         ehResult = OC_EH_RESOURCE_NOT_FOUND;
     }
     else
     {
-        OC_LOG_V(INFO, TAG, "Device Handler: Received unsupported request from client %d",
+        OIC_LOG_V(INFO, TAG, "Device Handler: Received unsupported request from client %d",
                         entityHandlerRequest->method);
         ehResult = OC_EH_ERROR;
     }
@@ -147,7 +147,7 @@ OCDeviceEntityHandlerCb (OCEntityHandlerFlag flag,
         // Send the response
         if (OCDoResponse(&response) != OC_STACK_OK)
         {
-            OC_LOG(ERROR, TAG, "Error sending response");
+            OIC_LOG(ERROR, TAG, "Error sending response");
             ehResult = OC_EH_ERROR;
         }
     }
@@ -161,7 +161,7 @@ OCEntityHandlerResult OCEntityHandlerRoomCb(OCEntityHandlerFlag flag,
     OCEntityHandlerResult ret = OC_EH_OK;
     OCEntityHandlerResponse response;
 
-    OC_LOG_V(INFO, TAG, "Callback for Room");
+    OIC_LOG_V(INFO, TAG, "Callback for Room");
     PrintReceivedMsgInfo(flag, ehRequest );
 
     if(ehRequest && flag == OC_REQUEST_FLAG )
@@ -229,7 +229,7 @@ OCEntityHandlerResult OCEntityHandlerRoomCb(OCEntityHandlerFlag flag,
                 // Send the response
                 if (OCDoResponse(&response) != OC_STACK_OK)
                 {
-                    OC_LOG(ERROR, TAG, "Error sending response");
+                    OIC_LOG(ERROR, TAG, "Error sending response");
                     ret = OC_EH_ERROR;
                 }
             }
@@ -302,14 +302,14 @@ OCEntityHandlerResult OCEntityHandlerRoomCb(OCEntityHandlerFlag flag,
                 // Send the response
                 if (OCDoResponse(&response) != OC_STACK_OK)
                 {
-                    OC_LOG(ERROR, TAG, "Error sending response");
+                    OIC_LOG(ERROR, TAG, "Error sending response");
                     ret = OC_EH_ERROR;
                 }
             }
         }
         else
         {
-            OC_LOG_V (INFO, TAG, "Received unsupported method %d from client",
+            OIC_LOG_V (INFO, TAG, "Received unsupported method %d from client",
                     ehRequest->method);
             OCRepPayloadDestroy(payload);
             ret = OC_EH_ERROR;
@@ -328,7 +328,7 @@ OCEntityHandlerResult OCEntityHandlerLightCb(OCEntityHandlerFlag flag,
     OCEntityHandlerResult ret = OC_EH_OK;
     OCEntityHandlerResponse response;
 
-    OC_LOG_V(INFO, TAG, "Callback for Light");
+    OIC_LOG_V(INFO, TAG, "Callback for Light");
     PrintReceivedMsgInfo(flag, ehRequest );
 
     if(ehRequest && flag == OC_REQUEST_FLAG)
@@ -348,7 +348,7 @@ OCEntityHandlerResult OCEntityHandlerLightCb(OCEntityHandlerFlag flag,
         }
         else
         {
-            OC_LOG_V (INFO, TAG, "Received unsupported method %d from client",
+            OIC_LOG_V (INFO, TAG, "Received unsupported method %d from client",
                     ehRequest->method);
             ret = OC_EH_ERROR;
         }
@@ -370,7 +370,7 @@ OCEntityHandlerResult OCEntityHandlerLightCb(OCEntityHandlerFlag flag,
             // Send the response
             if (OCDoResponse(&response) != OC_STACK_OK)
             {
-                OC_LOG(ERROR, TAG, "Error sending response");
+                OIC_LOG(ERROR, TAG, "Error sending response");
                 ret = OC_EH_ERROR;
             }
         }
@@ -393,7 +393,7 @@ OCEntityHandlerResult OCEntityHandlerFanCb(OCEntityHandlerFlag flag,
     OCEntityHandlerResult ret = OC_EH_OK;
     OCEntityHandlerResponse response;
 
-    OC_LOG_V(INFO, TAG, "Callback for Fan");
+    OIC_LOG_V(INFO, TAG, "Callback for Fan");
     PrintReceivedMsgInfo(flag, ehRequest );
 
     if(ehRequest && flag == OC_REQUEST_FLAG)
@@ -414,7 +414,7 @@ OCEntityHandlerResult OCEntityHandlerFanCb(OCEntityHandlerFlag flag,
         }
         else
         {
-            OC_LOG_V (INFO, TAG, "Received unsupported method %d from client",
+            OIC_LOG_V (INFO, TAG, "Received unsupported method %d from client",
                     ehRequest->method);
             ret = OC_EH_ERROR;
         }
@@ -436,7 +436,7 @@ OCEntityHandlerResult OCEntityHandlerFanCb(OCEntityHandlerFlag flag,
             // Send the response
             if (OCDoResponse(&response) != OC_STACK_OK)
             {
-                OC_LOG(ERROR, TAG, "Error sending response");
+                OIC_LOG(ERROR, TAG, "Error sending response");
                 ret = OC_EH_ERROR;
             }
         }
@@ -471,7 +471,7 @@ void *ChangeLightRepresentation (void *param)
         light.power += 5;
         if (gLightUnderObservation)
         {
-            OC_LOG_V(INFO, TAG,
+            OIC_LOG_V(INFO, TAG,
                 " =====> Notifying stack of new power level %d\n", light.power);
             result = OCNotifyAllObservers (light.handle, OC_NA_QOS);
             if (OC_STACK_NO_OBSERVERS == result)
@@ -506,11 +506,11 @@ int main(int argc, char* argv[])
         return -1;
     }
 
-    OC_LOG(DEBUG, TAG, "OCServer is starting...");
+    OIC_LOG(DEBUG, TAG, "OCServer is starting...");
 
     if (OCInit(NULL, 0, OC_SERVER) != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack init error");
+        OIC_LOG(ERROR, TAG, "OCStack init error");
         return 0;
     }
 
@@ -527,13 +527,13 @@ int main(int argc, char* argv[])
     pthread_create (&threadId, NULL, ChangeLightRepresentation, (void *)NULL);
 
     // Break from loop with Ctrl-C
-    OC_LOG(INFO, TAG, "Entering ocserver main loop...");
+    OIC_LOG(INFO, TAG, "Entering ocserver main loop...");
     signal(SIGINT, handleSigInt);
     while (!gQuitFlag)
     {
         if (OCProcess() != OC_STACK_OK)
         {
-            OC_LOG(ERROR, TAG, "OCStack process error");
+            OIC_LOG(ERROR, TAG, "OCStack process error");
             return 0;
         }
         sleep(2);
@@ -545,11 +545,11 @@ int main(int argc, char* argv[])
     pthread_cancel(threadId);
     pthread_join(threadId, NULL);
 
-    OC_LOG(INFO, TAG, "Exiting ocserver main loop...");
+    OIC_LOG(INFO, TAG, "Exiting ocserver main loop...");
 
     if (OCStop() != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack process error");
+        OIC_LOG(ERROR, TAG, "OCStack process error");
     }
 
     return 0;
@@ -567,7 +567,7 @@ void createResources()
             OCEntityHandlerFanCb,
             NULL,
             OC_DISCOVERABLE|OC_OBSERVABLE);
-    OC_LOG_V(INFO, TAG, "Created fan resource with result: %s", getResult(res));
+    OIC_LOG_V(INFO, TAG, "Created fan resource with result: %s", getResult(res));
 
     OCResourceHandle light;
     res = OCCreateResource(&light,
@@ -577,7 +577,7 @@ void createResources()
             OCEntityHandlerLightCb,
             NULL,
             OC_DISCOVERABLE|OC_OBSERVABLE);
-    OC_LOG_V(INFO, TAG, "Created light resource with result: %s", getResult(res));
+    OIC_LOG_V(INFO, TAG, "Created light resource with result: %s", getResult(res));
 
     OCResourceHandle room;
 
@@ -602,14 +602,14 @@ void createResources()
                 OC_DISCOVERABLE);
     }
 
-    OC_LOG_V(INFO, TAG, "Created room resource with result: %s", getResult(res));
+    OIC_LOG_V(INFO, TAG, "Created room resource with result: %s", getResult(res));
     OCBindResourceInterfaceToResource(room, OC_RSRVD_INTERFACE_LL);
     OCBindResourceInterfaceToResource(room, OC_RSRVD_INTERFACE_DEFAULT);
 
     res = OCBindResource(room, light);
-    OC_LOG_V(INFO, TAG, "OC Bind Contained Resource to resource: %s", getResult(res));
+    OIC_LOG_V(INFO, TAG, "OC Bind Contained Resource to resource: %s", getResult(res));
 
     res = OCBindResource(room, fan);
-    OC_LOG_V(INFO, TAG, "OC Bind Contained Resource to resource: %s", getResult(res));
+    OIC_LOG_V(INFO, TAG, "OC Bind Contained Resource to resource: %s", getResult(res));
 }
 
index 3858b23..e56e144 100644 (file)
@@ -54,17 +54,17 @@ OCRepPayload* constructResponse (OCEntityHandlerRequest *ehRequest)
 {
     LEDResource *currLEDResource = &LED;
 
-    OC_LOG(INFO, TAG, "Entering constructResponse");
+    OIC_LOG(INFO, TAG, "Entering constructResponse");
 
     if (ehRequest->resource == gLedInstance[0].handle)
     {
-        OC_LOG(INFO, TAG, "handle 0");
+        OIC_LOG(INFO, TAG, "handle 0");
         currLEDResource = &gLedInstance[0];
         gResourceUri = const_cast<char *>("a/led/0");
     }
     else if (ehRequest->resource == gLedInstance[1].handle)
     {
-        OC_LOG(INFO, TAG, "handle 1");
+        OIC_LOG(INFO, TAG, "handle 1");
         currLEDResource = &gLedInstance[1];
         gResourceUri = const_cast<char *>("a/led/1");
     }
@@ -73,7 +73,7 @@ OCRepPayload* constructResponse (OCEntityHandlerRequest *ehRequest)
     {
         if(ehRequest->payload && ehRequest->payload->type != PAYLOAD_TYPE_REPRESENTATION)
         {
-            OC_LOG(ERROR, TAG, ("Incoming payload not a representation"));
+            OIC_LOG(ERROR, TAG, ("Incoming payload not a representation"));
             return nullptr;
         }
 
@@ -96,7 +96,7 @@ OCRepPayload* constructResponse (OCEntityHandlerRequest *ehRequest)
 
     if (!response)
     {
-        OC_LOG_V(ERROR, TAG, "Memory allocation for response payload failed.");
+        OIC_LOG_V(ERROR, TAG, "Memory allocation for response payload failed.");
     }
 
     OCRepPayloadSetUri (response, gResourceUri);
@@ -108,13 +108,13 @@ OCRepPayload* constructResponse (OCEntityHandlerRequest *ehRequest)
 
 void ProcessGetPutRequest (OCEntityHandlerRequest *ehRequest)
 {
-    OC_LOG(INFO, TAG, "Entering ProcessGetPutRequest");
+    OIC_LOG(INFO, TAG, "Entering ProcessGetPutRequest");
 
     OCRepPayload *getResp = constructResponse(ehRequest);
 
     if(!getResp)
     {
-        OC_LOG(ERROR, TAG, "Failed to construct response");
+        OIC_LOG(ERROR, TAG, "Failed to construct response");
         return;
     }
 
@@ -135,7 +135,7 @@ void ProcessGetPutRequest (OCEntityHandlerRequest *ehRequest)
     // Send the response
     if (OCDoResponse(&response) != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "Error sending response");
+        OIC_LOG(ERROR, TAG, "Error sending response");
     }
 
     free(getResp);
@@ -143,7 +143,7 @@ void ProcessGetPutRequest (OCEntityHandlerRequest *ehRequest)
 
 OCEntityHandlerRequest *CopyRequest(OCEntityHandlerRequest *entityHandlerRequest)
 {
-    OC_LOG(INFO, TAG, "Copying received request for slow response");
+    OIC_LOG(INFO, TAG, "Copying received request for slow response");
 
     OCEntityHandlerRequest *copyOfRequest =
             (OCEntityHandlerRequest *)OICMalloc(sizeof(OCEntityHandlerRequest));
@@ -159,7 +159,7 @@ OCEntityHandlerRequest *CopyRequest(OCEntityHandlerRequest *entityHandlerRequest
             copyOfRequest->query = OICStrdup(entityHandlerRequest->query);
             if(!copyOfRequest->query)
             {
-                OC_LOG(ERROR, TAG, "Copy failed due to allocation failure");
+                OIC_LOG(ERROR, TAG, "Copy failed due to allocation failure");
                 OICFree(copyOfRequest);
                 return NULL;
             }
@@ -178,11 +178,11 @@ OCEntityHandlerRequest *CopyRequest(OCEntityHandlerRequest *entityHandlerRequest
 
     if (copyOfRequest)
     {
-        OC_LOG(INFO, TAG, "Copied client request");
+        OIC_LOG(INFO, TAG, "Copied client request");
     }
     else
     {
-        OC_LOG(ERROR, TAG, "Error copying client request");
+        OIC_LOG(ERROR, TAG, "Error copying client request");
     }
     return copyOfRequest;
 }
@@ -193,16 +193,16 @@ OCEntityHandlerResult OCEntityHandlerCb (OCEntityHandlerFlag flag,
     OCEntityHandlerResult result = OC_EH_ERROR;
     OCEntityHandlerRequest *request = NULL;
 
-    OC_LOG_V (INFO, TAG, "Inside entity handler - flags: 0x%x", flag);
+    OIC_LOG_V (INFO, TAG, "Inside entity handler - flags: 0x%x", flag);
 
     if (flag & OC_REQUEST_FLAG)
     {
-        OC_LOG(INFO, TAG, "Flag includes OC_REQUEST_FLAG");
+        OIC_LOG(INFO, TAG, "Flag includes OC_REQUEST_FLAG");
         if (entityHandlerRequest)
         {
-            OC_LOG_V (INFO, TAG, "request query %s from client",
+            OIC_LOG_V (INFO, TAG, "request query %s from client",
                                         entityHandlerRequest->query);
-            OC_LOG_PAYLOAD (INFO, entityHandlerRequest->payload);
+            OIC_LOG_PAYLOAD (INFO, entityHandlerRequest->payload);
 
             // Make deep copy of received request and queue it for slow processing
             request = CopyRequest(entityHandlerRequest);
@@ -210,7 +210,7 @@ OCEntityHandlerResult OCEntityHandlerCb (OCEntityHandlerFlag flag,
             if (request)
             {
 
-                OC_LOG(INFO, TAG, "Scheduling slow response for received request");
+                OIC_LOG(INFO, TAG, "Scheduling slow response for received request");
                 gRequestList.push_back(request);
                 // Indicate to the stack that this is a slow response
                 result = OC_EH_SLOW;
@@ -219,14 +219,14 @@ OCEntityHandlerResult OCEntityHandlerCb (OCEntityHandlerFlag flag,
             }
             else
             {
-                OC_LOG(ERROR, TAG, "Error queuing request for slow response");
+                OIC_LOG(ERROR, TAG, "Error queuing request for slow response");
                 // Indicate to the stack that this is a slow response
                 result = OC_EH_ERROR;
             }
         }
         else
         {
-            OC_LOG(ERROR, TAG, "Invalid request");
+            OIC_LOG(ERROR, TAG, "Invalid request");
             result = OC_EH_ERROR;
         }
     }
@@ -248,10 +248,10 @@ void AlarmHandler(int sig)
 {
     if (sig == SIGALRM)
     {
-        OC_LOG (INFO, TAG, "Server starting slow response");
+        OIC_LOG (INFO, TAG, "Server starting slow response");
         if (gRequestList.empty())
         {
-            OC_LOG (INFO, TAG, "No requests to service");
+            OIC_LOG (INFO, TAG, "No requests to service");
             return;
         }
 
@@ -260,17 +260,17 @@ void AlarmHandler(int sig)
         gRequestList.pop_front();
         if (entityHandlerRequest->method == OC_REST_GET)
         {
-            OC_LOG (INFO, TAG, "Received OC_REST_GET from client");
+            OIC_LOG (INFO, TAG, "Received OC_REST_GET from client");
             ProcessGetPutRequest (entityHandlerRequest);
         }
         else if (entityHandlerRequest->method == OC_REST_PUT)
         {
-            OC_LOG (INFO, TAG, "Received OC_REST_PUT from client");
+            OIC_LOG (INFO, TAG, "Received OC_REST_PUT from client");
             ProcessGetPutRequest (entityHandlerRequest);
         }
         else
         {
-            OC_LOG_V (INFO, TAG, "Received unsupported method %d from client",
+            OIC_LOG_V (INFO, TAG, "Received unsupported method %d from client",
                     entityHandlerRequest->method);
         }
         // Free the request
@@ -288,11 +288,11 @@ void AlarmHandler(int sig)
 
 int main(int /*argc*/, char** /*argv[]*/)
 {
-    OC_LOG(DEBUG, TAG, "OCServer is starting...");
+    OIC_LOG(DEBUG, TAG, "OCServer is starting...");
 
     if (OCInit(NULL, 0, OC_SERVER) != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack init error");
+        OIC_LOG(ERROR, TAG, "OCStack init error");
         return 0;
     }
 
@@ -303,20 +303,20 @@ int main(int /*argc*/, char** /*argv[]*/)
     signal(SIGALRM, AlarmHandler);
 
     // Break from loop with Ctrl-C
-    OC_LOG(INFO, TAG, "Entering ocserver main loop...");
+    OIC_LOG(INFO, TAG, "Entering ocserver main loop...");
     signal(SIGINT, handleSigInt);
 
     while (!gQuitFlag)
     {
         if (OCProcess() != OC_STACK_OK)
         {
-            OC_LOG(ERROR, TAG, "OCStack process error");
+            OIC_LOG(ERROR, TAG, "OCStack process error");
             return 0;
         }
         sleep(2);
     }
 
-    OC_LOG(INFO, TAG, "Exiting ocserver main loop...");
+    OIC_LOG(INFO, TAG, "Exiting ocserver main loop...");
 
     // Free requests
     if (!gRequestList.empty())
@@ -332,7 +332,7 @@ int main(int /*argc*/, char** /*argv[]*/)
 
     if (OCStop() != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack process error");
+        OIC_LOG(ERROR, TAG, "OCStack process error");
     }
 
     return 0;
@@ -342,7 +342,7 @@ int createLEDResource (char *uri, LEDResource *ledResource, bool resourceState,
 {
     if (!uri)
     {
-        OC_LOG(ERROR, TAG, "Resource URI cannot be NULL");
+        OIC_LOG(ERROR, TAG, "Resource URI cannot be NULL");
         return -1;
     }
 
@@ -355,7 +355,7 @@ int createLEDResource (char *uri, LEDResource *ledResource, bool resourceState,
             OCEntityHandlerCb,
             NULL,
             OC_DISCOVERABLE|OC_OBSERVABLE);
-    OC_LOG_V(INFO, TAG, "Created LED resource with result: %s", getResult(res));
+    OIC_LOG_V(INFO, TAG, "Created LED resource with result: %s", getResult(res));
 
     return 0;
 }
index c22d371..d7755bf 100644 (file)
@@ -37,7 +37,7 @@ int main(int /*argc*/, char* /*argv*/[])
 {
     struct timespec timeout;
 
-    OC_LOG(DEBUG, TAG, "OCAMS service is starting...");
+    OIC_LOG(DEBUG, TAG, "OCAMS service is starting...");
 
     // Initialize Persistent Storage for SVR database
     OCPersistentStorage ps = { service_fopen, fread, fwrite, fclose, unlink };
@@ -45,7 +45,7 @@ int main(int /*argc*/, char* /*argv*/[])
 
     if (OCInit(NULL, 0, OC_SERVER) != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack init error");
+        OIC_LOG(ERROR, TAG, "OCStack init error");
         return 0;
     }
 
@@ -53,23 +53,23 @@ int main(int /*argc*/, char* /*argv*/[])
     timeout.tv_nsec = 100000000L;
 
     // Break from loop with Ctrl-C
-    OC_LOG(INFO, TAG, "Entering ocamsservice main loop...");
+    OIC_LOG(INFO, TAG, "Entering ocamsservice main loop...");
     signal(SIGINT, handleSigInt);
     while (!gQuitFlag)
     {
         if (OCProcess() != OC_STACK_OK)
         {
-            OC_LOG(ERROR, TAG, "OCStack process error");
+            OIC_LOG(ERROR, TAG, "OCStack process error");
             return 0;
         }
         nanosleep(&timeout, NULL);
     }
 
-    OC_LOG(INFO, TAG, "Exiting ocamsservice main loop...");
+    OIC_LOG(INFO, TAG, "Exiting ocamsservice main loop...");
 
     if (OCStop() != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack process error");
+        OIC_LOG(ERROR, TAG, "OCStack process error");
     }
 
     return 0;
index c72458a..38aefe1 100644 (file)
@@ -81,14 +81,14 @@ OCPayload* putPayload()
 
 static void PrintUsage()
 {
-    OC_LOG(INFO, TAG, "Usage : occlient -u <0|1> -t <1|2|3> -c <0|1>");
-    OC_LOG(INFO, TAG, "-u <0|1> : Perform multicast/unicast discovery of resources");
-    OC_LOG(INFO, TAG, "-t 1 : Discover Resources");
-    OC_LOG(INFO, TAG, "-t 2 : Discover Resources and"
+    OIC_LOG(INFO, TAG, "Usage : occlient -u <0|1> -t <1|2|3> -c <0|1>");
+    OIC_LOG(INFO, TAG, "-u <0|1> : Perform multicast/unicast discovery of resources");
+    OIC_LOG(INFO, TAG, "-t 1 : Discover Resources");
+    OIC_LOG(INFO, TAG, "-t 2 : Discover Resources and"
             " Initiate Nonconfirmable Get/Put/Post Requests");
-    OC_LOG(INFO, TAG, "-t 3 : Discover Resources and Initiate Confirmable Get/Put/Post Requests");
-    OC_LOG(INFO, TAG, "-c 0 : Default auto-selection");
-    OC_LOG(INFO, TAG, "-c 1 : IP Connectivity Type");
+    OIC_LOG(INFO, TAG, "-t 3 : Discover Resources and Initiate Confirmable Get/Put/Post Requests");
+    OIC_LOG(INFO, TAG, "-c 0 : Default auto-selection");
+    OIC_LOG(INFO, TAG, "-c 1 : IP Connectivity Type");
 }
 
 OCStackResult InvokeOCDoResource(std::ostringstream &query,
@@ -111,7 +111,7 @@ OCStackResult InvokeOCDoResource(std::ostringstream &query,
 
     if (ret != OC_STACK_OK)
     {
-        OC_LOG_V(ERROR, TAG, "OCDoResource returns error %d with method %d", ret, method);
+        OIC_LOG_V(ERROR, TAG, "OCDoResource returns error %d with method %d", ret, method);
     }
 
     return ret;
@@ -119,40 +119,40 @@ OCStackResult InvokeOCDoResource(std::ostringstream &query,
 
 OCStackApplicationResult putReqCB(void*, OCDoHandle, OCClientResponse * clientResponse)
 {
-    OC_LOG(INFO, TAG, "Callback Context for PUT recvd successfully");
+    OIC_LOG(INFO, TAG, "Callback Context for PUT recvd successfully");
 
     if(clientResponse)
     {
-        OC_LOG_V(INFO, TAG, "StackResult: %s",  getResult(clientResponse->result));
-        OC_LOG_PAYLOAD(INFO, clientResponse->payload);
-        OC_LOG(INFO, TAG, ("=============> Put Response"));
+        OIC_LOG_V(INFO, TAG, "StackResult: %s",  getResult(clientResponse->result));
+        OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
+        OIC_LOG(INFO, TAG, ("=============> Put Response"));
     }
     return OC_STACK_DELETE_TRANSACTION;
 }
 
 OCStackApplicationResult postReqCB(void *, OCDoHandle, OCClientResponse *clientResponse)
 {
-    OC_LOG(INFO, TAG, "Callback Context for POST recvd successfully");
+    OIC_LOG(INFO, TAG, "Callback Context for POST recvd successfully");
 
     if(clientResponse)
     {
-        OC_LOG_V(INFO, TAG, "StackResult: %s",  getResult(clientResponse->result));
-        OC_LOG_PAYLOAD(INFO, clientResponse->payload);
-        OC_LOG(INFO, TAG, ("=============> Post Response"));
+        OIC_LOG_V(INFO, TAG, "StackResult: %s",  getResult(clientResponse->result));
+        OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
+        OIC_LOG(INFO, TAG, ("=============> Post Response"));
     }
     return OC_STACK_DELETE_TRANSACTION;
 }
 
 OCStackApplicationResult getReqCB(void*, OCDoHandle, OCClientResponse * clientResponse)
 {
-    OC_LOG(INFO, TAG, "Callback Context for GET query recvd successfully");
+    OIC_LOG(INFO, TAG, "Callback Context for GET query recvd successfully");
 
     if(clientResponse)
     {
-        OC_LOG_V(INFO, TAG, "StackResult: %s",  getResult(clientResponse->result));
-        OC_LOG_V(INFO, TAG, "SEQUENCE NUMBER: %d", clientResponse->sequenceNumber);
-        OC_LOG_PAYLOAD(INFO, clientResponse->payload);
-        OC_LOG(INFO, TAG, ("=============> Get Response"));
+        OIC_LOG_V(INFO, TAG, "StackResult: %s",  getResult(clientResponse->result));
+        OIC_LOG_V(INFO, TAG, "SEQUENCE NUMBER: %d", clientResponse->sequenceNumber);
+        OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
+        OIC_LOG(INFO, TAG, ("=============> Get Response"));
     }
     return OC_STACK_DELETE_TRANSACTION;
 }
@@ -161,19 +161,19 @@ OCStackApplicationResult getReqCB(void*, OCDoHandle, OCClientResponse * clientRe
 OCStackApplicationResult discoveryReqCB(void*, OCDoHandle,
         OCClientResponse * clientResponse)
 {
-    OC_LOG(INFO, TAG, "Callback Context for DISCOVER query recvd successfully");
+    OIC_LOG(INFO, TAG, "Callback Context for DISCOVER query recvd successfully");
 
     if (clientResponse)
     {
-        OC_LOG_V(INFO, TAG, "StackResult: %s", getResult(clientResponse->result));
-        OC_LOG_V(INFO, TAG,
+        OIC_LOG_V(INFO, TAG, "StackResult: %s", getResult(clientResponse->result));
+        OIC_LOG_V(INFO, TAG,
                 "Device =============> Discovered @ %s:%d",
                 clientResponse->devAddr.addr,
                 clientResponse->devAddr.port);
 
         if (clientResponse->result == OC_STACK_OK)
         {
-            OC_LOG_PAYLOAD(INFO, clientResponse->payload);
+            OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
 
             ocConnType = clientResponse->connType;
             endpoint = clientResponse->devAddr;
@@ -203,7 +203,7 @@ OCStackApplicationResult discoveryReqCB(void*, OCDoHandle,
 
 int InitPutRequest(OCQualityOfService qos)
 {
-    OC_LOG_V(INFO, TAG, "\n\nExecuting %s", __func__);
+    OIC_LOG_V(INFO, TAG, "\n\nExecuting %s", __func__);
     std::ostringstream query;
     query << coapServerResource;
     endpoint.flags = (OCTransportFlags)(endpoint.flags|OC_SECURE);
@@ -214,7 +214,7 @@ int InitPutRequest(OCQualityOfService qos)
 int InitPostRequest(OCQualityOfService qos)
 {
     OCStackResult result;
-    OC_LOG_V(INFO, TAG, "\n\nExecuting %s", __func__);
+    OIC_LOG_V(INFO, TAG, "\n\nExecuting %s", __func__);
     std::ostringstream query;
     query << coapServerResource;
     endpoint.flags = (OCTransportFlags)(endpoint.flags|OC_SECURE);
@@ -226,7 +226,7 @@ int InitPostRequest(OCQualityOfService qos)
     if (OC_STACK_OK != result)
     {
         // Error can happen if for example, network connectivity is down
-        OC_LOG(INFO, TAG, "First POST call did not succeed");
+        OIC_LOG(INFO, TAG, "First POST call did not succeed");
     }
 
     // Second POST operation (to create an LED instance)
@@ -235,7 +235,7 @@ int InitPostRequest(OCQualityOfService qos)
             postReqCB, NULL, 0);
     if (OC_STACK_OK != result)
     {
-        OC_LOG(INFO, TAG, "Second POST call did not succeed");
+        OIC_LOG(INFO, TAG, "Second POST call did not succeed");
     }
 
     // This POST operation will update the original resourced /a/led
@@ -246,7 +246,7 @@ int InitPostRequest(OCQualityOfService qos)
 
 int InitGetRequest(OCQualityOfService qos)
 {
-    OC_LOG_V(INFO, TAG, "\n\nExecuting %s", __func__);
+    OIC_LOG_V(INFO, TAG, "\n\nExecuting %s", __func__);
     std::ostringstream query;
     query << coapServerResource;
     endpoint.flags = (OCTransportFlags)(endpoint.flags|OC_SECURE);
@@ -265,9 +265,9 @@ int InitDiscovery()
 
     if (UnicastDiscovery)
     {
-        OC_LOG(INFO, TAG, "Enter IP address (with optional port) of the Server hosting resource\n");
-        OC_LOG(INFO, TAG, "IPv4: 192.168.0.15:45454\n");
-        OC_LOG(INFO, TAG, "IPv6: [fe80::20c:29ff:fe1b:9c5]:45454\n");
+        OIC_LOG(INFO, TAG, "Enter IP address (with optional port) of the Server hosting resource\n");
+        OIC_LOG(INFO, TAG, "IPv4: 192.168.0.15:45454\n");
+        OIC_LOG(INFO, TAG, "IPv6: [fe80::20c:29ff:fe1b:9c5]:45454\n");
 
         if (fgets(ipaddr, sizeof (ipaddr), stdin))
         {
@@ -275,7 +275,7 @@ int InitDiscovery()
         }
         else
         {
-            OC_LOG(ERROR, TAG, "!! Bad input for IP address. !!");
+            OIC_LOG(ERROR, TAG, "!! Bad input for IP address. !!");
             return OC_STACK_INVALID_PARAM;
         }
     }
@@ -286,7 +286,7 @@ int InitDiscovery()
     cbData.cd = NULL;
 
     /* Start a discovery query*/
-    OC_LOG_V(INFO, TAG, "Initiating %s Resource Discovery : %s\n",
+    OIC_LOG_V(INFO, TAG, "Initiating %s Resource Discovery : %s\n",
         (UnicastDiscovery) ? "Unicast" : "Multicast",
         queryUri);
 
@@ -294,7 +294,7 @@ int InitDiscovery()
                        OC_LOW_QOS, &cbData, NULL, 0);
     if (ret != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack resource error");
+        OIC_LOG(ERROR, TAG, "OCStack resource error");
     }
     return ret;
 }
@@ -344,7 +344,7 @@ int main(int argc, char* argv[])
     }
     else
     {
-        OC_LOG(INFO, TAG, "Using Default Connectivity type");
+        OIC_LOG(INFO, TAG, "Using Default Connectivity type");
         PrintUsage();
     }
 
@@ -356,7 +356,7 @@ int main(int argc, char* argv[])
     /* Initialize OCStack*/
     if (OCInit(NULL, 0, OC_CLIENT_SERVER) != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack init error");
+        OIC_LOG(ERROR, TAG, "OCStack init error");
         return 0;
     }
 
@@ -366,23 +366,23 @@ int main(int argc, char* argv[])
     timeout.tv_nsec = 100000000L;
 
     // Break from loop with Ctrl+C
-    OC_LOG(INFO, TAG, "Entering occlient main loop...");
+    OIC_LOG(INFO, TAG, "Entering occlient main loop...");
     signal(SIGINT, handleSigInt);
     while (!gQuitFlag)
     {
         if (OCProcess() != OC_STACK_OK)
         {
-            OC_LOG(ERROR, TAG, "OCStack process error");
+            OIC_LOG(ERROR, TAG, "OCStack process error");
             return 0;
         }
 
         nanosleep(&timeout, NULL);
     }
-    OC_LOG(INFO, TAG, "Exiting occlient main loop...");
+    OIC_LOG(INFO, TAG, "Exiting occlient main loop...");
 
     if (OCStop() != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack stop error");
+        OIC_LOG(ERROR, TAG, "OCStack stop error");
     }
 
     return 0;
@@ -399,7 +399,7 @@ int parseClientResponse(OCClientResponse * clientResponse)
     while (res)
     {
         coapServerResource.assign(res->uri);
-        OC_LOG_V(INFO, TAG, "Uri -- %s", coapServerResource.c_str());
+        OIC_LOG_V(INFO, TAG, "Uri -- %s", coapServerResource.c_str());
 
         if (res->secure)
         {
@@ -407,7 +407,7 @@ int parseClientResponse(OCClientResponse * clientResponse)
             coapSecureResource = 1;
         }
 
-        OC_LOG_V(INFO, TAG, "Secure -- %s", coapSecureResource == 1 ? "YES" : "NO");
+        OIC_LOG_V(INFO, TAG, "Secure -- %s", coapSecureResource == 1 ? "YES" : "NO");
 
         // If we discovered a secure resource, exit from here
         if (coapSecureResource)
index 8db063c..cacef07 100644 (file)
@@ -52,7 +52,7 @@ OCRepPayload* getPayload(const char* uri, int64_t power, bool state)
     OCRepPayload* payload = OCRepPayloadCreate();
     if(!payload)
     {
-        OC_LOG(ERROR, TAG, PCF("Failed to allocate Payload"));
+        OIC_LOG(ERROR, TAG, PCF("Failed to allocate Payload"));
         return nullptr;
     }
 
@@ -68,7 +68,7 @@ OCRepPayload* constructResponse (OCEntityHandlerRequest *ehRequest)
 {
     if(ehRequest->payload && ehRequest->payload->type != PAYLOAD_TYPE_REPRESENTATION)
     {
-        OC_LOG(ERROR, TAG, PCF("Incoming payload not a representation"));
+        OIC_LOG(ERROR, TAG, PCF("Incoming payload not a representation"));
         return nullptr;
     }
 
@@ -178,7 +178,7 @@ OCEntityHandlerResult ProcessPostRequest (OCEntityHandlerRequest *ehRequest,
 
             if (0 == createLEDResource (newLedUri, &gLedInstance[gCurrLedInstance], false, 0))
             {
-                OC_LOG (INFO, TAG, "Created new LED instance");
+                OIC_LOG (INFO, TAG, "Created new LED instance");
                 gLedInstance[gCurrLedInstance].state = 0;
                 gLedInstance[gCurrLedInstance].power = 0;
                 gCurrLedInstance++;
@@ -217,7 +217,7 @@ OCEntityHandlerResult ProcessPostRequest (OCEntityHandlerRequest *ehRequest,
     }
     else
     {
-        OC_LOG_V (INFO, TAG, "Payload was NULL");
+        OIC_LOG_V (INFO, TAG, "Payload was NULL");
         ehResult = OC_EH_ERROR;
     }
 
@@ -229,14 +229,14 @@ OCEntityHandlerCb (OCEntityHandlerFlag flag,
         OCEntityHandlerRequest *entityHandlerRequest,
         void* /*callbackParam*/)
 {
-    OC_LOG_V (INFO, TAG, "Inside entity handler - flags: 0x%x", flag);
+    OIC_LOG_V (INFO, TAG, "Inside entity handler - flags: 0x%x", flag);
 
     OCEntityHandlerResult ehResult = OC_EH_ERROR;
     OCEntityHandlerResponse response = { 0, 0, OC_EH_ERROR, 0, 0, { },{ 0 }, false };
     // Validate pointer
     if (!entityHandlerRequest)
     {
-        OC_LOG (ERROR, TAG, "Invalid request pointer");
+        OIC_LOG (ERROR, TAG, "Invalid request pointer");
         return OC_EH_ERROR;
     }
 
@@ -244,27 +244,27 @@ OCEntityHandlerCb (OCEntityHandlerFlag flag,
 
     if (flag & OC_REQUEST_FLAG)
     {
-        OC_LOG (INFO, TAG, "Flag includes OC_REQUEST_FLAG");
+        OIC_LOG (INFO, TAG, "Flag includes OC_REQUEST_FLAG");
         if (entityHandlerRequest)
         {
             if (OC_REST_GET == entityHandlerRequest->method)
             {
-                OC_LOG (INFO, TAG, "Received OC_REST_GET from client");
+                OIC_LOG (INFO, TAG, "Received OC_REST_GET from client");
                 ehResult = ProcessGetRequest (entityHandlerRequest, &payload);
             }
             else if (OC_REST_PUT == entityHandlerRequest->method)
             {
-                OC_LOG (INFO, TAG, "Received OC_REST_PUT from client");
+                OIC_LOG (INFO, TAG, "Received OC_REST_PUT from client");
                 ehResult = ProcessPutRequest (entityHandlerRequest, &payload);
             }
             else if (OC_REST_POST == entityHandlerRequest->method)
             {
-                OC_LOG (INFO, TAG, "Received OC_REST_POST from client");
+                OIC_LOG (INFO, TAG, "Received OC_REST_POST from client");
                 ehResult = ProcessPostRequest (entityHandlerRequest, &response, &payload);
             }
             else
             {
-                OC_LOG_V (INFO, TAG, "Received unsupported method %d from client",
+                OIC_LOG_V (INFO, TAG, "Received unsupported method %d from client",
                         entityHandlerRequest->method);
                 ehResult = OC_EH_ERROR;
             }
@@ -285,7 +285,7 @@ OCEntityHandlerCb (OCEntityHandlerFlag flag,
                 // Send the response
                 if (OCDoResponse(&response) != OC_STACK_OK)
                 {
-                    OC_LOG(ERROR, TAG, "Error sending response");
+                    OIC_LOG(ERROR, TAG, "Error sending response");
                     ehResult = OC_EH_ERROR;
                 }
             }
@@ -315,7 +315,7 @@ int main(int /*argc*/, char* /*argv*/[])
 {
     struct timespec timeout;
 
-    OC_LOG(DEBUG, TAG, "OCServer is starting...");
+    OIC_LOG(DEBUG, TAG, "OCServer is starting...");
 
     // Initialize Persistent Storage for SVR database
     OCPersistentStorage ps = { server_fopen, fread, fwrite, fclose, unlink };
@@ -323,7 +323,7 @@ int main(int /*argc*/, char* /*argv*/[])
 
     if (OCInit(NULL, 0, OC_SERVER) != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack init error");
+        OIC_LOG(ERROR, TAG, "OCStack init error");
         return 0;
     }
 
@@ -336,23 +336,23 @@ int main(int /*argc*/, char* /*argv*/[])
     timeout.tv_nsec = 100000000L;
 
     // Break from loop with Ctrl-C
-    OC_LOG(INFO, TAG, "Entering ocserver main loop...");
+    OIC_LOG(INFO, TAG, "Entering ocserver main loop...");
     signal(SIGINT, handleSigInt);
     while (!gQuitFlag)
     {
         if (OCProcess() != OC_STACK_OK)
         {
-            OC_LOG(ERROR, TAG, "OCStack process error");
+            OIC_LOG(ERROR, TAG, "OCStack process error");
             return 0;
         }
         nanosleep(&timeout, NULL);
     }
 
-    OC_LOG(INFO, TAG, "Exiting ocserver main loop...");
+    OIC_LOG(INFO, TAG, "Exiting ocserver main loop...");
 
     if (OCStop() != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack process error");
+        OIC_LOG(ERROR, TAG, "OCStack process error");
     }
 
     return 0;
@@ -362,7 +362,7 @@ int createLEDResource (char *uri, LEDResource *ledResource, bool resourceState,
 {
     if (!uri)
     {
-        OC_LOG(ERROR, TAG, "Resource URI cannot be NULL");
+        OIC_LOG(ERROR, TAG, "Resource URI cannot be NULL");
         return -1;
     }
 
@@ -375,7 +375,7 @@ int createLEDResource (char *uri, LEDResource *ledResource, bool resourceState,
             OCEntityHandlerCb,
             NULL,
             OC_DISCOVERABLE|OC_OBSERVABLE | OC_SECURE);
-    OC_LOG_V(INFO, TAG, "Created LED resource with result: %s", getResult(res));
+    OIC_LOG_V(INFO, TAG, "Created LED resource with result: %s", getResult(res));
 
     return 0;
 }
index d690cd4..a128a73 100644 (file)
@@ -232,7 +232,7 @@ OCStackApplicationResult deleteReqCB(void *ctx,
     if(clientResponse)
     {
         cout << "\nStackResult: " << getResult(clientResponse->result);
-        //OC_LOG_PAYLOAD(INFO, clientResponse->payload);
+        //OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
     }
     else
     {
@@ -257,7 +257,7 @@ OCStackApplicationResult getReqCB(void* ctx, OCDoHandle /*handle*/,
 
     cout << "\nStackResult: " << getResult(clientResponse->result);
     cout << "\nSEQUENCE NUMBER: " << clientResponse->sequenceNumber;
-    //OC_LOG_PAYLOAD(INFO, TAG, clientResponse->payload);
+    //OIC_LOG_PAYLOAD(INFO, TAG, clientResponse->payload);
 
     if (clientResponse->numRcvdVendorSpecificHeaderOptions > 0)
     {
@@ -288,7 +288,7 @@ OCStackApplicationResult obsReqCB(void* ctx, OCDoHandle /*handle*/,
         cout << "\nStackResult: " << getResult(clientResponse->result);
         cout << "\nSEQUENCE NUMBER: " << clientResponse->sequenceNumber;
         cout << "\nCallback Context for OBSERVE notification recvd successfully ";
-        //OC_LOG_PAYLOAD(INFO, clientResponse->payload);
+        //OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
         gNumObserveNotifies++;
         if (gNumObserveNotifies == 15) //large number to test observing in DELETE case.
         {
@@ -343,7 +343,7 @@ OCStackApplicationResult presenceCB(void* ctx, OCDoHandle /*handle*/,
         cout << "\nStackResult: " << getResult(clientResponse->result);
         cout << "\nNONCE NUMBER: " << clientResponse->sequenceNumber;
         cout << "\nCallback Context for Presence notification recvd successfully ";
-        //OC_LOG_PAYLOAD(INFO, clientResponse->payload);
+        //OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
         gNumPresenceNotifies++;
         if (gNumPresenceNotifies == 20)
         {
@@ -389,7 +389,7 @@ OCStackApplicationResult discoveryReqCB(void* ctx, OCDoHandle /*handle*/,
         {
             cout << ":" << clientResponse->devAddr.port;
         }
-        //OC_LOG_PAYLOAD(INFO, clientResponse->payload);
+        //OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
         cout << "\nConnectivity type: " << clientResponse->connType;
         g_connType = clientResponse->connType;
         g_serverAddr = clientResponse->devAddr;
@@ -471,8 +471,8 @@ OCStackApplicationResult PlatformDiscoveryReqCB(void* ctx,
 
     if (clientResponse)
     {
-        //OC_LOG truncates the response as it is too long.
-        //OC_LOG_PAYLOAD(INFO, clientResponse->payload);
+        //OIC_LOG truncates the response as it is too long.
+        //OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
     }
     else
     {
@@ -492,7 +492,7 @@ OCStackApplicationResult DeviceDiscoveryReqCB(void* ctx, OCDoHandle /*handle*/,
 
     if (clientResponse)
     {
-        //OC_LOG truncates the response as it is too long.
+        //OIC_LOG truncates the response as it is too long.
         cout << "\nDiscovery response: ";
         cout << clientResponse->payload;
     }
@@ -829,7 +829,7 @@ int main(int argc, char* argv[])
     {
         if (OCProcess() != OC_STACK_OK)
         {
-            OC_LOG(ERROR, TAG, "OCStack process error");
+            OIC_LOG(ERROR, TAG, "OCStack process error");
             return 0;
         }
         usleep(SLEEP_DURATION);
@@ -886,7 +886,7 @@ int main(int argc, char* argv[])
     }
 
     // Break from loop with Ctrl+C
-    OC_LOG(INFO, TAG, "Entering occlient main loop...");
+    OIC_LOG(INFO, TAG, "Entering occlient main loop...");
     signal(SIGINT, handleSigInt);
     while (!gQuitFlag)
     {
index 6a80794..9b3c19d 100644 (file)
@@ -72,8 +72,8 @@ AddClientCB (ClientCB** clientCB, OCCallbackData* cbData,
         }
         else
         {
-            OC_LOG(INFO, TAG, "Adding client callback with token");
-            OC_LOG_BUFFER(INFO, TAG, (const uint8_t *)token, tokenLength);
+            OIC_LOG(INFO, TAG, "Adding client callback with token");
+            OIC_LOG_BUFFER(INFO, TAG, (const uint8_t *)token, tokenLength);
             cbNode->callBack = cbData->cb;
             cbNode->context = cbData->context;
             cbNode->deleteCallback = cbData->cd;
@@ -101,7 +101,7 @@ AddClientCB (ClientCB** clientCB, OCCallbackData* cbData,
             }
             cbNode->requestUri = requestUri;    // I own it now
             cbNode->devAddr = devAddr;          // I own it now
-            OC_LOG_V(INFO, TAG, "Added Callback for uri : %s", requestUri);
+            OIC_LOG_V(INFO, TAG, "Added Callback for uri : %s", requestUri);
             LL_APPEND(cbList, cbNode);
             *clientCB = cbNode;
         }
@@ -150,12 +150,12 @@ void DeleteClientCB(ClientCB * cbNode)
     if (cbNode)
     {
         LL_DELETE(cbList, cbNode);
-        OC_LOG (INFO, TAG, "Deleting token");
-        OC_LOG_BUFFER(INFO, TAG, (const uint8_t *)cbNode->token, cbNode->tokenLength);
+        OIC_LOG (INFO, TAG, "Deleting token");
+        OIC_LOG_BUFFER(INFO, TAG, (const uint8_t *)cbNode->token, cbNode->tokenLength);
         CADestroyToken (cbNode->token);
         OICFree(cbNode->devAddr);
         OICFree(cbNode->handle);
-        OC_LOG_V (INFO, TAG, "Deleting callback with uri %s", cbNode->requestUri);
+        OIC_LOG_V (INFO, TAG, "Deleting callback with uri %s", cbNode->requestUri);
         OICFree(cbNode->requestUri);
         if (cbNode->deleteCallback)
         {
@@ -208,7 +208,7 @@ static void CheckAndDeleteTimedOutCB(ClientCB* cbNode)
 
     if (cbNode->TTL < now)
     {
-        OC_LOG(INFO, TAG, "Deleting timed-out callback");
+        OIC_LOG(INFO, TAG, "Deleting timed-out callback");
         DeleteClientCB(cbNode);
     }
 }
@@ -220,12 +220,12 @@ ClientCB* GetClientCB(const CAToken_t token, uint8_t tokenLength,
 
     if (token && *token && tokenLength <= CA_MAX_TOKEN_LEN && tokenLength > 0)
     {
-        OC_LOG (INFO, TAG,  "Looking for token");
-        OC_LOG_BUFFER(INFO, TAG, (const uint8_t *)token, tokenLength);
-        OC_LOG(INFO, TAG, "\tFound in callback list");
+        OIC_LOG (INFO, TAG,  "Looking for token");
+        OIC_LOG_BUFFER(INFO, TAG, (const uint8_t *)token, tokenLength);
+        OIC_LOG(INFO, TAG, "\tFound in callback list");
         LL_FOREACH(cbList, out)
         {
-            OC_LOG_BUFFER(INFO, TAG, (const uint8_t *)out->token, tokenLength);
+            OIC_LOG_BUFFER(INFO, TAG, (const uint8_t *)out->token, tokenLength);
 
             if (memcmp(out->token, token, tokenLength) == 0)
             {
@@ -247,10 +247,10 @@ ClientCB* GetClientCB(const CAToken_t token, uint8_t tokenLength,
     }
     else if (requestUri)
     {
-        OC_LOG_V(INFO, TAG, "Looking for uri %s", requestUri);
+        OIC_LOG_V(INFO, TAG, "Looking for uri %s", requestUri);
         LL_FOREACH(cbList, out)
         {
-            OC_LOG_V(INFO, TAG, "\tFound %s", out->requestUri);
+            OIC_LOG_V(INFO, TAG, "\tFound %s", out->requestUri);
             if (out->requestUri && strcmp(out->requestUri, requestUri ) == 0)
             {
                 return out;
@@ -258,7 +258,7 @@ ClientCB* GetClientCB(const CAToken_t token, uint8_t tokenLength,
             CheckAndDeleteTimedOutCB(out);
         }
     }
-    OC_LOG(INFO, TAG, "Callback Not found !!");
+    OIC_LOG(INFO, TAG, "Callback Not found !!");
     return NULL;
 }
 
@@ -345,6 +345,6 @@ OCMulticastNode* GetMCPresenceNode(const char * uri)
             }
         }
     }
-    OC_LOG(INFO, TAG, "MulticastNode Not found !!");
+    OIC_LOG(INFO, TAG, "MulticastNode Not found !!");
     return NULL;
 }
index 3d62711..4f38fec 100644 (file)
@@ -99,7 +99,7 @@ ValidateQuery (const char *query, OCResourceHandle resource,
     //TODO: Query and URL validation is being done for virtual resource case
     // using ValidateUrlQuery function. We should be able to merge it with this
     // function.
-    OC_LOG(INFO, TAG, "Entering ValidateQuery");
+    OIC_LOG(INFO, TAG, "Entering ValidateQuery");
 
     if (!query)
     {
@@ -114,7 +114,7 @@ ValidateQuery (const char *query, OCResourceHandle resource,
     if (!(*query))
     {
         // Query string is empty
-        OC_LOG(INFO, TAG, "Empty query string, use default IF and RT");
+        OIC_LOG(INFO, TAG, "Empty query string, use default IF and RT");
         *ifParam = STACK_IF_DEFAULT;
         *rtParam = (char *) OCGetResourceTypeName (resource, 0);
         return OC_STACK_OK;
@@ -219,7 +219,7 @@ ValidateQuery (const char *query, OCResourceHandle resource,
         // RT not specified in query. Use the first resource type for the resource as default.
         *rtParam = (char *) OCGetResourceTypeName (resource, 0);
     }
-    OC_LOG_V(INFO, TAG, "Query params: IF = %d, RT = %s", *ifParam, *rtParam);
+    OIC_LOG_V(INFO, TAG, "Query params: IF = %d, RT = %s", *ifParam, *rtParam);
 
     return OC_STACK_OK;
 }
@@ -324,7 +324,7 @@ HandleBatchInterface(OCEntityHandlerRequest *ehRequest)
                 // as slow response
                 if (ehResult == OC_EH_SLOW)
                 {
-                    OC_LOG(INFO, TAG, "This is a slow resource");
+                    OIC_LOG(INFO, TAG, "This is a slow resource");
                     ((OCServerRequest *)ehRequest->requestHandle)->slowFlag = 1;
                     stackRet = EntityHandlerCodeToOCStackCode(ehResult);
                 }
@@ -368,7 +368,7 @@ OCStackResult DefaultCollectionEntityHandler (OCEntityHandlerFlag flag,
         return OC_STACK_INVALID_PARAM;
     }
 
-    OC_LOG_V(INFO, TAG, "DefaultCollectionEntityHandler with query %s", ehRequest->query);
+    OIC_LOG_V(INFO, TAG, "DefaultCollectionEntityHandler with query %s", ehRequest->query);
 
     if (flag != OC_REQUEST_FLAG)
     {
@@ -394,15 +394,15 @@ OCStackResult DefaultCollectionEntityHandler (OCEntityHandlerFlag flag,
                     // Get attributes of collection resource and properties of contained resources
                     // M1 release does not support attributes for collection resource, so the GET
                     // operation is same as the GET on LL interface.
-                    OC_LOG(INFO, TAG, "STACK_IF_DEFAULT");
+                    OIC_LOG(INFO, TAG, "STACK_IF_DEFAULT");
                     return HandleLinkedListInterface(ehRequest, STACK_RES_DISCOVERY_NOFILTER, NULL);
 
                 case STACK_IF_LL:
-                    OC_LOG(INFO, TAG, "STACK_IF_LL");
+                    OIC_LOG(INFO, TAG, "STACK_IF_LL");
                     return HandleLinkedListInterface(ehRequest, STACK_RES_DISCOVERY_NOFILTER, NULL);
 
                 case STACK_IF_BATCH:
-                    OC_LOG(INFO, TAG, "STACK_IF_BATCH");
+                    OIC_LOG(INFO, TAG, "STACK_IF_BATCH");
                     ((OCServerRequest *)ehRequest->requestHandle)->ehResponseHandler =
                                                                             HandleAggregateResponse;
 
@@ -438,8 +438,8 @@ OCStackResult DefaultCollectionEntityHandler (OCEntityHandlerFlag flag,
                     return HandleBatchInterface(ehRequest);
 
                 case STACK_IF_GROUP:
-                    OC_LOG(INFO, TAG, "IF_COLLECTION PUT with request ::\n");
-                    OC_LOG_PAYLOAD(INFO, ehRequest->payload);
+                    OIC_LOG(INFO, TAG, "IF_COLLECTION PUT with request ::\n");
+                    OIC_LOG_PAYLOAD(INFO, ehRequest->payload);
                     return BuildCollectionGroupActionCBORResponse(OC_REST_PUT/*flag*/,
                             (OCResource *) ehRequest->resource, ehRequest);
 
@@ -466,8 +466,8 @@ OCStackResult DefaultCollectionEntityHandler (OCEntityHandlerFlag flag,
                     return HandleBatchInterface(ehRequest);
 
                 case STACK_IF_GROUP:
-                    OC_LOG(INFO, TAG, "IF_COLLECTION POST with request ::\n");
-                    OC_LOG_PAYLOAD(INFO, ehRequest->payload);
+                    OIC_LOG(INFO, TAG, "IF_COLLECTION POST with request ::\n");
+                    OIC_LOG_PAYLOAD(INFO, ehRequest->payload);
                     return BuildCollectionGroupActionCBORResponse(OC_REST_POST/*flag*/,
                             (OCResource *) ehRequest->resource, ehRequest);
 
index 12d7cc7..636572a 100644 (file)
@@ -40,7 +40,7 @@
 
 #define TAG  "OIC_RI_OBSERVE"
 
-#define VERIFY_NON_NULL(arg) { if (!arg) {OC_LOG(FATAL, TAG, #arg " is NULL"); goto exit;} }
+#define VERIFY_NON_NULL(arg) { if (!arg) {OIC_LOG(FATAL, TAG, #arg " is NULL"); goto exit;} }
 
 static struct ResourceObserver * g_serverObsList = NULL;
 /**
@@ -59,7 +59,7 @@ static OCQualityOfService DetermineObserverQoS(OCMethod method,
 {
     if (!resourceObserver)
     {
-        OC_LOG(ERROR, TAG, "DetermineObserverQoS called with invalid resourceObserver");
+        OIC_LOG(ERROR, TAG, "DetermineObserverQoS called with invalid resourceObserver");
         return OC_NA_QOS;
     }
 
@@ -71,7 +71,7 @@ static OCQualityOfService DetermineObserverQoS(OCMethod method,
 
     if (appQoS != OC_HIGH_QOS)
     {
-        OC_LOG_V(INFO, TAG, "Current NON count for this observer is %d",
+        OIC_LOG_V(INFO, TAG, "Current NON count for this observer is %d",
                 resourceObserver->lowQosCount);
 #ifdef WITH_PRESENCE
         if ((resourceObserver->forceHighQos \
@@ -85,7 +85,7 @@ static OCQualityOfService DetermineObserverQoS(OCMethod method,
             resourceObserver->lowQosCount = 0;
             // at some point we have to to send CON to check on the
             // availability of observer
-            OC_LOG(INFO, TAG, "This time we are sending the  notification as High qos");
+            OIC_LOG(INFO, TAG, "This time we are sending the  notification as High qos");
             decidedQoS = OC_HIGH_QOS;
         }
         else
@@ -104,7 +104,7 @@ OCStackResult SendAllObserverNotification (OCMethod method, OCResource *resPtr,
         OCQualityOfService qos)
 #endif
 {
-    OC_LOG(INFO, TAG, "Entering SendObserverNotification");
+    OIC_LOG(INFO, TAG, "Entering SendObserverNotification");
     if (!resPtr)
     {
         return OC_STACK_INVALID_PARAM;
@@ -175,7 +175,7 @@ OCStackResult SendAllObserverNotification (OCMethod method, OCResource *resPtr,
                 OCEntityHandlerResponse ehResponse = {0};
 
                 //This is effectively the implementation for the presence entity handler.
-                OC_LOG(DEBUG, TAG, "This notification is for Presence");
+                OIC_LOG(DEBUG, TAG, "This notification is for Presence");
                 result = AddServerRequest(&request, 0, 0, 1, OC_REST_GET,
                         0, resPtr->sequenceNum, qos, resourceObserver->query,
                         NULL, NULL,
@@ -222,12 +222,12 @@ OCStackResult SendAllObserverNotification (OCMethod method, OCResource *resPtr,
 
     if (numObs == 0)
     {
-        OC_LOG(INFO, TAG, "Resource has no observers");
+        OIC_LOG(INFO, TAG, "Resource has no observers");
         result = OC_STACK_NO_OBSERVERS;
     }
     else if (observeErrorFlag)
     {
-        OC_LOG(ERROR, TAG, "Observer notification error");
+        OIC_LOG(ERROR, TAG, "Observer notification error");
         result = OC_STACK_ERROR;
     }
     return result;
@@ -252,7 +252,7 @@ OCStackResult SendListObserverNotification (OCResource * resource,
     OCStackResult result = OC_STACK_ERROR;
     bool observeErrorFlag = false;
 
-    OC_LOG(INFO, TAG, "Entering SendListObserverNotification");
+    OIC_LOG(INFO, TAG, "Entering SendListObserverNotification");
     while(numIds)
     {
         observer = GetObserverUsingId (*obsIdList);
@@ -290,7 +290,7 @@ OCStackResult SendListObserverNotification (OCResource * resource,
                         result = OCDoResponse(&ehResponse);
                         if (result == OC_STACK_OK)
                         {
-                            OC_LOG_V(INFO, TAG, "Observer id %d notified.", *obsIdList);
+                            OIC_LOG_V(INFO, TAG, "Observer id %d notified.", *obsIdList);
 
                             // Increment only if OCDoResponse is successful
                             numSentNotification++;
@@ -300,7 +300,7 @@ OCStackResult SendListObserverNotification (OCResource * resource,
                         }
                         else
                         {
-                            OC_LOG_V(INFO, TAG, "Error notifying observer id %d.", *obsIdList);
+                            OIC_LOG_V(INFO, TAG, "Error notifying observer id %d.", *obsIdList);
                         }
                     }
                     else
@@ -330,7 +330,7 @@ OCStackResult SendListObserverNotification (OCResource * resource,
     }
     else
     {
-        OC_LOG(ERROR, TAG, "Observer notification error");
+        OIC_LOG(ERROR, TAG, "Observer notification error");
         return OC_STACK_ERROR;
     }
 }
@@ -339,7 +339,7 @@ OCStackResult GenerateObserverId (OCObservationId *observationId)
 {
     ResourceObserver *resObs = NULL;
 
-    OC_LOG(INFO, TAG, "Entering GenerateObserverId");
+    OIC_LOG(INFO, TAG, "Entering GenerateObserverId");
     VERIFY_NON_NULL (observationId);
 
     do
@@ -349,7 +349,7 @@ OCStackResult GenerateObserverId (OCObservationId *observationId)
         resObs = GetObserverUsingId (*observationId);
     } while (NULL != resObs);
 
-    OC_LOG_V(INFO, TAG, "GeneratedObservation ID is %u", *observationId);
+    OIC_LOG_V(INFO, TAG, "GeneratedObservation ID is %u", *observationId);
 
     return OC_STACK_OK;
 exit:
@@ -438,7 +438,7 @@ ResourceObserver* GetObserverUsingId (const OCObservationId observeId)
             }
         }
     }
-    OC_LOG(INFO, TAG, "Observer node not found!!");
+    OIC_LOG(INFO, TAG, "Observer node not found!!");
     return NULL;
 }
 
@@ -448,13 +448,13 @@ ResourceObserver* GetObserverUsingToken (const CAToken_t token, uint8_t tokenLen
 
     if (token && *token)
     {
-        OC_LOG(INFO, TAG, "Looking for token");
-        OC_LOG_BUFFER(INFO, TAG, (const uint8_t *)token, tokenLength);
-        OC_LOG(INFO, TAG, "\tFound token:");
+        OIC_LOG(INFO, TAG, "Looking for token");
+        OIC_LOG_BUFFER(INFO, TAG, (const uint8_t *)token, tokenLength);
+        OIC_LOG(INFO, TAG, "\tFound token:");
 
         LL_FOREACH (g_serverObsList, out)
         {
-            OC_LOG_BUFFER(INFO, TAG, (const uint8_t *)out->token, tokenLength);
+            OIC_LOG_BUFFER(INFO, TAG, (const uint8_t *)out->token, tokenLength);
             if ((memcmp(out->token, token, tokenLength) == 0))
             {
                 return out;
@@ -463,10 +463,10 @@ ResourceObserver* GetObserverUsingToken (const CAToken_t token, uint8_t tokenLen
     }
     else
     {
-        OC_LOG(ERROR, TAG, "Passed in NULL token");
+        OIC_LOG(ERROR, TAG, "Passed in NULL token");
     }
 
-    OC_LOG(INFO, TAG, "Observer node not found!!");
+    OIC_LOG(INFO, TAG, "Observer node not found!!");
     return NULL;
 }
 
@@ -480,8 +480,8 @@ OCStackResult DeleteObserverUsingToken (CAToken_t token, uint8_t tokenLength)
     ResourceObserver *obsNode = GetObserverUsingToken (token, tokenLength);
     if (obsNode)
     {
-        OC_LOG_V(INFO, TAG, "deleting observer id  %u with token", obsNode->observeId);
-        OC_LOG_BUFFER(INFO, TAG, (const uint8_t *)obsNode->token, tokenLength);
+        OIC_LOG_V(INFO, TAG, "deleting observer id  %u with token", obsNode->observeId);
+        OIC_LOG_BUFFER(INFO, TAG, (const uint8_t *)obsNode->token, tokenLength);
         LL_DELETE (g_serverObsList, obsNode);
         OICFree(obsNode->resUri);
         OICFree(obsNode->query);
@@ -527,7 +527,7 @@ CreateObserveHeaderOption (CAHeaderOption_t **caHdrOpt,
 
     if (numOptions > 0 && !ocHdrOpt)
     {
-        OC_LOG (INFO, TAG, "options are NULL though number is non zero");
+        OIC_LOG (INFO, TAG, "options are NULL though number is non zero");
         return OC_STACK_INVALID_PARAM;
     }
 
@@ -571,7 +571,7 @@ GetObserveHeaderOption (uint32_t * observationOption,
 
     if (!options || !numOptions)
     {
-        OC_LOG (INFO, TAG, "No options present");
+        OIC_LOG (INFO, TAG, "No options present");
         return OC_STACK_OK;
     }
 
index d17dae1..457f136 100755 (executable)
@@ -65,7 +65,7 @@ void OCPayloadDestroy(OCPayload* payload)
            OCRDPayloadDestroy((OCRDPayload*)payload);
            break;
         default:
-            OC_LOG_V(ERROR, TAG, "Unsupported payload type in destroy: %d", payload->type);
+            OIC_LOG_V(ERROR, TAG, "Unsupported payload type in destroy: %d", payload->type);
             OICFree(payload);
             break;
     }
@@ -157,7 +157,7 @@ static void OCCopyPropertyValueArray(OCRepPayloadValue* dest, OCRepPayloadValue*
             }
             break;
         default:
-            OC_LOG(ERROR, TAG, "CopyPropertyValueArray invalid type");
+            OIC_LOG(ERROR, TAG, "CopyPropertyValueArray invalid type");
             break;
     }
 }
@@ -240,7 +240,7 @@ static void OCFreeRepPayloadValueContents(OCRepPayloadValue* val)
                 break;
             case OCREP_PROP_NULL:
             case OCREP_PROP_ARRAY:
-                OC_LOG_V(ERROR, TAG, "FreeRepPayloadValueContents: Illegal type\
+                OIC_LOG_V(ERROR, TAG, "FreeRepPayloadValueContents: Illegal type\
                         inside an array: %d", val->arr.type);
                 break;
         }
@@ -357,7 +357,7 @@ static OCRepPayloadValue* OCRepPayloadFindAndSetValue(OCRepPayload* payload, con
         val = val->next;
     }
 
-    OC_LOG(ERROR, TAG, "FindAndSetValue reached point after while loop, pointer corruption?");
+    OIC_LOG(ERROR, TAG, "FindAndSetValue reached point after while loop, pointer corruption?");
     return NULL;
 }
 
index 3f75100..aa5436d 100644 (file)
@@ -71,17 +71,17 @@ OCStackResult OCConvertPayload(OCPayload* payload, uint8_t** outPayload, size_t*
     #undef CborNeedsUpdating
     if (!payload)
     {
-        OC_LOG(ERROR, TAG, "Payload parameter NULL");
+        OIC_LOG(ERROR, TAG, "Payload parameter NULL");
         return OC_STACK_INVALID_PARAM;
     }
 
     if (!outPayload || !size)
     {
-        OC_LOG(ERROR, TAG, "Out parameter/s parameter NULL");
+        OIC_LOG(ERROR, TAG, "Out parameter/s parameter NULL");
         return OC_STACK_INVALID_PARAM;
     }
 
-    OC_LOG_V(INFO, TAG, "Converting payload of type %d", payload->type);
+    OIC_LOG_V(INFO, TAG, "Converting payload of type %d", payload->type);
 
     size_t curSize = INIT_SIZE;
     uint8_t* out = (uint8_t*)OICCalloc(1, curSize);
@@ -150,7 +150,7 @@ static int64_t OCConvertPayloadHelper(OCPayload* payload, uint8_t* outPayload, s
         case PAYLOAD_TYPE_RD:
             return OCRDPayloadToCbor((OCRDPayload*)payload, outPayload, size);
         default:
-            OC_LOG_V(INFO,TAG, "ConvertPayload default %d", payload->type);
+            OIC_LOG_V(INFO,TAG, "ConvertPayload default %d", payload->type);
             return OC_STACK_NOTIMPL;
     }
 }
@@ -164,7 +164,7 @@ static int64_t checkError(int64_t err, CborEncoder* encoder, uint8_t* outPayload
     }
     else if (err != 0)
     {
-        OC_LOG_V(ERROR, TAG, "Convert Payload failed : %zd", err);
+        OIC_LOG_V(ERROR, TAG, "Convert Payload failed : %zd", err);
         return err;
     }
     else
@@ -497,7 +497,7 @@ static int64_t OCConvertArrayItem(CborEncoder* array, const OCRepPayloadValueArr
     switch (valArray->type)
     {
         case OCREP_PROP_NULL:
-            OC_LOG(ERROR, TAG, "ConvertArray Invalid NULL");
+            OIC_LOG(ERROR, TAG, "ConvertArray Invalid NULL");
             err = CborUnknownError;
             break;
         case OCREP_PROP_INT:
@@ -542,7 +542,7 @@ static int64_t OCConvertArrayItem(CborEncoder* array, const OCRepPayloadValueArr
             }
             break;
         case OCREP_PROP_ARRAY:
-            OC_LOG(ERROR, TAG, "ConvertArray Invalid child array");
+            OIC_LOG(ERROR, TAG, "ConvertArray Invalid child array");
             err = CborUnknownError;
             break;
     }
@@ -648,7 +648,7 @@ static int64_t OCConvertSingleRepPayload(CborEncoder* repMap, const OCRepPayload
                 err = err | OCConvertArray(repMap, &value->arr);
                 break;
             default:
-                OC_LOG_V(ERROR, TAG, "Invalid Prop type: %d",
+                OIC_LOG_V(ERROR, TAG, "Invalid Prop type: %d",
                         value->type);
                 break;
         }
@@ -669,7 +669,7 @@ static int64_t OCConvertRepPayload(OCRepPayload* payload, uint8_t* outPayload, s
 
     if (payload->types)
     {
-        OC_LOG(INFO, TAG, "Payload has types or interfaces");
+        OIC_LOG(INFO, TAG, "Payload has types or interfaces");
         char* joinedTypes = OCStringLLJoin(payload->types);
         if (joinedTypes)
         {
index c0fc5ec..fbdf735 100644 (file)
@@ -56,10 +56,10 @@ OCStackResult OCParsePayload(OCPayload** outPayload, OCPayloadType payloadType,
     CborValue rootValue;
     bool err = false;
 
-    OC_LOG_V(INFO, TAG, "CBOR Parsing size: %zu", payloadSize);
+    OIC_LOG_V(INFO, TAG, "CBOR Parsing size: %zu", payloadSize);
     if((err = cbor_parser_init(payload, payloadSize, 0, &parser, &rootValue)) != false)
     {
-        OC_LOG_V(ERROR, TAG, "CBOR Parser init failed: %d", err);
+        OIC_LOG_V(ERROR, TAG, "CBOR Parser init failed: %d", err);
         return OC_STACK_ERROR;
     }
 
@@ -88,14 +88,14 @@ OCStackResult OCParsePayload(OCPayload** outPayload, OCPayloadType payloadType,
             result = OCRDCborToPayload(&rootValue, outPayload);
             break;
         default:
-            OC_LOG_V(ERROR, TAG, "ParsePayload Type default: %d", payloadType);
+            OIC_LOG_V(ERROR, TAG, "ParsePayload Type default: %d", payloadType);
             result = OC_STACK_ERROR;
             break;
     }
 
     if(result != OC_STACK_OK)
     {
-        OC_LOG_V(INFO, TAG, "Finished parse payload, result is %d", result);
+        OIC_LOG_V(INFO, TAG, "Finished parse payload, result is %d", result);
     }
 
     return result;
@@ -123,7 +123,7 @@ static OCStackResult OCParseSecurityPayload(OCPayload** outPayload, CborValue* r
 
     if(err)
     {
-        OC_LOG(ERROR, TAG, "Cbor in error condition");
+        OIC_LOG(ERROR, TAG, "Cbor in error condition");
         OICFree(securityData);
         return OC_STACK_MALFORMED_RESPONSE;
     }
@@ -181,7 +181,7 @@ static OCStackResult OCParseDiscoveryPayload(OCPayload** outPayload, CborValue*
     err = cbor_value_map_find_value(&rootMap, OC_RSRVD_DEVICE_ID, &curVal);
     if (CborNoError != err)
     {
-        OC_LOG(ERROR, TAG, "Cbor find value failed.");
+        OIC_LOG(ERROR, TAG, "Cbor find value failed.");
         goto malformed_cbor;
     }
     size_t len;
@@ -194,7 +194,7 @@ static OCStackResult OCParseDiscoveryPayload(OCPayload** outPayload, CborValue*
         err = cbor_value_dup_text_string(&curVal, &(out->baseURI), &len, NULL);
         if (CborNoError != err)
         {
-            OC_LOG(ERROR, TAG, "baseURI failed.");
+            OIC_LOG(ERROR, TAG, "baseURI failed.");
             goto malformed_cbor;
         }
     }
@@ -203,7 +203,7 @@ static OCStackResult OCParseDiscoveryPayload(OCPayload** outPayload, CborValue*
     err = cbor_value_map_find_value(&rootMap, OC_RSRVD_LINKS, &curVal);
     if (CborNoError != err)
     {
-        OC_LOG(ERROR, TAG, "Cbor find value failed.");
+        OIC_LOG(ERROR, TAG, "Cbor find value failed.");
         goto malformed_cbor;
     }
 
@@ -216,7 +216,7 @@ static OCStackResult OCParseDiscoveryPayload(OCPayload** outPayload, CborValue*
         resource = (OCResourcePayload*)OICCalloc(1, sizeof(OCResourcePayload));
         if(!resource)
         {
-            OC_LOG(ERROR, TAG, "Memory allocation failed");
+            OIC_LOG(ERROR, TAG, "Memory allocation failed");
             OCDiscoveryPayloadDestroy(out);
             return OC_STACK_NO_MEMORY;
         }
@@ -226,13 +226,13 @@ static OCStackResult OCParseDiscoveryPayload(OCPayload** outPayload, CborValue*
         err = cbor_value_map_find_value(&resourceMap, OC_RSRVD_HREF, &uriVal);
         if (CborNoError != err)
         {
-            OC_LOG(ERROR, TAG, "Cbor finding href type failed.");
+            OIC_LOG(ERROR, TAG, "Cbor finding href type failed.");
             goto malformed_cbor;
         }
         err = cbor_value_dup_text_string(&uriVal, &(resource->uri), &len, NULL);
         if (CborNoError != err)
         {
-            OC_LOG(ERROR, TAG, "Cbor finding href value failed.");
+            OIC_LOG(ERROR, TAG, "Cbor finding href value failed.");
             goto malformed_cbor;
         }
         // ResourceTypes
@@ -240,7 +240,7 @@ static OCStackResult OCParseDiscoveryPayload(OCPayload** outPayload, CborValue*
         err = cbor_value_map_find_value(&resourceMap, OC_RSRVD_RESOURCE_TYPE, &rtVal);
         if (CborNoError != err)
         {
-            OC_LOG(ERROR, TAG, "Cbor finding rt type failed.");
+            OIC_LOG(ERROR, TAG, "Cbor finding rt type failed.");
             goto malformed_cbor;
         }
         if (cbor_value_is_text_string(&rtVal))
@@ -250,7 +250,7 @@ static OCStackResult OCParseDiscoveryPayload(OCPayload** outPayload, CborValue*
             err = cbor_value_dup_text_string(&rtVal, &input, &len, NULL);
             if (CborNoError != err)
             {
-                OC_LOG(ERROR, TAG, "Cbor finding rt value failed.");
+                OIC_LOG(ERROR, TAG, "Cbor finding rt value failed.");
                 goto malformed_cbor;
             }
             if (input)
@@ -282,7 +282,7 @@ static OCStackResult OCParseDiscoveryPayload(OCPayload** outPayload, CborValue*
         err = cbor_value_map_find_value(&resourceMap, OC_RSRVD_INTERFACE, &ifVal);
         if (CborNoError != err)
         {
-            OC_LOG(ERROR, TAG, "Cbor finding if type failed.");
+            OIC_LOG(ERROR, TAG, "Cbor finding if type failed.");
             goto malformed_cbor;
         }
         if (!err && cbor_value_is_text_string(&ifVal))
@@ -292,7 +292,7 @@ static OCStackResult OCParseDiscoveryPayload(OCPayload** outPayload, CborValue*
             err = cbor_value_dup_text_string(&ifVal, &input, &len, NULL);
             if (CborNoError != err)
             {
-                OC_LOG(ERROR, TAG, "Cbor finding if value failed.");
+                OIC_LOG(ERROR, TAG, "Cbor finding if value failed.");
                 goto malformed_cbor;
             }
             if (input)
@@ -324,7 +324,7 @@ static OCStackResult OCParseDiscoveryPayload(OCPayload** outPayload, CborValue*
         err = cbor_value_map_find_value(&resourceMap, OC_RSRVD_POLICY, &policyMap);
         if (CborNoError != err)
         {
-            OC_LOG(ERROR, TAG, "Cbor finding policy type failed.");
+            OIC_LOG(ERROR, TAG, "Cbor finding policy type failed.");
             goto malformed_cbor;
         }
         // Bitmap
@@ -332,14 +332,14 @@ static OCStackResult OCParseDiscoveryPayload(OCPayload** outPayload, CborValue*
         err = cbor_value_map_find_value(&policyMap, OC_RSRVD_BITMAP, &val);
         if (CborNoError != err)
         {
-            OC_LOG(ERROR, TAG, "Cbor finding bitmap type failed.");
+            OIC_LOG(ERROR, TAG, "Cbor finding bitmap type failed.");
             goto malformed_cbor;
         }
         uint64_t temp = 0;
         err = cbor_value_get_uint64(&val, &temp);
         if (CborNoError != err)
         {
-            OC_LOG(ERROR, TAG, "Cbor finding bitmap value failed.");
+            OIC_LOG(ERROR, TAG, "Cbor finding bitmap value failed.");
             goto malformed_cbor;
         }
         resource->bitmap = (uint8_t)temp;
@@ -347,7 +347,7 @@ static OCStackResult OCParseDiscoveryPayload(OCPayload** outPayload, CborValue*
         err = cbor_value_map_find_value(&policyMap, OC_RSRVD_SECURE, &val);
         if (CborNoError != err)
         {
-            OC_LOG(ERROR, TAG, "Cbor finding secure type failed.");
+            OIC_LOG(ERROR, TAG, "Cbor finding secure type failed.");
             goto malformed_cbor;
         }
         if(cbor_value_is_valid(&val))
@@ -355,7 +355,7 @@ static OCStackResult OCParseDiscoveryPayload(OCPayload** outPayload, CborValue*
             err = cbor_value_get_boolean(&val, &(resource->secure));
             if (CborNoError != err)
             {
-                OC_LOG(ERROR, TAG, "Cbor finding secure value failed.");
+                OIC_LOG(ERROR, TAG, "Cbor finding secure value failed.");
                 goto malformed_cbor;
             }
             // Port
@@ -364,7 +364,7 @@ static OCStackResult OCParseDiscoveryPayload(OCPayload** outPayload, CborValue*
                             &port);
             if (CborNoError != err)
             {
-                OC_LOG(ERROR, TAG, "Cbor finding port type failed.");
+                OIC_LOG(ERROR, TAG, "Cbor finding port type failed.");
                 goto malformed_cbor;
             }
             if (cbor_value_is_valid(&port))
@@ -372,7 +372,7 @@ static OCStackResult OCParseDiscoveryPayload(OCPayload** outPayload, CborValue*
                 err = cbor_value_get_uint64(&port, &temp);
                 if (CborNoError != err)
                 {
-                    OC_LOG(ERROR, TAG, "Cbor finding port value failed.");
+                    OIC_LOG(ERROR, TAG, "Cbor finding port value failed.");
                     goto malformed_cbor;
                 }
                 resource->port = (uint16_t)temp;
@@ -385,7 +385,7 @@ static OCStackResult OCParseDiscoveryPayload(OCPayload** outPayload, CborValue*
             err = cbor_value_map_find_value(&policyMap, OC_RSRVD_HOSTING_PORT, &port);
             if (CborNoError != err)
             {
-                OC_LOG(ERROR, TAG, "Cbor finding port type failed.");
+                OIC_LOG(ERROR, TAG, "Cbor finding port type failed.");
                 goto malformed_cbor;
             }
             if(cbor_value_is_valid(&port))
@@ -393,7 +393,7 @@ static OCStackResult OCParseDiscoveryPayload(OCPayload** outPayload, CborValue*
                 err = cbor_value_get_uint64(&port, &temp);
                 if (CborNoError != err)
                 {
-                    OC_LOG(ERROR, TAG, "Cbor finding port value failed.");
+                    OIC_LOG(ERROR, TAG, "Cbor finding port value failed.");
                     goto malformed_cbor;
                 }
                 resource->port = (uint16_t)temp;
@@ -403,7 +403,7 @@ static OCStackResult OCParseDiscoveryPayload(OCPayload** outPayload, CborValue*
         err = cbor_value_advance(&resourceMap);
         if (CborNoError != err)
         {
-            OC_LOG(ERROR, TAG, "Cbor advance value failed.");
+            OIC_LOG(ERROR, TAG, "Cbor advance value failed.");
             goto malformed_cbor;
         }
         ++resourceCount;
@@ -476,7 +476,7 @@ static OCStackResult OCParseDevicePayload(OCPayload** outPayload, CborValue* roo
             OICFree(dname);
             OICFree(specVer);
             OICFree(dmVer);
-            OC_LOG_V(ERROR, TAG, "CBOR in error condition %d", err);
+            OIC_LOG_V(ERROR, TAG, "CBOR in error condition %d", err);
             return OC_STACK_MALFORMED_RESPONSE;
         }
 
@@ -495,7 +495,7 @@ static OCStackResult OCParseDevicePayload(OCPayload** outPayload, CborValue* roo
     }
     else
     {
-        OC_LOG(ERROR, TAG, "Root device node was not a map");
+        OIC_LOG(ERROR, TAG, "Root device node was not a map");
         return OC_STACK_MALFORMED_RESPONSE;
     }
 
@@ -612,7 +612,7 @@ static OCStackResult OCParsePlatformPayload(OCPayload** outPayload, CborValue* r
             OICFree(info.platformVersion);
             OICFree(info.supportUrl);
             OICFree(info.systemTime);
-            OC_LOG(ERROR, TAG, "CBOR error In ParsePlatformPayload");
+            OIC_LOG(ERROR, TAG, "CBOR error In ParsePlatformPayload");
             return OC_STACK_MALFORMED_RESPONSE;
         }
 
@@ -627,7 +627,7 @@ static OCStackResult OCParsePlatformPayload(OCPayload** outPayload, CborValue* r
     }
     else
     {
-        OC_LOG(ERROR, TAG, "Root device node was not a map");
+        OIC_LOG(ERROR, TAG, "Root device node was not a map");
         return OC_STACK_MALFORMED_RESPONSE;
     }
 }
@@ -678,7 +678,7 @@ static bool OCParseArrayFindDimensionsAndType(const CborValue* parent, size_t di
 
             if (subdim[2] != 0)
             {
-                OC_LOG(ERROR, TAG, "Parse array helper, sub-array too deep");
+                OIC_LOG(ERROR, TAG, "Parse array helper, sub-array too deep");
             }
 
             dimensions[1] = dimensions[1] >= subdim[0] ? dimensions[1] : subdim[0];
@@ -687,7 +687,7 @@ static bool OCParseArrayFindDimensionsAndType(const CborValue* parent, size_t di
             if (*type != OCREP_PROP_NULL && tempType != OCREP_PROP_NULL
                     && *type != tempType)
             {
-                OC_LOG(ERROR, TAG, "Array parse failed, mixed arrays not allowed (subtype)");
+                OIC_LOG(ERROR, TAG, "Array parse failed, mixed arrays not allowed (subtype)");
                 return true;
             }
             else if (*type == OCREP_PROP_NULL)
@@ -705,7 +705,7 @@ static bool OCParseArrayFindDimensionsAndType(const CborValue* parent, size_t di
         else if (tempType != OCREP_PROP_NULL && *type != tempType)
         {
             // this is an invalid situation!
-            OC_LOG(ERROR, TAG, "Array parse failed, mixed arrays not allowed");
+            OIC_LOG(ERROR, TAG, "Array parse failed, mixed arrays not allowed");
             return true;
         }
 
@@ -861,7 +861,7 @@ static bool OCParseArrayFillArray(const CborValue* parent, size_t dimensions[MAX
                     }
                     break;
                 default:
-                    OC_LOG(ERROR, TAG, "Invalid Array type in Parse Array");
+                    OIC_LOG(ERROR, TAG, "Invalid Array type in Parse Array");
                     err = true;
                     break;
             }
@@ -884,7 +884,7 @@ static bool OCParseArray(OCRepPayload* out, const char* name, CborValue* contain
 
     if (err)
     {
-        OC_LOG(ERROR, TAG, "Array details weren't clear");
+        OIC_LOG(ERROR, TAG, "Array details weren't clear");
         return err;
     }
 
@@ -901,7 +901,7 @@ static bool OCParseArray(OCRepPayload* out, const char* name, CborValue* contain
 
     if (!arr)
     {
-        OC_LOG(ERROR, TAG, "Array Parse allocation failed");
+        OIC_LOG(ERROR, TAG, "Array Parse allocation failed");
         return true;
     }
 
@@ -964,7 +964,7 @@ static bool OCParseArray(OCRepPayload* out, const char* name, CborValue* contain
             }
             break;
         default:
-            OC_LOG(ERROR, TAG, "Invalid Array type in Parse Array");
+            OIC_LOG(ERROR, TAG, "Invalid Array type in Parse Array");
             err = true;
             break;
     }
@@ -1075,7 +1075,7 @@ static bool OCParseSingleRepPayload(OCRepPayload** outPayload, CborValue *objMap
                     err = err || OCParseArray(curPayload, name, &repMap);
                     break;
                 default:
-                    OC_LOG_V(ERROR, TAG, "Parsing rep property, unknown type %d", repMap.type);
+                    OIC_LOG_V(ERROR, TAG, "Parsing rep property, unknown type %d", repMap.type);
                     err = true;
             }
 
@@ -1183,7 +1183,7 @@ static OCStackResult OCParseRepPayload(OCPayload** outPayload, CborValue* rootMa
         if(err)
         {
             OCRepPayloadDestroy(rootPayload);
-            OC_LOG(ERROR, TAG, "CBOR error in ParseRepPayload");
+            OIC_LOG(ERROR, TAG, "CBOR error in ParseRepPayload");
             return OC_STACK_MALFORMED_RESPONSE;
         }
     }
@@ -1244,7 +1244,7 @@ static OCStackResult OCParsePresencePayload(OCPayload** outPayload, CborValue* r
         if(err)
         {
             OCPayloadDestroy(*outPayload);
-            OC_LOG(ERROR, TAG, "CBOR error Parse Presence Payload");
+            OIC_LOG(ERROR, TAG, "CBOR error Parse Presence Payload");
             return OC_STACK_MALFORMED_RESPONSE;
         }
 
@@ -1257,7 +1257,7 @@ static OCStackResult OCParsePresencePayload(OCPayload** outPayload, CborValue* r
     }
     else
     {
-        OC_LOG(ERROR, TAG, "Root presence node was not a map");
+        OIC_LOG(ERROR, TAG, "Root presence node was not a map");
         return OC_STACK_MALFORMED_RESPONSE;
     }
 }
index 36c0bc2..523278c 100644 (file)
@@ -53,9 +53,9 @@
 #define TAG "OIC_RI_RESOURCE"
 
 #define VERIFY_SUCCESS(op, successCode) { if (op != successCode) \
-            {OC_LOG_V(FATAL, TAG, "%s failed!!", #op); goto exit;} }
+            {OIC_LOG_V(FATAL, TAG, "%s failed!!", #op); goto exit;} }
 
-#define VERIFY_NON_NULL(arg, logLevel, retVal) { if (!(arg)) { OC_LOG((logLevel), \
+#define VERIFY_NON_NULL(arg, logLevel, retVal) { if (!(arg)) { OIC_LOG((logLevel), \
              TAG, #arg " is NULL"); return (retVal); } }
 
 extern OCResource *headResource;
@@ -123,7 +123,7 @@ static OCStackResult ExtractFiltersFromQuery(char *query, char **filterOne, char
     *filterOne = NULL;
     *filterTwo = NULL;
 
-    OC_LOG_V(INFO, TAG, "Extracting params from %s", query);
+    OIC_LOG_V(INFO, TAG, "Extracting params from %s", query);
 
     char *keyValuePair = strtok_r (query, OC_QUERY_SEPARATOR, &restOfQuery);
 
@@ -131,7 +131,7 @@ static OCStackResult ExtractFiltersFromQuery(char *query, char **filterOne, char
     {
         if (numKeyValuePairsParsed >= 2)
         {
-            OC_LOG(ERROR, TAG, "More than 2 queries params in URI.");
+            OIC_LOG(ERROR, TAG, "More than 2 queries params in URI.");
             return OC_STACK_INVALID_QUERY;
         }
 
@@ -151,7 +151,7 @@ static OCStackResult ExtractFiltersFromQuery(char *query, char **filterOne, char
         }
         else
         {
-            OC_LOG_V(ERROR, TAG, "Unsupported query key: %s", key);
+            OIC_LOG_V(ERROR, TAG, "Unsupported query key: %s", key);
             return OC_STACK_INVALID_QUERY;
         }
         ++numKeyValuePairsParsed;
@@ -159,7 +159,7 @@ static OCStackResult ExtractFiltersFromQuery(char *query, char **filterOne, char
         keyValuePair = strtok_r(NULL, OC_QUERY_SEPARATOR, &restOfQuery);
     }
 
-    OC_LOG_V(INFO, TAG, "Extracted params %s and %s.", *filterOne, *filterTwo);
+    OIC_LOG_V(INFO, TAG, "Extracted params %s and %s.", *filterOne, *filterTwo);
     return OC_STACK_OK;
 }
 
@@ -211,7 +211,7 @@ static OCStackResult getQueryParamsForFiltering (OCVirtualResources uri, char *q
     if (uri == OC_PRESENCE)
     {
         //Nothing needs to be done, except for pass a OC_PRESENCE query through as OC_STACK_OK.
-        OC_LOG(INFO, TAG, "OC_PRESENCE Request for virtual resource.");
+        OIC_LOG(INFO, TAG, "OC_PRESENCE Request for virtual resource.");
         return OC_STACK_OK;
     }
     #endif
@@ -336,7 +336,7 @@ OCResource *FindResourceByUri(const char* resourceUri)
         }
         pointer = pointer->next;
     }
-    OC_LOG_V(INFO, TAG, "Resource %s not found", resourceUri);
+    OIC_LOG_V(INFO, TAG, "Resource %s not found", resourceUri);
     return NULL;
 }
 
@@ -350,12 +350,12 @@ OCStackResult DetermineResourceHandling (const OCServerRequest *request,
         return OC_STACK_INVALID_PARAM;
     }
 
-    OC_LOG_V(INFO, TAG, "DetermineResourceHandling for %s", request->resourceUrl);
+    OIC_LOG_V(INFO, TAG, "DetermineResourceHandling for %s", request->resourceUrl);
 
     // Check if virtual resource
     if (GetTypeOfVirtualURI(request->resourceUrl) != OC_UNKNOWN_URI)
     {
-        OC_LOG_V (INFO, TAG, "%s is virtual", request->resourceUrl);
+        OIC_LOG_V (INFO, TAG, "%s is virtual", request->resourceUrl);
         *handling = OC_RESOURCE_VIRTUAL;
         *resource = headResource;
         return OC_STACK_OK;
@@ -473,7 +473,7 @@ static bool resourceMatchesRTFilter(OCResource *resource, char *resourceTypeFilt
         resourceTypePtr = resourceTypePtr->next;
     }
 
-    OC_LOG_V(INFO, TAG, "%s does not contain rt=%s.", resource->uri, resourceTypeFilter);
+    OIC_LOG_V(INFO, TAG, "%s does not contain rt=%s.", resource->uri, resourceTypeFilter);
     return false;
 }
 
@@ -501,7 +501,7 @@ static bool resourceMatchesIFFilter(OCResource *resource, char *interfaceFilter)
         interfacePtr = interfacePtr->next;
     }
 
-    OC_LOG_V(INFO, TAG, "%s does not contain if=%s.", resource->uri, interfaceFilter);
+    OIC_LOG_V(INFO, TAG, "%s does not contain if=%s.", resource->uri, interfaceFilter);
     return false;
 }
 
@@ -516,7 +516,7 @@ static bool includeThisResourceInResponse(OCResource *resource,
 {
     if (!resource)
     {
-        OC_LOG(ERROR, TAG, "Invalid resource");
+        OIC_LOG(ERROR, TAG, "Invalid resource");
         return false;
     }
 
@@ -529,7 +529,7 @@ static bool includeThisResourceInResponse(OCResource *resource,
         if (!((interfaceFilter && *interfaceFilter ) ||
               (resourceTypeFilter && *resourceTypeFilter)))
         {
-            OC_LOG_V(INFO, TAG, "%s no query string for EXPLICIT_DISCOVERABLE \
+            OIC_LOG_V(INFO, TAG, "%s no query string for EXPLICIT_DISCOVERABLE \
                 resource", resource->uri);
             return false;
         }
@@ -537,7 +537,7 @@ static bool includeThisResourceInResponse(OCResource *resource,
     else if ( !(resource->resourceProperties & OC_ACTIVE) ||
          !(resource->resourceProperties & OC_DISCOVERABLE))
     {
-        OC_LOG_V(INFO, TAG, "%s not ACTIVE or DISCOVERABLE", resource->uri);
+        OIC_LOG_V(INFO, TAG, "%s not ACTIVE or DISCOVERABLE", resource->uri);
         return false;
     }
 
@@ -649,7 +649,7 @@ static OCStackResult checkResourceExistsAtRD(const char *interfaceType, const ch
     }
     else
     {
-        OC_LOG_V(ERROR, TAG, "The resource type or interface type doe not exist \
+        OIC_LOG_V(ERROR, TAG, "The resource type or interface type doe not exist \
                              on the resource directory");
     }
     return OC_STACK_ERROR;
@@ -668,7 +668,7 @@ static OCStackResult HandleVirtualResource (OCServerRequest *request, OCResource
     bool bMulticast    = false;     // Was the discovery request a multicast request?
     OCPayload* payload = NULL;
 
-    OC_LOG(INFO, TAG, "Entering HandleVirtualResource");
+    OIC_LOG(INFO, TAG, "Entering HandleVirtualResource");
 
     OCVirtualResources virtualUriInRequest = GetTypeOfVirtualURI (request->resourceUrl);
 
@@ -734,7 +734,7 @@ static OCStackResult HandleVirtualResource (OCServerRequest *request, OCResource
         }
         else
         {
-            OC_LOG_V(ERROR, TAG, "Error (%d) parsing query.", discoveryResult);
+            OIC_LOG_V(ERROR, TAG, "Error (%d) parsing query.", discoveryResult);
         }
     }
     else if (virtualUriInRequest == OC_DEVICE_URI)
@@ -774,7 +774,7 @@ static OCStackResult HandleVirtualResource (OCServerRequest *request, OCResource
     else if (OC_GATEWAY_URI == virtualUriInRequest)
     {
         // Received request for a gateway
-        OC_LOG(INFO, TAG, "Request is for Gateway Virtual Request");
+        OIC_LOG(INFO, TAG, "Request is for Gateway Virtual Request");
         discoveryResult = RMHandleGatewayRequest(request, resource);
 
     }
@@ -815,7 +815,7 @@ static OCStackResult HandleVirtualResource (OCServerRequest *request, OCResource
         else if(bMulticast == false && (request->devAddr.adapter != OC_ADAPTER_RFCOMM_BTEDR) &&
                (request->devAddr.adapter != OC_ADAPTER_GATT_BTLE))
         {
-            OC_LOG_V(ERROR, TAG, "Sending a (%d) error to (%d)  \
+            OIC_LOG_V(ERROR, TAG, "Sending a (%d) error to (%d)  \
                 discovery request", discoveryResult, virtualUriInRequest);
             SendNonPersistantDiscoveryResponse(request, resource, NULL,
                 (discoveryResult == OC_STACK_NO_RESOURCE) ? OC_EH_RESOURCE_NOT_FOUND : OC_EH_ERROR);
@@ -823,7 +823,7 @@ static OCStackResult HandleVirtualResource (OCServerRequest *request, OCResource
         else
         {
             // Ignoring the discovery request as per RFC 7252, Section #8.2
-            OC_LOG(INFO, TAG, "Silently ignoring the request since device does not have \
+            OIC_LOG(INFO, TAG, "Silently ignoring the request since device does not have \
                 any useful data to send");
         }
     }
@@ -845,7 +845,7 @@ HandleDefaultDeviceEntityHandler (OCServerRequest *request)
     OCEntityHandlerResult ehResult = OC_EH_ERROR;
     OCEntityHandlerRequest ehRequest = {0};
 
-    OC_LOG(INFO, TAG, "Entering HandleResourceWithDefaultDeviceEntityHandler");
+    OIC_LOG(INFO, TAG, "Entering HandleResourceWithDefaultDeviceEntityHandler");
     result = FormOCEntityHandlerRequest(&ehRequest,
                                         (OCRequestHandle) request,
                                         request->method,
@@ -865,7 +865,7 @@ HandleDefaultDeviceEntityHandler (OCServerRequest *request)
                                   (char*) request->resourceUrl, defaultDeviceHandlerCallbackParameter);
     if(ehResult == OC_EH_SLOW)
     {
-        OC_LOG(INFO, TAG, "This is a slow resource");
+        OIC_LOG(INFO, TAG, "This is a slow resource");
         request->slowFlag = 1;
     }
     else if(ehResult == OC_EH_ERROR)
@@ -895,7 +895,7 @@ HandleResourceWithEntityHandler (OCServerRequest *request,
 
     OCEntityHandlerRequest ehRequest = {0};
 
-    OC_LOG(INFO, TAG, "Entering HandleResourceWithEntityHandler");
+    OIC_LOG(INFO, TAG, "Entering HandleResourceWithEntityHandler");
     OCPayloadType type = PAYLOAD_TYPE_REPRESENTATION;
     // check the security resource
     if (request && request->resourceUrl && SRMIsSecurityResourceURI(request->resourceUrl))
@@ -926,22 +926,22 @@ HandleResourceWithEntityHandler (OCServerRequest *request,
 
     if(ehRequest.obsInfo.action == OC_OBSERVE_NO_OPTION)
     {
-        OC_LOG(INFO, TAG, "No observation requested");
+        OIC_LOG(INFO, TAG, "No observation requested");
         ehFlag = OC_REQUEST_FLAG;
     }
     else if(ehRequest.obsInfo.action == OC_OBSERVE_REGISTER && !collectionResource)
     {
-        OC_LOG(INFO, TAG, "Observation registration requested");
+        OIC_LOG(INFO, TAG, "Observation registration requested");
 
         ResourceObserver *obs = GetObserverUsingToken (request->requestToken,
                                     request->tokenLength);
 
         if (obs)
         {
-            OC_LOG (INFO, TAG, "Observer with this token already present");
-            OC_LOG (INFO, TAG, "Possibly re-transmitted CON OBS request");
-            OC_LOG (INFO, TAG, "Not adding observer. Not responding to client");
-            OC_LOG (INFO, TAG, "The first request for this token is already ACKED.");
+            OIC_LOG (INFO, TAG, "Observer with this token already present");
+            OIC_LOG (INFO, TAG, "Possibly re-transmitted CON OBS request");
+            OIC_LOG (INFO, TAG, "Not adding observer. Not responding to client");
+            OIC_LOG (INFO, TAG, "The first request for this token is already ACKED.");
 
             // server requests are usually free'd when the response is sent out
             // for the request in ocserverrequest.c : HandleSingleResponse()
@@ -962,7 +962,7 @@ HandleResourceWithEntityHandler (OCServerRequest *request,
 
         if(result == OC_STACK_OK)
         {
-            OC_LOG(INFO, TAG, "Added observer successfully");
+            OIC_LOG(INFO, TAG, "Added observer successfully");
             request->observeResult = OC_STACK_OK;
             ehFlag = (OCEntityHandlerFlag)(OC_REQUEST_FLAG | OC_OBSERVE_FLAG);
         }
@@ -973,7 +973,7 @@ HandleResourceWithEntityHandler (OCServerRequest *request,
             // The error in observeResult for the request will be used when responding to this
             // request by omitting the observation option/sequence number.
             request->observeResult = OC_STACK_ERROR;
-            OC_LOG(ERROR, TAG, "Observer Addition failed");
+            OIC_LOG(ERROR, TAG, "Observer Addition failed");
             ehFlag = OC_REQUEST_FLAG;
         }
 
@@ -981,7 +981,7 @@ HandleResourceWithEntityHandler (OCServerRequest *request,
     else if(ehRequest.obsInfo.action == OC_OBSERVE_DEREGISTER &&
             !collectionResource)
     {
-        OC_LOG(INFO, TAG, "Deregistering observation requested");
+        OIC_LOG(INFO, TAG, "Deregistering observation requested");
 
         resObs = GetObserverUsingToken (request->requestToken, request->tokenLength);
 
@@ -999,14 +999,14 @@ HandleResourceWithEntityHandler (OCServerRequest *request,
 
         if(result == OC_STACK_OK)
         {
-            OC_LOG(INFO, TAG, "Removed observer successfully");
+            OIC_LOG(INFO, TAG, "Removed observer successfully");
             request->observeResult = OC_STACK_OK;
         }
         else
         {
             result = OC_STACK_OK;
             request->observeResult = OC_STACK_ERROR;
-            OC_LOG(ERROR, TAG, "Observer Removal failed");
+            OIC_LOG(ERROR, TAG, "Observer Removal failed");
         }
     }
     else
@@ -1018,7 +1018,7 @@ HandleResourceWithEntityHandler (OCServerRequest *request,
     ehResult = resource->entityHandler(ehFlag, &ehRequest, resource->entityHandlerCallbackParam);
     if(ehResult == OC_EH_SLOW)
     {
-        OC_LOG(INFO, TAG, "This is a slow resource");
+        OIC_LOG(INFO, TAG, "This is a slow resource");
         request->slowFlag = 1;
     }
     else if(ehResult == OC_EH_ERROR)
@@ -1084,7 +1084,7 @@ ProcessRequest(ResourceHandling resHandling, OCResource *resource, OCServerReque
         }
         case OC_RESOURCE_NOT_COLLECTION_DEFAULT_ENTITYHANDLER:
         {
-            OC_LOG(INFO, TAG, "OC_RESOURCE_NOT_COLLECTION_DEFAULT_ENTITYHANDLER");
+            OIC_LOG(INFO, TAG, "OC_RESOURCE_NOT_COLLECTION_DEFAULT_ENTITYHANDLER");
             return OC_STACK_ERROR;
         }
         case OC_RESOURCE_NOT_COLLECTION_WITH_ENTITYHANDLER:
@@ -1109,7 +1109,7 @@ ProcessRequest(ResourceHandling resHandling, OCResource *resource, OCServerReque
         }
         default:
         {
-            OC_LOG(INFO, TAG, "Invalid Resource Determination");
+            OIC_LOG(INFO, TAG, "Invalid Resource Determination");
             return OC_STACK_ERROR;
         }
     }
@@ -1118,7 +1118,7 @@ ProcessRequest(ResourceHandling resHandling, OCResource *resource, OCServerReque
 
 void DeletePlatformInfo()
 {
-    OC_LOG(INFO, TAG, "Deleting platform info.");
+    OIC_LOG(INFO, TAG, "Deleting platform info.");
 
     OICFree(savedPlatformInfo.platformID);
     savedPlatformInfo.platformID = NULL;
@@ -1196,11 +1196,11 @@ OCStackResult SavePlatformInfo(OCPlatformInfo info)
 
     if (res != OC_STACK_OK)
     {
-        OC_LOG_V(ERROR, TAG, "Failed to save platform info. errno(%d)", res);
+        OIC_LOG_V(ERROR, TAG, "Failed to save platform info. errno(%d)", res);
     }
     else
     {
-        OC_LOG(INFO, TAG, "Platform info saved.");
+        OIC_LOG(INFO, TAG, "Platform info saved.");
     }
 
     return res;
@@ -1208,7 +1208,7 @@ OCStackResult SavePlatformInfo(OCPlatformInfo info)
 
 void DeleteDeviceInfo()
 {
-    OC_LOG(INFO, TAG, "Deleting device info.");
+    OIC_LOG(INFO, TAG, "Deleting device info.");
 
     OICFree(savedDeviceInfo.deviceName);
     savedDeviceInfo.deviceName = NULL;
@@ -1239,12 +1239,12 @@ OCStackResult SaveDeviceInfo(OCDeviceInfo info)
 
     if(OCGetServerInstanceID() == NULL)
     {
-        OC_LOG(INFO, TAG, "Device ID generation failed");
+        OIC_LOG(INFO, TAG, "Device ID generation failed");
         res =  OC_STACK_ERROR;
         goto exit;
     }
 
-    OC_LOG(INFO, TAG, "Device initialized successfully.");
+    OIC_LOG(INFO, TAG, "Device initialized successfully.");
     return OC_STACK_OK;
 
 exit:
index 9958b88..45ed112 100755 (executable)
@@ -39,7 +39,7 @@
 #include "pdu.h"
 
 // Module Name
-#define VERIFY_NON_NULL(arg) { if (!arg) {OC_LOG(FATAL, TAG, #arg " is NULL"); goto exit;} }
+#define VERIFY_NON_NULL(arg) { if (!arg) {OIC_LOG(FATAL, TAG, #arg " is NULL"); goto exit;} }
 
 #define TAG  "OIC_RI_SERVERREQUEST"
 
@@ -76,7 +76,7 @@ static OCStackResult AddServerResponse (OCServerResponse ** response, OCRequestH
     serverResponse->requestHandle = requestHandle;
 
     *response = serverResponse;
-    OC_LOG(INFO, TAG, "Server Response Added!!");
+    OIC_LOG(INFO, TAG, "Server Response Added!!");
     LL_APPEND (serverResponseList, serverResponse);
     return OC_STACK_OK;
 
@@ -103,7 +103,7 @@ static void DeleteServerRequest(OCServerRequest * serverRequest)
         OICFree(serverRequest->requestToken);
         OICFree(serverRequest);
         serverRequest = NULL;
-        OC_LOG(INFO, TAG, "Server Request Removed!!");
+        OIC_LOG(INFO, TAG, "Server Request Removed!!");
     }
 }
 
@@ -119,7 +119,7 @@ static void DeleteServerResponse(OCServerResponse * serverResponse)
         LL_DELETE(serverResponseList, serverResponse);
         OCPayloadDestroy(serverResponse->payload);
         OICFree(serverResponse);
-        OC_LOG(INFO, TAG, "Server Response Removed!!");
+        OIC_LOG(INFO, TAG, "Server Response Removed!!");
     }
 }
 
@@ -161,7 +161,7 @@ static OCStackResult OCSendResponse(const CAEndpoint_t *object, CAResponseInfo_t
                        &(responseInfo->info.numOptions));
     if(OC_STACK_OK != rmResult)
     {
-        OC_LOG(ERROR, TAG, "Add option failed");
+        OIC_LOG(ERROR, TAG, "Add option failed");
         return rmResult;
     }
 #endif
@@ -171,7 +171,7 @@ static OCStackResult OCSendResponse(const CAEndpoint_t *object, CAResponseInfo_t
     CAResult_t result = CASendResponse(object, responseInfo);
     if(CA_STATUS_OK != result)
     {
-        OC_LOG_V(ERROR, TAG, "CASendResponse failed with CA error %u", result);
+        OIC_LOG_V(ERROR, TAG, "CASendResponse failed with CA error %u", result);
         return CAResultToOCResult(result);
     }
     return OC_STACK_OK;
@@ -194,24 +194,24 @@ OCServerRequest * GetServerRequestUsingToken (const CAToken_t token, uint8_t tok
 {
     if(!token)
     {
-        OC_LOG(ERROR, TAG, "Invalid Parameter Token");
+        OIC_LOG(ERROR, TAG, "Invalid Parameter Token");
         return NULL;
     }
 
     OCServerRequest * out = NULL;
-    OC_LOG(INFO, TAG,"Get server request with token");
-    OC_LOG_BUFFER(INFO, TAG, (const uint8_t *)token, tokenLength);
+    OIC_LOG(INFO, TAG,"Get server request with token");
+    OIC_LOG_BUFFER(INFO, TAG, (const uint8_t *)token, tokenLength);
 
-    OC_LOG(INFO, TAG,"Found token");
+    OIC_LOG(INFO, TAG,"Found token");
     LL_FOREACH (serverRequestList, out)
     {
-        OC_LOG_BUFFER(INFO, TAG, (const uint8_t *)out->requestToken, tokenLength);
+        OIC_LOG_BUFFER(INFO, TAG, (const uint8_t *)out->requestToken, tokenLength);
         if(memcmp(out->requestToken, token, tokenLength) == 0)
         {
             return out;
         }
     }
-    OC_LOG(ERROR, TAG, "Server Request not found!!");
+    OIC_LOG(ERROR, TAG, "Server Request not found!!");
     return NULL;
 }
 
@@ -232,7 +232,7 @@ OCServerRequest * GetServerRequestUsingHandle (const OCServerRequest * handle)
             return out;
         }
     }
-    OC_LOG(ERROR, TAG, "Server Request not found!!");
+    OIC_LOG(ERROR, TAG, "Server Request not found!!");
     return NULL;
 }
 
@@ -254,7 +254,7 @@ OCServerResponse * GetServerResponseUsingHandle (const OCServerRequest * handle)
             return out;
         }
     }
-    OC_LOG(ERROR, TAG, "Server Response not found!!");
+    OIC_LOG(ERROR, TAG, "Server Response not found!!");
     return NULL;
 }
 
@@ -274,7 +274,7 @@ OCStackResult AddServerRequest (OCServerRequest ** request, uint16_t coapID,
 
     OCServerRequest * serverRequest = NULL;
 
-    OC_LOG_V(INFO, TAG, "addserverrequest entry!! [%s:%u]", devAddr->addr, devAddr->port);
+    OIC_LOG_V(INFO, TAG, "addserverrequest entry!! [%s:%u]", devAddr->addr, devAddr->port);
 
     serverRequest = (OCServerRequest *) OICCalloc(1, sizeof(OCServerRequest) +
         (reqTotalSize ? reqTotalSize : 1) - 1);
@@ -336,7 +336,7 @@ OCStackResult AddServerRequest (OCServerRequest ** request, uint16_t coapID,
     serverRequest->devAddr = *devAddr;
 
     *request = serverRequest;
-    OC_LOG(INFO, TAG, "Server Request Added!!");
+    OIC_LOG(INFO, TAG, "Server Request Added!!");
     LL_APPEND (serverRequestList, serverRequest);
     return OC_STACK_OK;
 
@@ -442,7 +442,7 @@ CAResponseResult_t ConvertEHResultToCAResult (OCEntityHandlerResult result, OCMe
                    // This should not happen but,
                    // give it a value just in case but output an error
                    caResult = CA_CONTENT;
-                   OC_LOG_V(ERROR, TAG, "Unexpected OC_EH_OK return code for method [%d].", method);
+                   OIC_LOG_V(ERROR, TAG, "Unexpected OC_EH_OK return code for method [%d].", method);
            }
             break;
         case OC_EH_ERROR:
@@ -522,7 +522,7 @@ OCStackResult HandleSingleResponse(OCEntityHandlerResponse * ehResponse)
     }
     else
     {
-        OC_LOG(ERROR, TAG, "default responseInfo type is NON");
+        OIC_LOG(ERROR, TAG, "default responseInfo type is NON");
         responseInfo.info.type = CA_MSG_NONCONFIRM;
     }
 
@@ -550,7 +550,7 @@ OCStackResult HandleSingleResponse(OCEntityHandlerResponse * ehResponse)
 
         if(!responseInfo.info.options)
         {
-            OC_LOG(FATAL, TAG, "Memory alloc for options failed");
+            OIC_LOG(FATAL, TAG, "Memory alloc for options failed");
             return OC_STACK_NO_MEMORY;
         }
 
@@ -614,7 +614,7 @@ OCStackResult HandleSingleResponse(OCEntityHandlerResponse * ehResponse)
                                 &responseInfo.info.payloadSize))
                         != OC_STACK_OK)
                 {
-                    OC_LOG(ERROR, TAG, "Error converting payload");
+                    OIC_LOG(ERROR, TAG, "Error converting payload");
                     OICFree(responseInfo.info.options);
                     return result;
                 }
@@ -675,11 +675,11 @@ OCStackResult HandleSingleResponse(OCEntityHandlerResponse * ehResponse)
     }
 #else
 
-    OC_LOG(INFO, TAG, "Calling OCSendResponse with:");
-    OC_LOG_V(INFO, TAG, "\tEndpoint address: %s", responseEndpoint.addr);
-    OC_LOG_V(INFO, TAG, "\tEndpoint adapter: %s", responseEndpoint.adapter);
-    OC_LOG_V(INFO, TAG, "\tResponse result : %s", responseInfo.result);
-    OC_LOG_V(INFO, TAG, "\tResponse for uri: %s", responseInfo.info.resourceUri);
+    OIC_LOG(INFO, TAG, "Calling OCSendResponse with:");
+    OIC_LOG_V(INFO, TAG, "\tEndpoint address: %s", responseEndpoint.addr);
+    OIC_LOG_V(INFO, TAG, "\tEndpoint adapter: %s", responseEndpoint.adapter);
+    OIC_LOG_V(INFO, TAG, "\tResponse result : %s", responseInfo.result);
+    OIC_LOG_V(INFO, TAG, "\tResponse for uri: %s", responseInfo.info.resourceUri);
 
     result = OCSendResponse(&responseEndpoint, &responseInfo);
 #endif
@@ -707,11 +707,11 @@ OCStackResult HandleAggregateResponse(OCEntityHandlerResponse * ehResponse)
 {
     if(!ehResponse || !ehResponse->payload)
     {
-        OC_LOG(ERROR, TAG, "HandleAggregateResponse invalid parameters");
+        OIC_LOG(ERROR, TAG, "HandleAggregateResponse invalid parameters");
         return OC_STACK_INVALID_PARAM;
     }
 
-    OC_LOG(INFO, TAG, "Inside HandleAggregateResponse");
+    OIC_LOG(INFO, TAG, "Inside HandleAggregateResponse");
 
     OCServerRequest *serverRequest = GetServerRequestUsingHandle((OCServerRequest *)
                                                                  ehResponse->requestHandle);
@@ -723,11 +723,11 @@ OCStackResult HandleAggregateResponse(OCEntityHandlerResponse * ehResponse)
     {
         if(!serverResponse)
         {
-            OC_LOG(INFO, TAG, "This is the first response fragment");
+            OIC_LOG(INFO, TAG, "This is the first response fragment");
             stackRet = AddServerResponse(&serverResponse, ehResponse->requestHandle);
             if (OC_STACK_OK != stackRet)
             {
-                OC_LOG(ERROR, TAG, "Error adding server response");
+                OIC_LOG(ERROR, TAG, "Error adding server response");
                 return stackRet;
             }
             VERIFY_NON_NULL(serverResponse);
@@ -736,7 +736,7 @@ OCStackResult HandleAggregateResponse(OCEntityHandlerResponse * ehResponse)
         if(ehResponse->payload->type != PAYLOAD_TYPE_REPRESENTATION)
         {
             stackRet = OC_STACK_ERROR;
-            OC_LOG(ERROR, TAG, "Error adding payload, as it was the incorrect type");
+            OIC_LOG(ERROR, TAG, "Error adding payload, as it was the incorrect type");
             goto exit;
         }
 
@@ -757,7 +757,7 @@ OCStackResult HandleAggregateResponse(OCEntityHandlerResponse * ehResponse)
 
         if(serverRequest->numResponses == 0)
         {
-            OC_LOG(INFO, TAG, "This is the last response fragment");
+            OIC_LOG(INFO, TAG, "This is the last response fragment");
             ehResponse->payload = serverResponse->payload;
             stackRet = HandleSingleResponse(ehResponse);
             //Delete the request and response
@@ -766,7 +766,7 @@ OCStackResult HandleAggregateResponse(OCEntityHandlerResponse * ehResponse)
         }
         else
         {
-            OC_LOG(INFO, TAG, "More response fragments to come");
+            OIC_LOG(INFO, TAG, "More response fragments to come");
             stackRet = OC_STACK_OK;
         }
     }
index ddb0c0b..992819e 100644 (file)
@@ -125,12 +125,12 @@ static const char COAP_TCP[] = "coap+tcp:";
 //-----------------------------------------------------------------------------
 #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
@@ -466,7 +466,7 @@ static OCStackResult OCSendRequest(const CAEndpoint_t *object, CARequestInfo_t *
                                      &(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
@@ -476,7 +476,7 @@ static OCStackResult OCSendRequest(const CAEndpoint_t *object, CARequestInfo_t *
     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;
@@ -496,7 +496,7 @@ OCStackResult OCStackFeedBack(CAToken_t token, uint8_t tokenLength, uint8_t stat
     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)
         {
@@ -520,17 +520,17 @@ OCStackResult OCStackFeedBack(CAToken_t token, uint8_t tokenLength, uint8_t stat
         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)
         {
@@ -545,7 +545,7 @@ OCStackResult OCStackFeedBack(CAToken_t token, uint8_t tokenLength, uint8_t stat
         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)
         {
@@ -570,12 +570,12 @@ OCStackResult OCStackFeedBack(CAToken_t token, uint8_t tokenLength, uint8_t stat
                 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
@@ -584,11 +584,11 @@ OCStackResult OCStackFeedBack(CAToken_t token, uint8_t tokenLength, uint8_t stat
                 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;
         }
@@ -655,7 +655,7 @@ CAResponseResult_t OCToCAStackResult(OCStackResult ocCode, OCMethod method)
                    // 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:
@@ -716,7 +716,7 @@ static OCStackResult ResetPresenceTTL(ClientCB *cbNode, uint32_t maxAgeSeconds)
         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;
 
@@ -749,14 +749,14 @@ static OCStackResult ResetPresenceTTL(ClientCB *cbNode, uint32_t 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;
 }
 
@@ -862,7 +862,7 @@ OCStackResult HandlePresenceResponse(const CAEndpoint_t *endpoint,
 
     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;
     }
 
@@ -895,7 +895,7 @@ OCStackResult HandlePresenceResponse(const CAEndpoint_t *endpoint,
 
     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;
     }
 
@@ -914,12 +914,12 @@ OCStackResult HandlePresenceResponse(const CAEndpoint_t *endpoint,
 
         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;
         }
@@ -932,15 +932,15 @@ OCStackResult HandlePresenceResponse(const CAEndpoint_t *endpoint,
     {
         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)
             {
@@ -957,7 +957,7 @@ OCStackResult HandlePresenceResponse(const CAEndpoint_t *endpoint,
 
                 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;
                 }
@@ -967,7 +967,7 @@ OCStackResult HandlePresenceResponse(const CAEndpoint_t *endpoint,
                 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;
@@ -999,14 +999,14 @@ OCStackResult HandlePresenceResponse(const CAEndpoint_t *endpoint,
         {
             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;
             }
         }
@@ -1015,7 +1015,7 @@ OCStackResult HandlePresenceResponse(const CAEndpoint_t *endpoint,
             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;
@@ -1024,7 +1024,7 @@ OCStackResult HandlePresenceResponse(const CAEndpoint_t *endpoint,
             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;
@@ -1059,7 +1059,7 @@ void HandleCAResponses(const CAEndpoint_t* endPoint, const CAResponseInfo_t* res
     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
@@ -1074,7 +1074,7 @@ void HandleCAResponses(const CAEndpoint_t* endPoint, const CAResponseInfo_t* res
                                          &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
@@ -1104,23 +1104,23 @@ void HandleCAResponses(const CAEndpoint_t* endPoint, const CAResponseInfo_t* res
 
     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}};
@@ -1138,8 +1138,8 @@ void HandleCAResponses(const CAEndpoint_t* endPoint, const CAResponseInfo_t* res
         }
         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}};
@@ -1189,7 +1189,7 @@ void HandleCAResponses(const CAEndpoint_t* endPoint, const CAResponseInfo_t* res
                     }
                     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;
                     }
@@ -1210,14 +1210,14 @@ void HandleCAResponses(const CAEndpoint_t* endPoint, const CAResponseInfo_t* res
                     }
                     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;
                 }
@@ -1227,7 +1227,7 @@ void HandleCAResponses(const CAEndpoint_t* endPoint, const CAResponseInfo_t* res
                             responseInfo->info.payload,
                             responseInfo->info.payloadSize))
                 {
-                    OC_LOG(ERROR, TAG, "Error converting payload");
+                    OIC_LOG(ERROR, TAG, "Error converting payload");
                     OCPayloadDestroy(response.payload);
                     return;
                 }
@@ -1262,7 +1262,7 @@ void HandleCAResponses(const CAEndpoint_t* endPoint, const CAResponseInfo_t* res
 
                 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;
                 }
@@ -1278,7 +1278,7 @@ void HandleCAResponses(const CAEndpoint_t* endPoint, const CAResponseInfo_t* res
                 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
@@ -1314,26 +1314,26 @@ void HandleCAResponses(const CAEndpoint_t* endPoint, const CAResponseInfo_t* res
 
     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);
         }
@@ -1345,14 +1345,14 @@ void HandleCAResponses(const CAEndpoint_t* endPoint, const CAResponseInfo_t* res
         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);
             }
@@ -1361,15 +1361,15 @@ void HandleCAResponses(const CAEndpoint_t* endPoint, const CAResponseInfo_t* res
         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);
             }
         }
@@ -1377,7 +1377,7 @@ void HandleCAResponses(const CAEndpoint_t* endPoint, const CAResponseInfo_t* res
         return;
     }
 
-    OC_LOG(INFO, TAG, "Exit HandleCAResponses");
+    OIC_LOG(INFO, TAG, "Exit HandleCAResponses");
 }
 
 /*
@@ -1386,20 +1386,20 @@ void HandleCAResponses(const CAEndpoint_t* endPoint, const CAResponseInfo_t* res
  */
 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");
 }
 
 /*
@@ -1441,7 +1441,7 @@ OCStackResult SendDirectStackResponse(const CAEndpoint_t* endPoint, const uint16
                                      &(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
@@ -1454,7 +1454,7 @@ OCStackResult SendDirectStackResponse(const CAEndpoint_t* endPoint, const uint16
     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;
@@ -1463,16 +1463,16 @@ OCStackResult SendDirectStackResponse(const CAEndpoint_t* endPoint, const uint16
 //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;
     }
 
@@ -1490,7 +1490,7 @@ void HandleCARequests(const CAEndpoint_t* endPoint, const CARequestInfo_t* reque
                                      &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
@@ -1514,7 +1514,7 @@ void HandleCARequests(const CAEndpoint_t* endPoint, const CARequestInfo_t* reque
 
     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;
@@ -1523,11 +1523,11 @@ void HandleCARequests(const CAEndpoint_t* endPoint, const CARequestInfo_t* reque
 
     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)
     {
@@ -1536,7 +1536,7 @@ void HandleCARequests(const CAEndpoint_t* endPoint, const CARequestInfo_t* reque
     }
     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;
@@ -1551,7 +1551,7 @@ void HandleCARequests(const CAEndpoint_t* endPoint, const CARequestInfo_t* reque
         }
         else
         {
-            OC_LOG(ERROR, TAG, "Query length exceeds MAX_QUERY_LENGTH.");
+            OIC_LOG(ERROR, TAG, "Query length exceeds MAX_QUERY_LENGTH.");
             OICFree(query);
             return;
         }
@@ -1584,7 +1584,7 @@ void HandleCARequests(const CAEndpoint_t* endPoint, const CARequestInfo_t* reque
             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,
@@ -1593,7 +1593,7 @@ void HandleCARequests(const CAEndpoint_t* endPoint, const CARequestInfo_t* reque
             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;
@@ -1603,7 +1603,7 @@ void HandleCARequests(const CAEndpoint_t* endPoint, const CARequestInfo_t* reque
 
         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,
@@ -1653,7 +1653,7 @@ void HandleCARequests(const CAEndpoint_t* endPoint, const CARequestInfo_t* reque
     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,
@@ -1680,7 +1680,7 @@ void HandleCARequests(const CAEndpoint_t* endPoint, const CARequestInfo_t* reque
     }
     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);
@@ -1694,18 +1694,18 @@ void HandleCARequests(const CAEndpoint_t* endPoint, const CARequestInfo_t* reque
     // 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;
     }
 
@@ -1713,7 +1713,7 @@ OCStackResult HandleStackRequests(OCServerProtocolRequest * protocolRequest)
             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,
@@ -1725,13 +1725,13 @@ OCStackResult HandleStackRequests(OCServerProtocolRequest * protocolRequest)
                 &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;
         }
 
@@ -1742,12 +1742,12 @@ OCStackResult HandleStackRequests(OCServerProtocolRequest * protocolRequest)
     }
     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)
         {
@@ -1756,7 +1756,7 @@ OCStackResult HandleStackRequests(OCServerProtocolRequest * protocolRequest)
     }
     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;
@@ -1767,7 +1767,7 @@ bool validatePlatformInfo(OCPlatformInfo info)
 
     if (!info.platformID)
     {
-        OC_LOG(ERROR, TAG, "No platform ID found.");
+        OIC_LOG(ERROR, TAG, "No platform ID found.");
         return false;
     }
 
@@ -1777,13 +1777,13 @@ bool validatePlatformInfo(OCPlatformInfo info)
 
         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;
     }
 
@@ -1791,7 +1791,7 @@ bool validatePlatformInfo(OCPlatformInfo info)
     {
         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;
         }
     }
@@ -1830,7 +1830,7 @@ OCStackResult OCInit1(OCMode mode, OCTransportFlags serverFlags, OCTransportFlag
 {
     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;
     }
@@ -1838,7 +1838,7 @@ OCStackResult OCInit1(OCMode mode, OCTransportFlags serverFlags, OCTransportFlag
 #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
@@ -1846,19 +1846,19 @@ OCStackResult OCInit1(OCMode mode, OCTransportFlags serverFlags, OCTransportFlag
 #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;
@@ -1897,12 +1897,12 @@ OCStackResult OCInit1(OCMode mode, OCTransportFlags serverFlags, OCTransportFlag
         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:
@@ -1946,7 +1946,7 @@ OCStackResult OCInit1(OCMode mode, OCTransportFlags serverFlags, OCTransportFlag
 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;
@@ -1956,16 +1956,16 @@ exit:
 
 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;
     }
 
@@ -2007,13 +2007,13 @@ OCStackResult OCStartMulticastServer()
 {
     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;
@@ -2024,7 +2024,7 @@ OCStackResult OCStopMulticastServer()
     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;
@@ -2310,7 +2310,7 @@ OCStackResult OCDoResource(OCDoHandle *handle,
                             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);
@@ -2352,7 +2352,7 @@ OCStackResult OCDoResource(OCDoHandle *handle,
 
     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;
     }
 
@@ -2403,7 +2403,7 @@ OCStackResult OCDoResource(OCDoHandle *handle,
 
     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;
     }
@@ -2430,7 +2430,7 @@ OCStackResult OCDoResource(OCDoHandle *handle,
     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;
     }
@@ -2468,7 +2468,7 @@ OCStackResult OCDoResource(OCDoHandle *handle,
             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;
@@ -2482,7 +2482,7 @@ OCStackResult OCDoResource(OCDoHandle *handle,
 
     if (result != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "CACreateEndpoint error");
+        OIC_LOG(ERROR, TAG, "CACreateEndpoint error");
         goto exit;
     }
 
@@ -2531,7 +2531,7 @@ OCStackResult OCDoResource(OCDoHandle *handle,
 exit:
     if (result != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCDoResource error");
+        OIC_LOG(ERROR, TAG, "OCDoResource error");
         FindAndDeleteClientCB(clientCB);
         CADestroyToken(token);
         if (handle)
@@ -2583,7 +2583,7 @@ OCStackResult OCCancel(OCDoHandle handle, OCQualityOfService qos, OCHeaderOption
     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;
     }
 
@@ -2592,7 +2592,7 @@ OCStackResult OCCancel(OCDoHandle handle, OCQualityOfService qos, OCHeaderOption
         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)
             {
@@ -2600,7 +2600,7 @@ OCStackResult OCCancel(OCDoHandle handle, OCQualityOfService qos, OCHeaderOption
                 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;
@@ -2630,7 +2630,7 @@ OCStackResult OCCancel(OCDoHandle handle, OCQualityOfService qos, OCHeaderOption
             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;
@@ -2658,10 +2658,10 @@ OCStackResult OCCancel(OCDoHandle handle, OCQualityOfService qos, OCHeaderOption
  */
 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
@@ -2672,7 +2672,7 @@ OCStackResult OCRegisterPersistentStorageHandler(OCPersistentStorage* persistent
                 !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;
         }
     }
@@ -2687,7 +2687,7 @@ OCStackResult OCProcessPresence()
 
     // 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;
@@ -2700,9 +2700,9 @@ OCStackResult OCProcessPresence()
         }
 
         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)
         {
@@ -2711,12 +2711,12 @@ OCStackResult OCProcessPresence()
 
         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;
@@ -2727,7 +2727,7 @@ OCStackResult OCProcessPresence()
             // 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);
@@ -2746,7 +2746,7 @@ OCStackResult OCProcessPresence()
         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);
 
@@ -2764,12 +2764,12 @@ OCStackResult OCProcessPresence()
         }
 
         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;
@@ -2800,18 +2800,18 @@ OCStackResult OCStartPresence(const uint32_t ttl)
     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)
     {
@@ -2823,7 +2823,7 @@ OCStackResult OCStartPresence(const uint32_t ttl)
         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;
         }
@@ -2857,7 +2857,7 @@ OCStackResult OCStopPresence()
 
     if(result != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG,
+        OIC_LOG(ERROR, TAG,
                       "Changing the presence resource properties to ACTIVE not successful");
         return result;
     }
@@ -2877,7 +2877,7 @@ OCStackResult OCSetDefaultDeviceEntityHandler(OCDeviceEntityHandler entityHandle
 
 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)
     {
@@ -2898,11 +2898,11 @@ OCStackResult OCSetPlatformInfo(OCPlatformInfo platformInfo)
 
 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;
     }
 
@@ -2920,7 +2920,7 @@ OCStackResult OCCreateResource(OCResourceHandle *handle,
     OCResource *pointer = NULL;
     OCStackResult result = OC_STACK_ERROR;
 
-    OC_LOG(INFO, TAG, "Entering OCCreateResource");
+    OIC_LOG(INFO, TAG, "Entering OCCreateResource");
 
     if(myStackMode == OC_CLIENT)
     {
@@ -2929,13 +2929,13 @@ OCStackResult OCCreateResource(OCResourceHandle *handle,
     // 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;
     }
 
@@ -2949,7 +2949,7 @@ OCStackResult OCCreateResource(OCResourceHandle *handle,
             > (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;
     }
 
@@ -2963,7 +2963,7 @@ OCStackResult OCCreateResource(OCResourceHandle *handle,
         {
             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;
@@ -2996,7 +2996,7 @@ OCStackResult OCCreateResource(OCResourceHandle *handle,
     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;
     }
 
@@ -3004,7 +3004,7 @@ OCStackResult OCCreateResource(OCResourceHandle *handle,
     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;
     }
 
@@ -3047,7 +3047,7 @@ OCStackResult OCBindResource(
     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);
@@ -3055,7 +3055,7 @@ OCStackResult OCBindResource(
     // 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;
     }
 
@@ -3063,7 +3063,7 @@ OCStackResult OCBindResource(
     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;
     }
 
@@ -3074,7 +3074,7 @@ OCStackResult OCBindResource(
         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)
@@ -3099,7 +3099,7 @@ OCStackResult OCUnBindResource(
     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);
@@ -3107,7 +3107,7 @@ OCStackResult OCUnBindResource(
     // 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;
     }
 
@@ -3115,7 +3115,7 @@ OCStackResult OCUnBindResource(
     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;
     }
 
@@ -3126,7 +3126,7 @@ OCStackResult OCUnBindResource(
         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
@@ -3141,7 +3141,7 @@ OCStackResult OCUnBindResource(
         }
     }
 
-    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;
@@ -3181,7 +3181,7 @@ OCStackResult BindResourceTypeToResource(OCResource* resource,
 
     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;
     }
 
@@ -3224,11 +3224,11 @@ OCStackResult BindResourceInterfaceToResource(OCResource* resource,
 
     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)
@@ -3270,7 +3270,7 @@ OCStackResult OCBindResourceTypeToResource(OCResourceHandle handle,
     resource = findResource((OCResource *) handle);
     if (!resource)
     {
-        OC_LOG(ERROR, TAG, "Resource not found");
+        OIC_LOG(ERROR, TAG, "Resource not found");
         return OC_STACK_ERROR;
     }
 
@@ -3297,7 +3297,7 @@ OCStackResult OCBindResourceInterfaceToResource(OCResourceHandle handle,
     resource = findResource((OCResource *) handle);
     if (!resource)
     {
-        OC_LOG(ERROR, TAG, "Resource not found");
+        OIC_LOG(ERROR, TAG, "Resource not found");
         return OC_STACK_ERROR;
     }
 
@@ -3343,20 +3343,20 @@ OCStackResult OCDeleteResource(OCResourceHandle handle)
 {
     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;
     }
 
@@ -3490,7 +3490,7 @@ OCStackResult OCBindResourceHandler(OCResourceHandle handle,
     resource = findResource((OCResource *)handle);
     if (!resource)
     {
-        OC_LOG(ERROR, TAG, "Resource not found");
+        OIC_LOG(ERROR, TAG, "Resource not found");
         return OC_STACK_ERROR;
     }
 
@@ -3516,7 +3516,7 @@ OCEntityHandler OCGetResourceHandler(OCResourceHandle handle)
     resource = findResource((OCResource *)handle);
     if (!resource)
     {
-        OC_LOG(ERROR, TAG, "Resource not found");
+        OIC_LOG(ERROR, TAG, "Resource not found");
         return NULL;
     }
 
@@ -3586,7 +3586,7 @@ OCStackResult OCNotifyAllObservers(OCResourceHandle handle, OCQualityOfService q
     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)
     {
@@ -3624,7 +3624,7 @@ OCNotifyListOfObservers (OCResourceHandle 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
@@ -3652,7 +3652,7 @@ OCStackResult OCDoResponse(OCEntityHandlerResponse *ehResponse)
     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);
@@ -3697,7 +3697,7 @@ OCStackResult OCChangeResourceProperty(OCResourceProperty * inputProperty,
     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)
@@ -3840,11 +3840,11 @@ OCStackResult deleteResource(OCResource *resource)
     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)
@@ -3964,7 +3964,7 @@ void insertResourceType(OCResource *resource, OCResourceType *resourceType)
         {
             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;
@@ -3976,7 +3976,7 @@ void insertResourceType(OCResource *resource, OCResourceType *resourceType)
     }
     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)
@@ -4179,7 +4179,7 @@ const OicUuid_t* OCGetServerInstanceID(void)
 
     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;
@@ -4200,7 +4200,7 @@ const char* OCGetServerInstanceIDString(void)
 
     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;
     }
 
index 969127d..dd6c6e4 100755 (executable)
@@ -98,7 +98,7 @@ ScheduledResourceInfo *scheduleResourceList = NULL;
 void AddScheduledResource(ScheduledResourceInfo **head,
         ScheduledResourceInfo* add)
 {
-    OC_LOG(INFO, TAG, "AddScheduledResource Entering...");
+    OIC_LOG(INFO, TAG, "AddScheduledResource Entering...");
 
 #ifndef WITH_ARDUINO
     pthread_mutex_lock(&lock);
@@ -126,7 +126,7 @@ void AddScheduledResource(ScheduledResourceInfo **head,
 
 ScheduledResourceInfo* GetScheduledResource(ScheduledResourceInfo *head)
 {
-    OC_LOG(INFO, TAG, "GetScheduledResource Entering...");
+    OIC_LOG(INFO, TAG, "GetScheduledResource Entering...");
 
 #ifndef WITH_ARDUINO
     pthread_mutex_lock(&lock);
@@ -156,7 +156,7 @@ ScheduledResourceInfo* GetScheduledResource(ScheduledResourceInfo *head)
 
             if (diffTm <= (time_t) 0)
             {
-                OC_LOG(INFO, TAG, "return Call INFO.");
+                OIC_LOG(INFO, TAG, "return Call INFO.");
                 goto exit;
             }
 
@@ -170,14 +170,14 @@ ScheduledResourceInfo* GetScheduledResource(ScheduledResourceInfo *head)
 #endif
     if (tmp == NULL)
     {
-        OC_LOG(INFO, TAG, "Cannot Find Call Info.");
+        OIC_LOG(INFO, TAG, "Cannot Find Call Info.");
     }
     return tmp;
 }
 
 ScheduledResourceInfo* GetScheduledResourceByActionSetName(ScheduledResourceInfo *head, char *setName)
 {
-    OC_LOG(INFO, TAG, "GetScheduledResourceByActionSetName Entering...");
+    OIC_LOG(INFO, TAG, "GetScheduledResourceByActionSetName Entering...");
 
 #ifndef WITH_ARDUINO
     pthread_mutex_lock(&lock);
@@ -191,7 +191,7 @@ ScheduledResourceInfo* GetScheduledResourceByActionSetName(ScheduledResourceInfo
         {
             if (strcmp(tmp->actionset->actionsetName, setName) == 0)
             {
-                OC_LOG(INFO, TAG, "return Call INFO.");
+                OIC_LOG(INFO, TAG, "return Call INFO.");
                 goto exit;
             }
             tmp = tmp->next;
@@ -204,7 +204,7 @@ exit:
 #endif
     if (tmp == NULL)
     {
-        OC_LOG(INFO, TAG, "Cannot Find Call Info.");
+        OIC_LOG(INFO, TAG, "Cannot Find Call Info.");
     }
     return tmp;
 }
@@ -215,7 +215,7 @@ void RemoveScheduledResource(ScheduledResourceInfo **head,
 #ifndef WITH_ARDUINO
     pthread_mutex_lock(&lock);
 #endif
-    OC_LOG(INFO, TAG, "RemoveScheduledResource Entering...");
+    OIC_LOG(INFO, TAG, "RemoveScheduledResource Entering...");
     ScheduledResourceInfo *tmp = NULL;
 
     if (del == NULL)
@@ -647,7 +647,7 @@ OCStackResult BuildActionSetFromString(OCActionSet **set, char* actiondesc)
     OCAction *action = NULL;
     OCCapability *capa = NULL;
 
-    OC_LOG(INFO, TAG, "Build ActionSet Instance.");
+    OIC_LOG(INFO, TAG, "Build ActionSet Instance.");
 
     *set = (OCActionSet*) OICMalloc(sizeof(OCActionSet));
     VARIFY_POINTER_NULL(*set, result, exit)
@@ -676,7 +676,7 @@ OCStackResult BuildActionSetFromString(OCActionSet **set, char* actiondesc)
     }
 #endif
 
-    OC_LOG_V(INFO, TAG, "ActionSet Name : %s", (*set)->actionsetName);
+    OIC_LOG_V(INFO, TAG, "ActionSet Name : %s", (*set)->actionsetName);
 
     iterToken = (char *) strtok_r(NULL, ACTION_DELIMITER, &iterTokenPtr);
     while (iterToken)
@@ -713,7 +713,7 @@ OCStackResult BuildActionSetFromString(OCActionSet **set, char* actiondesc)
 
             if (strcmp(key, "uri") == 0)
             {
-                OC_LOG(INFO, TAG, "Build OCAction Instance.");
+                OIC_LOG(INFO, TAG, "Build OCAction Instance.");
 
                 action = (OCAction*) OICMalloc(sizeof(OCAction));
                 VARIFY_POINTER_NULL(action, result, exit)
@@ -727,7 +727,7 @@ OCStackResult BuildActionSetFromString(OCActionSet **set, char* actiondesc)
             {
                 if ((key != NULL) && (value != NULL))
                 {
-                    OC_LOG(INFO, TAG, "Build OCCapability Instance.");
+                    OIC_LOG(INFO, TAG, "Build OCCapability Instance.");
 
                     capa = (OCCapability*) OICMalloc(sizeof(OCCapability));
                     VARIFY_POINTER_NULL(capa, result, exit)
@@ -891,7 +891,7 @@ OCStackApplicationResult ActionSetCB(void* context, OCDoHandle handle,
 {
     (void)context;
     (void)clientResponse;
-    OC_LOG(INFO, TAG, "Entering ActionSetCB");
+    OIC_LOG(INFO, TAG, "Entering ActionSetCB");
 
     ClientRequestInfo *info = GetClientRequestInfo(clientRequstList, handle);
 
@@ -903,7 +903,7 @@ OCStackApplicationResult ActionSetCB(void* context, OCDoHandle handle,
 
         if(NULL == clientResponse->payload)
         {
-            OC_LOG(ERROR, TAG, "Error sending response");
+            OIC_LOG(ERROR, TAG, "Error sending response");
             return OC_STACK_DELETE_TRANSACTION;
         }
 
@@ -921,7 +921,7 @@ OCStackApplicationResult ActionSetCB(void* context, OCDoHandle handle,
         // Send the response
         if (OCDoResponse(&response) != OC_STACK_OK)
         {
-            OC_LOG(ERROR, TAG, "Error sending response");
+            OIC_LOG(ERROR, TAG, "Error sending response");
             return OC_STACK_DELETE_TRANSACTION;
         }
 
@@ -947,7 +947,7 @@ OCStackResult BuildActionJSON(OCAction* action, unsigned char* bufferPtr,
     char *jsonStr;
     uint16_t jsonLen;
 
-    OC_LOG(INFO, TAG, "Entering BuildActionJSON");
+    OIC_LOG(INFO, TAG, "Entering BuildActionJSON");
     json = cJSON_CreateObject();
 
     cJSON_AddItemToObject(json, "rep", body = cJSON_CreateObject());
@@ -983,7 +983,7 @@ OCPayload* BuildActionCBOR(OCAction* action)
 
     if (!payload)
     {
-        OC_LOG(INFO, TAG, "Failed to create put payload object");
+        OIC_LOG(INFO, TAG, "Failed to create put payload object");
         return NULL;
     }
 
@@ -1080,27 +1080,27 @@ OCStackResult DoAction(OCResource* resource, OCActionSet* actionset,
 
 void DoScheduledGroupAction()
 {
-    OC_LOG(INFO, TAG, "DoScheduledGroupAction Entering...");
+    OIC_LOG(INFO, TAG, "DoScheduledGroupAction Entering...");
     ScheduledResourceInfo* info = GetScheduledResource(scheduleResourceList);
 
     if (info == NULL)
     {
-        OC_LOG(INFO, TAG, "Target resource is NULL");
+        OIC_LOG(INFO, TAG, "Target resource is NULL");
         goto exit;
     }
     else if (info->resource == NULL)
     {
-        OC_LOG(INFO, TAG, "Target resource is NULL");
+        OIC_LOG(INFO, TAG, "Target resource is NULL");
         goto exit;
     }
     else if (info->actionset == NULL)
     {
-        OC_LOG(INFO, TAG, "Target ActionSet is NULL");
+        OIC_LOG(INFO, TAG, "Target ActionSet is NULL");
         goto exit;
     }
     else if (info->ehRequest == NULL)
     {
-        OC_LOG(INFO, TAG, "Target ActionSet is NULL");
+        OIC_LOG(INFO, TAG, "Target ActionSet is NULL");
         goto exit;
     }
 #ifndef WITH_ARDUINO
@@ -1119,7 +1119,7 @@ void DoScheduledGroupAction()
 
         if (schedule)
         {
-            OC_LOG(INFO, TAG, "Building New Call Info.");
+            OIC_LOG(INFO, TAG, "Building New Call Info.");
             memset(schedule, 0, sizeof(ScheduledResourceInfo));
 
             if (info->actionset->timesteps > 0)
@@ -1135,7 +1135,7 @@ void DoScheduledGroupAction()
                         &schedule->timer_id,
                         &DoScheduledGroupAction);
 
-                OC_LOG(INFO, TAG, "Reregisteration.");
+                OIC_LOG(INFO, TAG, "Reregisteration.");
 #ifndef WITH_ARDUINO
                 pthread_mutex_unlock(&lock);
 #endif
@@ -1161,7 +1161,7 @@ OCStackResult BuildCollectionGroupActionCBORResponse(
 {
     OCStackResult stackRet = OC_STACK_ERROR;
 
-    OC_LOG(INFO, TAG, "Group Action is requested.");
+    OIC_LOG(INFO, TAG, "Group Action is requested.");
 
     char *doWhat = NULL;
     char *details = NULL;
@@ -1170,7 +1170,7 @@ OCStackResult BuildCollectionGroupActionCBORResponse(
 
     if(stackRet != OC_STACK_OK)
     {
-        OC_LOG_V(ERROR, TAG, "ExtractKeyValueFromRequest failed: %d", stackRet);
+        OIC_LOG_V(ERROR, TAG, "ExtractKeyValueFromRequest failed: %d", stackRet);
         return stackRet;
     }
 
@@ -1178,7 +1178,7 @@ OCStackResult BuildCollectionGroupActionCBORResponse(
 
     if (method == OC_REST_PUT)
     {
-        OC_LOG(INFO, TAG, "Group Action[PUT].");
+        OIC_LOG(INFO, TAG, "Group Action[PUT].");
 
         if (strcmp(doWhat, ACTIONSET) == 0)
         {
@@ -1197,7 +1197,7 @@ OCStackResult BuildCollectionGroupActionCBORResponse(
                         {
                             DeleteActionSet( &actionSet );
                         }
-                        OC_LOG(INFO, TAG, "Duplicated ActionSet ");
+                        OIC_LOG(INFO, TAG, "Duplicated ActionSet ");
                     }
                 }
                 else
@@ -1228,7 +1228,7 @@ OCStackResult BuildCollectionGroupActionCBORResponse(
 
         if(!payload)
         {
-            OC_LOG(ERROR, TAG, "Failed to allocate Payload");
+            OIC_LOG(ERROR, TAG, "Failed to allocate Payload");
             stackRet = OC_STACK_ERROR;
         }
         else
@@ -1255,7 +1255,7 @@ OCStackResult BuildCollectionGroupActionCBORResponse(
             // Send the response
             if (OCDoResponse(&response) != OC_STACK_OK)
             {
-                OC_LOG(ERROR, TAG, "Error sending response");
+                OIC_LOG(ERROR, TAG, "Error sending response");
                 stackRet = OC_STACK_ERROR;
             }
         }
@@ -1291,21 +1291,21 @@ OCStackResult BuildCollectionGroupActionCBORResponse(
                 if (GetActionSet(details, resource->actionsetHead,
                         &actionset) != OC_STACK_OK)
                 {
-                    OC_LOG(INFO, TAG, "ERROR");
+                    OIC_LOG(INFO, TAG, "ERROR");
                     stackRet = OC_STACK_ERROR;
                 }
 
                 if (actionset == NULL)
                 {
-                    OC_LOG(INFO, TAG, "Cannot Find ActionSet");
+                    OIC_LOG(INFO, TAG, "Cannot Find ActionSet");
                     stackRet = OC_STACK_ERROR;
                 }
                 else
                 {
-                    OC_LOG(INFO, TAG, "Group Action[POST].");
+                    OIC_LOG(INFO, TAG, "Group Action[POST].");
                     if (actionset->type == NONE)
                     {
-                        OC_LOG_V(INFO, TAG, "Execute ActionSet : %s",
+                        OIC_LOG_V(INFO, TAG, "Execute ActionSet : %s",
                                 actionset->actionsetName);
                         unsigned int num = GetNumOfTargetResource(
                                 actionset->head);
@@ -1321,7 +1321,7 @@ OCStackResult BuildCollectionGroupActionCBORResponse(
                     }
                     else
                     {
-                        OC_LOG_V(INFO, TAG, "Execute Scheduled ActionSet : %s",
+                        OIC_LOG_V(INFO, TAG, "Execute Scheduled ActionSet : %s",
                                 actionset->actionsetName);
 
                         delay =
@@ -1333,7 +1333,7 @@ OCStackResult BuildCollectionGroupActionCBORResponse(
 
                         if (schedule)
                         {
-                            OC_LOG(INFO, TAG, "Building New Call Info.");
+                            OIC_LOG(INFO, TAG, "Building New Call Info.");
                             memset(schedule, 0,
                                     sizeof(ScheduledResourceInfo));
 #ifndef WITH_ARDUINO
@@ -1348,7 +1348,7 @@ OCStackResult BuildCollectionGroupActionCBORResponse(
 #endif
                             if (delay > 0)
                             {
-                                OC_LOG_V(INFO, TAG, "delay_time is %ld seconds.",
+                                OIC_LOG_V(INFO, TAG, "delay_time is %ld seconds.",
                                         actionset->timesteps);
 #ifndef WITH_ARDUINO
                                 pthread_mutex_lock(&lock);
@@ -1411,7 +1411,7 @@ OCStackResult BuildCollectionGroupActionCBORResponse(
 
         if(!payload)
         {
-            OC_LOG(ERROR, TAG, "Failed to allocate Payload");
+            OIC_LOG(ERROR, TAG, "Failed to allocate Payload");
             stackRet = OC_STACK_ERROR;
         }
         else
@@ -1437,7 +1437,7 @@ OCStackResult BuildCollectionGroupActionCBORResponse(
             // Send the response
             if (OCDoResponse(&response) != OC_STACK_OK)
             {
-                OC_LOG(ERROR, TAG, "Error sending response");
+                OIC_LOG(ERROR, TAG, "Error sending response");
                 stackRet = OC_STACK_ERROR;
             }
         }
index 9dc4516..fb09b29 100644 (file)
@@ -41,7 +41,7 @@ int64_t OCRDPayloadToCbor(const OCRDPayload *rdPayload, uint8_t *outPayload, siz
 {
     if (!outPayload || !size)
     {
-        OC_LOG(ERROR, TAG, "Invalid parameters.");
+        OIC_LOG(ERROR, TAG, "Invalid parameters.");
         return OC_STACK_INVALID_PARAM;
     }
 
@@ -56,32 +56,32 @@ int64_t OCRDPayloadToCbor(const OCRDPayload *rdPayload, uint8_t *outPayload, siz
         cborEncoderResult = cbor_encoder_create_map(&encoder, &map, CborIndefiniteLength);
         if (CborNoError != cborEncoderResult)
         {
-            OC_LOG(ERROR, TAG, "Failed creating discovery map.");
+            OIC_LOG(ERROR, TAG, "Failed creating discovery map.");
             goto cbor_error;
         }
         if (CborNoError != ConditionalAddTextStringToMap(&map, OC_RSRVD_DEVICE_NAME,
                 sizeof(OC_RSRVD_DEVICE_NAME) - 1, (char *)rdPayload->rdDiscovery->n.deviceName))
         {
-            OC_LOG(ERROR, TAG, "Failed setting OC_RSRVD_DEVICE_NAME.");
+            OIC_LOG(ERROR, TAG, "Failed setting OC_RSRVD_DEVICE_NAME.");
             goto cbor_error;
         }
         if (CborNoError != ConditionalAddTextStringToMap(&map, OC_RSRVD_DEVICE_ID,
                 sizeof(OC_RSRVD_DEVICE_ID) - 1, (char *)rdPayload->rdDiscovery->di.id))
         {
-            OC_LOG(ERROR, TAG, "Failed setting OC_RSRVD_DEVICE_ID.");
+            OIC_LOG(ERROR, TAG, "Failed setting OC_RSRVD_DEVICE_ID.");
             goto cbor_error;
         }
         uint64_t sel = (uint8_t) rdPayload->rdDiscovery->sel;
         if (CborNoError != ConditionalAddIntToMap(&map, OC_RSRVD_RD_DISCOVERY_SEL,
             sizeof(OC_RSRVD_RD_DISCOVERY_SEL) - 1, &sel))
         {
-            OC_LOG(ERROR, TAG, "Failed setting OC_RSRVD_RD_DISCOVERY_SEL.");
+            OIC_LOG(ERROR, TAG, "Failed setting OC_RSRVD_RD_DISCOVERY_SEL.");
             goto cbor_error;
         }
         cborEncoderResult = cbor_encoder_close_container(&encoder, &map);
         if (CborNoError != cborEncoderResult)
         {
-            OC_LOG(ERROR, TAG, "Failed closing discovery map.");
+            OIC_LOG(ERROR, TAG, "Failed closing discovery map.");
             goto cbor_error;
         }
     }
@@ -91,7 +91,7 @@ int64_t OCRDPayloadToCbor(const OCRDPayload *rdPayload, uint8_t *outPayload, siz
         cborEncoderResult = cbor_encoder_create_array(&encoder, &colArray, CborIndefiniteLength);
         if (CborNoError != cborEncoderResult)
         {
-            OC_LOG(ERROR, TAG, "Failed creating collection array.");
+            OIC_LOG(ERROR, TAG, "Failed creating collection array.");
             goto cbor_error;
         }
 
@@ -100,12 +100,12 @@ int64_t OCRDPayloadToCbor(const OCRDPayload *rdPayload, uint8_t *outPayload, siz
         {
             if (OC_STACK_OK != OCTagsPayloadToCbor(rdPublish->tags, &colArray))
             {
-                OC_LOG(ERROR, TAG, "Failed creating tags payload.");
+                OIC_LOG(ERROR, TAG, "Failed creating tags payload.");
                 goto cbor_error;
             }
             if (OC_STACK_OK != OCLinksPayloadToCbor(rdPublish->setLinks, &colArray))
             {
-                OC_LOG(ERROR, TAG, "Failed creating links payload.");
+                OIC_LOG(ERROR, TAG, "Failed creating links payload.");
                 goto cbor_error;
             }
             rdPublish = rdPublish->next;
@@ -113,7 +113,7 @@ int64_t OCRDPayloadToCbor(const OCRDPayload *rdPayload, uint8_t *outPayload, siz
         cborEncoderResult = cbor_encoder_close_container(&encoder, &colArray);
         if (CborNoError != cborEncoderResult)
         {
-            OC_LOG(ERROR, TAG, "Failed closing collection array.");
+            OIC_LOG(ERROR, TAG, "Failed closing collection array.");
             goto cbor_error;
         }
     }
@@ -123,13 +123,13 @@ int64_t OCRDPayloadToCbor(const OCRDPayload *rdPayload, uint8_t *outPayload, siz
         cborEncoderResult = cbor_encoder_create_map(&encoder, &map, CborIndefiniteLength);
         if (CborNoError != cborEncoderResult)
         {
-            OC_LOG(ERROR, TAG, "Failed creating discovery map.");
+            OIC_LOG(ERROR, TAG, "Failed creating discovery map.");
             goto cbor_error;
         }
         cborEncoderResult = cbor_encoder_close_container(&encoder, &map);
         if (CborNoError != cborEncoderResult)
         {
-            OC_LOG(ERROR, TAG, "Failed creating discovery map.");
+            OIC_LOG(ERROR, TAG, "Failed creating discovery map.");
             goto cbor_error;
         }
     }
@@ -147,72 +147,72 @@ OCStackResult OCTagsPayloadToCbor(OCTagsPayload *tags, CborEncoder *setMap)
     CborError cborEncoderResult = cbor_encoder_create_map(setMap, &tagsMap, CborIndefiniteLength);
     if (CborNoError != cborEncoderResult)
     {
-        OC_LOG(ERROR, TAG, "Failed creating TAGS map.");
+        OIC_LOG(ERROR, TAG, "Failed creating TAGS map.");
         return OC_STACK_ERROR;
     }
 
     if (CborNoError != ConditionalAddTextStringToMap(&tagsMap, OC_RSRVD_DEVICE_NAME,
             sizeof(OC_RSRVD_DEVICE_NAME) - 1, (char *)tags->n.deviceName))
     {
-        OC_LOG(ERROR, TAG, "Failed adding OC_RSRVD_DEVICE_NAME in TAGS map.");
+        OIC_LOG(ERROR, TAG, "Failed adding OC_RSRVD_DEVICE_NAME in TAGS map.");
         return OC_STACK_ERROR;
     }
     if (CborNoError != ConditionalAddTextStringToMap(&tagsMap, OC_RSRVD_DEVICE_ID,
             sizeof(OC_RSRVD_DEVICE_ID) - 1, (char *)tags->di.id))
     {
-        OC_LOG(ERROR, TAG, "Failed adding OC_RSRVD_DEVICE_ID in TAGS map.");
+        OIC_LOG(ERROR, TAG, "Failed adding OC_RSRVD_DEVICE_ID in TAGS map.");
         return OC_STACK_ERROR;
     }
     if (CborNoError != ConditionalAddTextStringToMap(&tagsMap, OC_RSRVD_RTS,
             sizeof(OC_RSRVD_RTS) - 1, (char *)tags->rts))
     {
-        OC_LOG(ERROR, TAG, "Failed adding OC_RSRVD_RTS in TAGS map.");
+        OIC_LOG(ERROR, TAG, "Failed adding OC_RSRVD_RTS in TAGS map.");
         return OC_STACK_ERROR;
     }
     if (CborNoError != ConditionalAddTextStringToMap(&tagsMap, OC_RSRVD_DREL,
             sizeof(OC_RSRVD_DREL) - 1, (char *)tags->drel))
     {
-        OC_LOG(ERROR, TAG, "Failed adding OC_RSRVD_DREL in TAGS map.");
+        OIC_LOG(ERROR, TAG, "Failed adding OC_RSRVD_DREL in TAGS map.");
         return OC_STACK_ERROR;
     }
     if (CborNoError != ConditionalAddTextStringToMap(&tagsMap, OC_RSRVD_BASE_URI,
             sizeof(OC_RSRVD_BASE_URI) - 1, (char *)tags->baseURI))
     {
-        OC_LOG(ERROR, TAG, "Failed adding OC_RSRVD_BASE_URI in TAGS map.");
+        OIC_LOG(ERROR, TAG, "Failed adding OC_RSRVD_BASE_URI in TAGS map.");
         return OC_STACK_ERROR;
     }
     uint64_t temp = (uint64_t)tags->bitmap;
     if (CborNoError != ConditionalAddIntToMap(&tagsMap, OC_RSRVD_BITMAP,
             sizeof(OC_RSRVD_BITMAP) - 1, &temp))
     {
-        OC_LOG(ERROR, TAG, "Failed adding OC_RSRVD_BITMAP in TAGS map.");
+        OIC_LOG(ERROR, TAG, "Failed adding OC_RSRVD_BITMAP in TAGS map.");
         return OC_STACK_ERROR;
     }
     temp = (uint64_t)tags->port;
     if (CborNoError != ConditionalAddIntToMap(&tagsMap, OC_RSRVD_HOSTING_PORT,
             sizeof(OC_RSRVD_HOSTING_PORT) - 1, &temp))
     {
-        OC_LOG(ERROR, TAG, "Failed adding OC_RSRVD_HOSTING_PORT in TAGS map.");
+        OIC_LOG(ERROR, TAG, "Failed adding OC_RSRVD_HOSTING_PORT in TAGS map.");
         return OC_STACK_ERROR;
     }
     temp = (uint64_t)tags->ins;
     if (CborNoError != ConditionalAddIntToMap(&tagsMap, OC_RSRVD_INS,
             sizeof(OC_RSRVD_INS) - 1, &temp))
     {
-        OC_LOG(ERROR, TAG, "Failed adding OC_RSRVD_INS in TAGS map.");
+        OIC_LOG(ERROR, TAG, "Failed adding OC_RSRVD_INS in TAGS map.");
         return OC_STACK_ERROR;
     }
     temp = (uint64_t)tags->ttl;
     if (CborNoError != ConditionalAddIntToMap(&tagsMap, OC_RSRVD_TTL,
             sizeof(OC_RSRVD_TTL) - 1, &temp))
     {
-        OC_LOG(ERROR, TAG, "Failed adding OC_RSRVD_TTL in TAGS map.");
+        OIC_LOG(ERROR, TAG, "Failed adding OC_RSRVD_TTL in TAGS map.");
         return OC_STACK_ERROR;
     }
     cborEncoderResult = cbor_encoder_close_container(setMap, &tagsMap);
     if (CborNoError != cborEncoderResult)
     {
-        OC_LOG(ERROR, TAG, "Failed closing TAGS map.");
+        OIC_LOG(ERROR, TAG, "Failed closing TAGS map.");
         return OC_STACK_ERROR;
     }
     return OC_STACK_OK;
@@ -226,7 +226,7 @@ OCStackResult OCLinksPayloadToCbor(OCLinksPayload *rtPtr, CborEncoder *setMap)
     cborEncoderResult = cbor_encoder_create_array(setMap, &linksArray, CborIndefiniteLength);
     if (CborNoError != cborEncoderResult)
     {
-        OC_LOG(ERROR, TAG, "Failed creating LINKS array.");
+        OIC_LOG(ERROR, TAG, "Failed creating LINKS array.");
         return OC_STACK_ERROR;
     }
     while (rtPtr)
@@ -236,62 +236,62 @@ OCStackResult OCLinksPayloadToCbor(OCLinksPayload *rtPtr, CborEncoder *setMap)
                 CborIndefiniteLength);
         if (CborNoError != cborEncoderResult)
         {
-            OC_LOG(ERROR, TAG, "Failed creating LINKS map.");
+            OIC_LOG(ERROR, TAG, "Failed creating LINKS map.");
             return OC_STACK_ERROR;
         }
         if (CborNoError != ConditionalAddTextStringToMap(&linksMap, OC_RSRVD_HREF,
                 sizeof(OC_RSRVD_HREF) - 1, rtPtr->href))
         {
-            OC_LOG(ERROR, TAG, "Failed adding OC_RSRVD_HREF in LINKS map.");
+            OIC_LOG(ERROR, TAG, "Failed adding OC_RSRVD_HREF in LINKS map.");
             return OC_STACK_ERROR;
         }
         if (CborNoError != ConditionalAddTextStringToMap(&linksMap, OC_RSRVD_REL,
                 sizeof(OC_RSRVD_REL) - 1,  rtPtr->rel))
         {
-            OC_LOG(ERROR, TAG, "Failed adding OC_RSRVD_REL in LINKS map.");
+            OIC_LOG(ERROR, TAG, "Failed adding OC_RSRVD_REL in LINKS map.");
             return OC_STACK_ERROR;
         }
         if (CborNoError != ConditionalAddTextStringToMap(&linksMap, OC_RSRVD_TITLE,
                 sizeof(OC_RSRVD_TITLE) - 1, rtPtr->title))
         {
-            OC_LOG(ERROR, TAG, "Failed adding OC_RSRVD_TITLE in LINKS map.");
+            OIC_LOG(ERROR, TAG, "Failed adding OC_RSRVD_TITLE in LINKS map.");
             return OC_STACK_ERROR;
         }
         if (CborNoError != ConditionalAddTextStringToMap(&linksMap, OC_RSRVD_URI,
                 sizeof(OC_RSRVD_URI) - 1, rtPtr->uri))
         {
-            OC_LOG(ERROR, TAG, "Failed adding OC_RSRVD_URI in LINKS map.");
+            OIC_LOG(ERROR, TAG, "Failed adding OC_RSRVD_URI in LINKS map.");
             return OC_STACK_ERROR;
         }
         if (CborNoError != AddStringLLToMap(&linksMap, OC_RSRVD_RESOURCE_TYPE,
                 sizeof(OC_RSRVD_RESOURCE_TYPE) - 1, rtPtr->rt))
         {
-            OC_LOG(ERROR, TAG, "Failed adding OC_RSRVD_RESOURCE_TYPE in LINKS map.");
+            OIC_LOG(ERROR, TAG, "Failed adding OC_RSRVD_RESOURCE_TYPE in LINKS map.");
             return OC_STACK_ERROR;
         }
         if (CborNoError != AddStringLLToMap(&linksMap, OC_RSRVD_INTERFACE,
                 sizeof(OC_RSRVD_INTERFACE) - 1, rtPtr->itf))
         {
-            OC_LOG(ERROR, TAG, "Failed adding OC_RSRVD_INTERFACE in LINKS map.");
+            OIC_LOG(ERROR, TAG, "Failed adding OC_RSRVD_INTERFACE in LINKS map.");
             return OC_STACK_ERROR;
         }
         if (CborNoError != AddStringLLToMap(&linksMap, OC_RSRVD_MEDIA_TYPE,
                 sizeof(OC_RSRVD_MEDIA_TYPE) - 1, rtPtr->mt))
         {
-            OC_LOG(ERROR, TAG, "Failed adding OC_RSRVD_MEDIA_TYPE in LINKS map.");
+            OIC_LOG(ERROR, TAG, "Failed adding OC_RSRVD_MEDIA_TYPE in LINKS map.");
             return OC_STACK_ERROR;
         }
         uint64_t temp = (uint64_t)rtPtr->ins;
         if (CborNoError != ConditionalAddIntToMap(&linksMap, OC_RSRVD_INS,
             sizeof(OC_RSRVD_INS) - 1, &temp))
         {
-            OC_LOG(ERROR, TAG, "Failed adding OC_RSRVD_INS in LINKS map.");
+            OIC_LOG(ERROR, TAG, "Failed adding OC_RSRVD_INS in LINKS map.");
             return OC_STACK_ERROR;
         }
         cborEncoderResult = cbor_encoder_close_container(&linksArray, &linksMap);
         if (CborNoError != cborEncoderResult)
         {
-            OC_LOG(ERROR, TAG, "Failed closing LINKS map.");
+            OIC_LOG(ERROR, TAG, "Failed closing LINKS map.");
             return OC_STACK_ERROR;
         }
         rtPtr = rtPtr->next;
@@ -299,7 +299,7 @@ OCStackResult OCLinksPayloadToCbor(OCLinksPayload *rtPtr, CborEncoder *setMap)
     cborEncoderResult = cbor_encoder_close_container(setMap, &linksArray);
     if (CborNoError != cborEncoderResult)
     {
-        OC_LOG(ERROR, TAG, "Failed closing LINKS array.");
+        OIC_LOG(ERROR, TAG, "Failed closing LINKS array.");
         return OC_STACK_ERROR;;
     }
     return OC_STACK_OK;
@@ -346,7 +346,7 @@ OCStackResult OCRDCborToPayload(const CborValue *cborPayload, OCPayload **outPay
             // Move from tags payload to links array.
             if (CborNoError != cbor_value_advance(rdCBORPayload))
             {
-                OC_LOG(DEBUG, TAG, "Failed advancing from tags payload to links.");
+                OIC_LOG(DEBUG, TAG, "Failed advancing from tags payload to links.");
                 OCFreeLinksResource(linksPayload);
                 OCFreeTagsResource(tagsPayload);
                 goto cbor_error;
@@ -388,11 +388,11 @@ OCStackResult OCRDCborToPayload(const CborValue *cborPayload, OCPayload **outPay
             goto cbor_error;
         }
     }
-    OC_LOG_PAYLOAD(DEBUG, (OCPayload *) rdPayload);
+    OIC_LOG_PAYLOAD(DEBUG, (OCPayload *) rdPayload);
     *outPayload = (OCPayload *)rdPayload;
     return OC_STACK_OK;
 no_memory:
-    OC_LOG(ERROR, TAG, "Failed allocating memory.");
+    OIC_LOG(ERROR, TAG, "Failed allocating memory.");
     OCRDPayloadDestroy(rdPayload);
     return OC_STACK_NO_MEMORY;
 
@@ -411,7 +411,7 @@ static CborError FindStringInMap(CborValue *map, char *tags, char **value)
         cborFindResult = cbor_value_dup_text_string(&curVal, value, &len, NULL);
         if (CborNoError != cborFindResult)
         {
-            OC_LOG_V(ERROR, TAG, "Failed finding value for tag %s .", tags);
+            OIC_LOG_V(ERROR, TAG, "Failed finding value for tag %s .", tags);
             return cborFindResult;
         }
     }
@@ -427,7 +427,7 @@ static CborError FindIntInMap(CborValue *map, char *tags, uint64_t *value)
         cborFindResult = cbor_value_get_uint64(&curVal, value);
         if (CborNoError != cborFindResult)
         {
-            OC_LOG_V(ERROR, TAG, "Failed finding value for tag %s .", tags);
+            OIC_LOG_V(ERROR, TAG, "Failed finding value for tag %s .", tags);
             return cborFindResult;
         }
     }
@@ -573,7 +573,7 @@ OCStackResult OCLinksCborToPayload(CborValue *linksArray, OCLinksPayload **links
     CborError cborFindResult = cbor_value_enter_container(linksArray, &linksMap);
     if (CborNoError != cborFindResult)
     {
-        OC_LOG(ERROR, TAG, "Failed enter links map");
+        OIC_LOG(ERROR, TAG, "Failed enter links map");
         return OC_STACK_ERROR;
     }
 
@@ -582,7 +582,7 @@ OCStackResult OCLinksCborToPayload(CborValue *linksArray, OCLinksPayload **links
         OCLinksPayload *setLinks = (OCLinksPayload *)OICCalloc(1, sizeof(OCLinksPayload));
         if (!setLinks)
         {
-            OC_LOG(ERROR, TAG, "Failed allocating memory.");
+            OIC_LOG(ERROR, TAG, "Failed allocating memory.");
             OCFreeLinksResource(*linksPayload);
             return OC_STACK_NO_MEMORY;
         }
@@ -662,7 +662,7 @@ OCStackResult OCLinksCborToPayload(CborValue *linksArray, OCLinksPayload **links
         cborFindResult = cbor_value_advance(&linksMap);
         if (CborNoError != cborFindResult)
         {
-            OC_LOG(ERROR, TAG, "Failed advancing links map");
+            OIC_LOG(ERROR, TAG, "Failed advancing links map");
             OCFreeLinksResource(*linksPayload);
             OCFreeLinksResource(setLinks);
             return OC_STACK_ERROR;
@@ -858,7 +858,7 @@ OCTagsPayload* OCCopyTagsResources(const char *deviceName, const unsigned char *
     return tags;
 
 memory_allocation_failed:
-    OC_LOG(ERROR, TAG, "Memory allocation failed.");
+    OIC_LOG(ERROR, TAG, "Memory allocation failed.");
     OCFreeTagsResource(tags);
     return NULL;
 }
@@ -869,7 +869,7 @@ OCLinksPayload* OCCopyLinksResources(const char *href, OCStringLL *rt, OCStringL
     OCLinksPayload *links = (OCLinksPayload *)OICCalloc(1, sizeof(OCLinksPayload));
     if (!links)
     {
-        OC_LOG(ERROR, TAG, "Failed allocating memory.");
+        OIC_LOG(ERROR, TAG, "Failed allocating memory.");
         return NULL;
     }
     if (href)
@@ -934,7 +934,7 @@ OCLinksPayload* OCCopyLinksResources(const char *href, OCStringLL *rt, OCStringL
     return links;
 
 memory_allocation_failed:
-    OC_LOG(ERROR, TAG, "Memory allocation failed.");
+    OIC_LOG(ERROR, TAG, "Memory allocation failed.");
     OCFreeLinksResource(links);
     return NULL;
 }
@@ -948,7 +948,7 @@ OCResourceCollectionPayload* OCCopyCollectionResource(OCTagsPayload *tags, OCLin
     OCResourceCollectionPayload *pl = (OCResourceCollectionPayload *)OICCalloc(1, sizeof(OCResourceCollectionPayload));
     if(!pl)
     {
-        OC_LOG(ERROR, TAG, "Failed allocating memory for the OCResourceCollectionPayload.");
+        OIC_LOG(ERROR, TAG, "Failed allocating memory for the OCResourceCollectionPayload.");
         return NULL;
     }
     pl->tags = tags;
@@ -1011,25 +1011,25 @@ void OCTagsLog(const LogLevel level, const OCTagsPayload *tags)
     {
         if (tags->n.deviceName)
         {
-            OC_LOG_V(level, TAG, " Device Name : %s ",tags->n.deviceName);
+            OIC_LOG_V(level, TAG, " Device Name : %s ",tags->n.deviceName);
         }
         if (tags->baseURI)
         {
-            OC_LOG_V(level, TAG, " Base URI : %s ",tags->baseURI);
+            OIC_LOG_V(level, TAG, " Base URI : %s ",tags->baseURI);
         }
-        OC_LOG_V(level, TAG, " Device ID : %s ",tags->di.id);
-        OC_LOG_V(level, TAG, " Bitmap : %d ",tags->bitmap);
-        OC_LOG_V(level, TAG, " Port : %d ",tags->port);
-        OC_LOG_V(level, TAG, " Ins : %d ",tags->ins);
-        OC_LOG_V(level, TAG, " Ttl : %d ",tags->ttl);
+        OIC_LOG_V(level, TAG, " Device ID : %s ",tags->di.id);
+        OIC_LOG_V(level, TAG, " Bitmap : %d ",tags->bitmap);
+        OIC_LOG_V(level, TAG, " Port : %d ",tags->port);
+        OIC_LOG_V(level, TAG, " Ins : %d ",tags->ins);
+        OIC_LOG_V(level, TAG, " Ttl : %d ",tags->ttl);
 
         if (tags->rts)
         {
-            OC_LOG_V(level, TAG, " RTS : %s ",tags->rts);
+            OIC_LOG_V(level, TAG, " RTS : %s ",tags->rts);
         }
         if (tags->drel)
         {
-            OC_LOG_V(level, TAG, " DREL : %s ",tags->drel);
+            OIC_LOG_V(level, TAG, " DREL : %s ",tags->drel);
         }
     }
     else
@@ -1044,51 +1044,51 @@ void OCLinksLog(const LogLevel level, const OCLinksPayload *links)
     {
         if (links->href)
         {
-            OC_LOG_V(level, TAG, " href: %s ",links->href);
+            OIC_LOG_V(level, TAG, " href: %s ",links->href);
         }
-        OC_LOG(level, TAG, " RT: ");
+        OIC_LOG(level, TAG, " RT: ");
         OCStringLL *rt = links->rt;
         while (rt)
         {
             if (rt->value)
             {
-                OC_LOG_V(level, TAG, "   %s", rt->value);
+                OIC_LOG_V(level, TAG, "   %s", rt->value);
             }
             rt = rt->next;
         }
-        OC_LOG(level, TAG, " IF: ");
+        OIC_LOG(level, TAG, " IF: ");
         OCStringLL *itf = links->itf;
         while (itf)
         {
             if (itf->value)
             {
-                OC_LOG_V(level, TAG, "   %s", itf->value);
+                OIC_LOG_V(level, TAG, "   %s", itf->value);
             }
             itf = itf->next;
         }
-        OC_LOG(level, TAG, " MT: ");
+        OIC_LOG(level, TAG, " MT: ");
         OCStringLL *mt = links->mt;
         while (mt)
         {
             if (mt->value)
             {
-                OC_LOG_V(level, TAG, "   %s", mt->value);
+                OIC_LOG_V(level, TAG, "   %s", mt->value);
             }
             mt = mt->next;
         }
-        OC_LOG_V(level, TAG, " INS: %d", links->ins);
-        OC_LOG_V(level, TAG, " OBS: %d", links->obs);
+        OIC_LOG_V(level, TAG, " INS: %d", links->ins);
+        OIC_LOG_V(level, TAG, " OBS: %d", links->obs);
         if (links->rel)
         {
-            OC_LOG_V(level, TAG, " REL: %s", links->rel);
+            OIC_LOG_V(level, TAG, " REL: %s", links->rel);
         }
         if (links->title)
         {
-            OC_LOG_V(level, TAG, " TITLE: %s", links->title);
+            OIC_LOG_V(level, TAG, " TITLE: %s", links->title);
         }
         if (links->uri)
         {
-            OC_LOG_V(level, TAG, " URI: %s", links->uri);
+            OIC_LOG_V(level, TAG, " URI: %s", links->uri);
         }
         links = links->next;
     }
index 6e58afc..973edbf 100644 (file)
@@ -50,17 +50,17 @@ static OCUri SERVICE_URI = "coap://127.0.0.1:5683/";
 
 void EXPECT_EQ(int a, int b)  {
   if (a == b) {
-    OC_LOG(INFO, TAG, "PASS");
+    OIC_LOG(INFO, TAG, "PASS");
   } else {
-    OC_LOG(ERROR, TAG, "**FAIL**");
+    OIC_LOG(ERROR, TAG, "**FAIL**");
   }
 }
 
 void EXPECT_STREQ(const char *a, const char *b)  {
   if (strcmp(a, b) == 0) {
-    OC_LOG(INFO, TAG, "PASS");
+    OIC_LOG(INFO, TAG, "PASS");
   } else {
-    OC_LOG(ERROR, TAG, "**FAIL**");
+    OIC_LOG(ERROR, TAG, "**FAIL**");
   }
 }
 //-----------------------------------------------------------------------------
@@ -68,11 +68,11 @@ void EXPECT_STREQ(const char *a, const char *b)  {
 //-----------------------------------------------------------------------------
 
 extern "C" void asyncDoResourcesCallback(OCStackResult result, OCRepresentationHandle representation) {
-    OC_LOG(INFO, TAG, "Entering asyncDoResourcesCallback");
+    OIC_LOG(INFO, TAG, "Entering asyncDoResourcesCallback");
 
     EXPECT_EQ(OC_STACK_OK, result);
     OCResource *resource = (OCResource *)representation;
-    OC_LOG_V(INFO, TAG, "URI = %s", resource->uri);
+    OIC_LOG_V(INFO, TAG, "URI = %s", resource->uri);
     EXPECT_STREQ(SERVICE_URI, resource->uri);
 }
 
index dec98ac..72e9ce9 100644 (file)
@@ -45,17 +45,17 @@ PROGMEM const char multiLineMsg[] = "this is a DEBUG message\non multiple\nlines
 
 void EXPECT_EQ(int a, int b)  {
   if (a == b) {
-    OC_LOG(INFO, TAG, ("PASS"));
+    OIC_LOG(INFO, TAG, ("PASS"));
   } else {
-    OC_LOG(ERROR, TAG, ("FAIL"));
+    OIC_LOG(ERROR, TAG, ("FAIL"));
   }
 }
 
 void EXPECT_STREQ(const char *a, const char *b)  {
   if (strcmp(a, b) == 0) {
-    OC_LOG(INFO, TAG, ("PASS"));
+    OIC_LOG(INFO, TAG, ("PASS"));
   } else {
-    OC_LOG(ERROR, TAG, ("FAIL"));
+    OIC_LOG(ERROR, TAG, ("FAIL"));
   }
 }
 //-----------------------------------------------------------------------------
@@ -63,31 +63,31 @@ void EXPECT_STREQ(const char *a, const char *b)  {
 //-----------------------------------------------------------------------------
 #if 0  // Turn off logger tests
 void test0() {
-    OC_LOG(INFO, tag, msg);
+    OIC_LOG(INFO, tag, msg);
 }
 
 void test1() {
-    OC_LOG(INFO, 0, msg);
+    OIC_LOG(INFO, 0, msg);
 }
 
 void test2() {
-    OC_LOG(INFO, tag, 0);
+    OIC_LOG(INFO, tag, 0);
 }
 
 void test3() {
-    OC_LOG(INFO, 0, 0);
+    OIC_LOG(INFO, 0, 0);
 }
 
 void test4() {
-    OC_LOG(DEBUG, tag, debugMsg);
-    OC_LOG(INFO, tag, infoMsg);
-    OC_LOG(WARNING, tag, warningMsg);
-    OC_LOG(ERROR, tag, errorMsg);
-    OC_LOG(FATAL, tag, fatalMsg);
+    OIC_LOG(DEBUG, tag, debugMsg);
+    OIC_LOG(INFO, tag, infoMsg);
+    OIC_LOG(WARNING, tag, warningMsg);
+    OIC_LOG(ERROR, tag, errorMsg);
+    OIC_LOG(FATAL, tag, fatalMsg);
 }
 
 void test5() {
-    OC_LOG(DEBUG, tag, multiLineMsg);
+    OIC_LOG(DEBUG, tag, multiLineMsg);
 }
 
 
@@ -97,69 +97,69 @@ void test6() {
     for (int i = 0; i < (int)(sizeof buffer); i++) {
         buffer[i] = i;
     }
-    OC_LOG_BUFFER(DEBUG, tag, buffer, sizeof buffer);
+    OIC_LOG_BUFFER(DEBUG, tag, buffer, sizeof buffer);
 
     // Log buffer, 128 bytes is a good boundary (8 rows of 16 values)
     uint8_t buffer1[128];
     for (int i = 0; i < (int)(sizeof buffer1); i++) {
         buffer1[i] = i;
     }
-    OC_LOG_BUFFER(DEBUG, tag, buffer1, sizeof buffer1);
+    OIC_LOG_BUFFER(DEBUG, tag, buffer1, sizeof buffer1);
 
     // 1 below 128 byte boundary
     uint8_t buffer2[127];
     for (int i = 0; i < (int)(sizeof buffer2); i++) {
         buffer2[i] = i;
     }
-    OC_LOG_BUFFER(DEBUG, tag, buffer2, sizeof buffer2);
+    OIC_LOG_BUFFER(DEBUG, tag, buffer2, sizeof buffer2);
 
     // 1 above 128 byte boundary
     uint8_t buffer3[129];
     for (int i = 0; i < (int)(sizeof buffer3); i++) {
         buffer3[i] = i;
     }
-    OC_LOG_BUFFER(DEBUG, tag, buffer3, sizeof buffer3);
+    OIC_LOG_BUFFER(DEBUG, tag, buffer3, sizeof buffer3);
 }
 #endif
 
 extern "C" void asyncDoResourcesCallback(OCStackResult result, OCRepresentationHandle representation) {
-    OC_LOG(INFO, TAG, ("Entering asyncDoResourcesCallback"));
+    OIC_LOG(INFO, TAG, ("Entering asyncDoResourcesCallback"));
 
     EXPECT_EQ(OC_STACK_OK, result);
     OCResource *resource = (OCResource *)representation;
-    OC_LOG_V(INFO, TAG, "URI = %s", resource->uri);
+    OIC_LOG_V(INFO, TAG, "URI = %s", resource->uri);
     EXPECT_STREQ(SERVICE_URI, resource->uri);
 }
 
 void test0() {
-    OC_LOG(INFO, TAG, ("test0"));
+    OIC_LOG(INFO, TAG, ("test0"));
     EXPECT_EQ(OC_STACK_OK, OCInit(0, 5683, OC_SERVER));
 }
 
 void test1() {
-    OC_LOG(INFO, TAG, ("test1"));
+    OIC_LOG(INFO, TAG, ("test1"));
     EXPECT_EQ(OC_STACK_OK, OCInit("127.0.0.1", 0, OC_SERVER));
 }
 
 void test2() {
-    OC_LOG(INFO, TAG, ("test2"));
+    OIC_LOG(INFO, TAG, ("test2"));
     EXPECT_EQ(OC_STACK_OK, OCInit(0, 0, OC_SERVER));
 }
 
 void test3() {
-    OC_LOG(INFO, TAG, ("test3"));
+    OIC_LOG(INFO, TAG, ("test3"));
     EXPECT_EQ(OC_STACK_ERROR, OCInit(0, 0, (OCMode)10));
 }
 
 void test4() {
-    OC_LOG(INFO, TAG, ("test4"));
+    OIC_LOG(INFO, TAG, ("test4"));
     EXPECT_EQ(OC_STACK_OK, OCInit("127.0.0.1", 5683, OC_CLIENT));
     EXPECT_EQ(OC_STACK_OK, OCInit("127.0.0.1", 5683, OC_SERVER));
     EXPECT_EQ(OC_STACK_OK, OCInit("127.0.0.1", 5683, OC_CLIENT_SERVER));
 }
 
 void test5() {
-    OC_LOG(INFO, TAG, ("test5"));
+    OIC_LOG(INFO, TAG, ("test5"));
     EXPECT_EQ(OC_STACK_OK, OCInit("127.0.0.1", 5683, OC_CLIENT));
     EXPECT_EQ(OC_STACK_OK, OCDoResource(OC_REST_GET, OC_EXPLICIT_DEVICE_DISCOVERY_URI, 0, 0, asyncDoResourcesCallback), NULL, 0);
     EXPECT_EQ(OC_STACK_OK, OCUpdateResources(SERVICE_URI));
@@ -167,14 +167,14 @@ void test5() {
 }
 
 void test6() {
-    OC_LOG(INFO, TAG, ("test6"));
+    OIC_LOG(INFO, TAG, ("test6"));
     EXPECT_EQ(OC_STACK_OK, OCInit("127.0.0.1", 5683, OC_CLIENT));
     EXPECT_EQ(OC_STACK_OK, OCStop());
     EXPECT_EQ(OC_STACK_ERROR, OCStop());
 }
 
 void test7() {
-    OC_LOG(INFO, TAG, ("test7"));
+    OIC_LOG(INFO, TAG, ("test7"));
     EXPECT_EQ(OC_STACK_OK, OCInit("127.0.0.1", 5683, OC_CLIENT));
     EXPECT_EQ(OC_STACK_OK, OCDoResource(OC_REST_GET, OC_EXPLICIT_DEVICE_DISCOVERY_URI, 0, 0, asyncDoResourcesCallback), NULL, 0);
     EXPECT_EQ(OC_STACK_INVALID_URI, OCUpdateResources(0));
@@ -187,7 +187,7 @@ void test7() {
 void setup()
 {
     // Add your initialization code here
-    OC_LOG_INIT();
+    OIC_LOG_INIT();
 
     test0();
     delay(2000);
index 5ced8c9..6f9f30b 100644 (file)
@@ -9,8 +9,8 @@ static uint8_t ETHERNET_MAC[] = {0x90, 0xA2, 0xDA, 0x0F, 0x2B, 0x72 };
 #define TAG ("ocserver")
 
 void ocInitialize () {
-    OC_LOG(DEBUG, TAG, ("IP addr is:"));
-    OC_LOG_BUFFER(INFO, TAG, (uint8_t*)ipAddr, sizeof(ipAddr));
+    OIC_LOG(DEBUG, TAG, ("IP addr is:"));
+    OIC_LOG_BUFFER(INFO, TAG, (uint8_t*)ipAddr, sizeof(ipAddr));
     delay(2000);
     OCInit (NULL, 0, OC_SERVER);
 }
index fca6015..40132fd 100644 (file)
@@ -41,8 +41,8 @@ void handleSigInt(int signum) {
 // This is a function called back when a device is discovered
 OCStackApplicationResult applicationDiscoverCB(
         OCClientResponse * clientResponse) {
-    OC_LOG(INFO, TAG, "Entering applicationDiscoverCB (Application Layer CB)");
-    OC_LOG_V(INFO, TAG, "Device =============> Discovered %s @ %s:%d",
+    OIC_LOG(INFO, TAG, "Entering applicationDiscoverCB (Application Layer CB)");
+    OIC_LOG_V(INFO, TAG, "Device =============> Discovered %s @ %s:%d",
                                     clientResponse->resJSONPayload,
                                     clientResponse->devAddr.addr,
                                     clientResponse->devAddr.port);
@@ -51,11 +51,11 @@ OCStackApplicationResult applicationDiscoverCB(
 }
 
 int main() {
-    OC_LOG_V(INFO, TAG, "Starting occlient on address %s",addr);
+    OIC_LOG_V(INFO, TAG, "Starting occlient on address %s",addr);
 
     /* Initialize OCStack*/
     if (OCInit(NULL, 0, OC_CLIENT) != OC_STACK_OK) {
-        OC_LOG(ERROR, TAG, "OCStack init error");
+        OIC_LOG(ERROR, TAG, "OCStack init error");
         return 0;
     }
 
@@ -64,25 +64,27 @@ int main() {
     strcpy(szQueryUri, OC_EXPLICIT_DEVICE_DISCOVERY_URI);
     if (OCDoResource(NULL, OC_REST_GET, szQueryUri, 0, 0, OC_LOW_QOS,
             0, 0, 0) != OC_STACK_OK) {
-        OC_LOG(ERROR, TAG, "OCStack resource error");
+        OIC_LOG(ERROR, TAG, "OCStack resource error");
         return 0;
     }
 
     // Break from loop with Ctrl+C
-    OC_LOG(INFO, TAG, "Entering occlient main loop...");
+    OIC_LOG(INFO, TAG, "Entering occlient main loop...");
     signal(SIGINT, handleSigInt);
     while (!gQuitFlag) {
 
         if (OCProcess() != OC_STACK_OK) {
-            OC_LOG(ERROR, TAG, "OCStack process error");
+            OIC_LOG(ERROR, TAG, "OCStack process error");
             return 0;
         }
 
         sleep(1);
-    }OC_LOG(INFO, TAG, "Exiting occlient main loop...");
+    }
+
+    OIC_LOG(INFO, TAG, "Exiting occlient main loop...");
 
     if (OCStop() != OC_STACK_OK) {
-        OC_LOG(ERROR, TAG, "OCStack stop error");
+        OIC_LOG(ERROR, TAG, "OCStack stop error");
     }
 
     return 0;
index 239f8a1..c587a0b 100644 (file)
@@ -48,9 +48,9 @@ void handleSigInt(int signum) {
 }
 
 int main() {
-    OC_LOG_V(INFO, TAG, "Starting ocserver on address %s:%d",addr,port);
+    OIC_LOG_V(INFO, TAG, "Starting ocserver on address %s:%d",addr,port);
     if (OCInit(NULL, 0, OC_SERVER) != OC_STACK_OK) {
-        OC_LOG(ERROR, TAG, "OCStack init error");
+        OIC_LOG(ERROR, TAG, "OCStack init error");
         return 0;
     }
 
@@ -59,26 +59,26 @@ int main() {
      */
     if(createLightResource() != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack cannot create resource...");
+        OIC_LOG(ERROR, TAG, "OCStack cannot create resource...");
     }
 
     // Break from loop with Ctrl-C
-    OC_LOG(INFO, TAG, "Entering ocserver main loop...");
+    OIC_LOG(INFO, TAG, "Entering ocserver main loop...");
     signal(SIGINT, handleSigInt);
     while (!gQuitFlag) {
 
         if (OCProcess() != OC_STACK_OK) {
-            OC_LOG(ERROR, TAG, "OCStack process error");
+            OIC_LOG(ERROR, TAG, "OCStack process error");
             return 0;
         }
 
         sleep(1);
     }
 
-    OC_LOG(INFO, TAG, "Exiting ocserver main loop...");
+    OIC_LOG(INFO, TAG, "Exiting ocserver main loop...");
 
     if (OCStop() != OC_STACK_OK) {
-        OC_LOG(ERROR, TAG, "OCStack process error");
+        OIC_LOG(ERROR, TAG, "OCStack process error");
     }
 
     return 0;
index dbf73d7..20060bd 100644 (file)
@@ -70,14 +70,14 @@ std::chrono::seconds const SHORT_TEST_TIMEOUT = std::chrono::seconds(5);
 extern "C"  OCStackApplicationResult asyncDoResourcesCallback(void* ctx,
         OCDoHandle /*handle*/, OCClientResponse * clientResponse)
 {
-    OC_LOG(INFO, TAG, "Entering asyncDoResourcesCallback");
+    OIC_LOG(INFO, TAG, "Entering asyncDoResourcesCallback");
 
     EXPECT_EQ(OC_STACK_OK, clientResponse->result);
 
     if(ctx == (void*)DEFAULT_CONTEXT_VALUE) {
-        OC_LOG_V(INFO, TAG, "Callback Context recvd successfully");
+        OIC_LOG_V(INFO, TAG, "Callback Context recvd successfully");
     }
-    OC_LOG_V(INFO, TAG, "result = %d", clientResponse->result);
+    OIC_LOG_V(INFO, TAG, "result = %d", clientResponse->result);
 
     return OC_STACK_KEEP_TRANSACTION;
 }
@@ -89,7 +89,7 @@ OCEntityHandlerResult entityHandler(OCEntityHandlerFlag /*flag*/,
         OCEntityHandlerRequest * /*entityHandlerRequest*/,
         void* /*callbackParam*/)
 {
-    OC_LOG(INFO, TAG, "Entering entityHandler");
+    OIC_LOG(INFO, TAG, "Entering entityHandler");
 
     return OC_EH_OK;
 }
@@ -99,10 +99,10 @@ OCEntityHandlerResult entityHandler(OCEntityHandlerFlag /*flag*/,
 //-----------------------------------------------------------------------------
 void InitStack(OCMode mode)
 {
-    OC_LOG(INFO, TAG, "Entering InitStack");
+    OIC_LOG(INFO, TAG, "Entering InitStack");
 
     EXPECT_EQ(OC_STACK_OK, OCInit(NULL, 0, mode));
-    OC_LOG(INFO, TAG, "Leaving InitStack");
+    OIC_LOG(INFO, TAG, "Leaving InitStack");
 }
 
 uint8_t InitNumExpectedResources()
@@ -304,7 +304,7 @@ TEST(StackDiscovery, DISABLED_DoResourceDeviceDiscovery)
     OCCallbackData cbData;
     OCDoHandle handle;
 
-    OC_LOG(INFO, TAG, "Starting DoResourceDeviceDiscovery test ");
+    OIC_LOG(INFO, TAG, "Starting DoResourceDeviceDiscovery test ");
     InitStack(OC_CLIENT);
 
     /* Start a discovery query*/
@@ -346,7 +346,7 @@ TEST(StackResource, DISABLED_UpdateResourceNullURI)
     OCCallbackData cbData;
     OCDoHandle handle;
 
-    OC_LOG(INFO, TAG, "Starting UpdateResourceNullURI test");
+    OIC_LOG(INFO, TAG, "Starting UpdateResourceNullURI test");
     InitStack(OC_CLIENT);
 
     /* Start a discovery query*/
@@ -371,7 +371,7 @@ TEST(StackResource, DISABLED_UpdateResourceNullURI)
 TEST(StackResource, CreateResourceBadParams)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
-    OC_LOG(INFO, TAG, "Starting CreateResourceBadParams test");
+    OIC_LOG(INFO, TAG, "Starting CreateResourceBadParams test");
     InitStack(OC_SERVER);
 
     OCResourceHandle handle;
@@ -407,7 +407,7 @@ TEST(StackResource, CreateResourceBadParams)
 TEST(StackResource, CreateResourceBadUri)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
-    OC_LOG(INFO, TAG, "Starting CreateResourceBadUri test");
+    OIC_LOG(INFO, TAG, "Starting CreateResourceBadUri test");
     InitStack(OC_SERVER);
 
     const char *uri65 = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL";
@@ -444,7 +444,7 @@ TEST(StackResource, CreateResourceBadUri)
 TEST(StackResource, CreateResourceSuccess)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
-    OC_LOG(INFO, TAG, "Starting CreateResourceSuccess test");
+    OIC_LOG(INFO, TAG, "Starting CreateResourceSuccess test");
     InitStack(OC_SERVER);
 
     OCResourceHandle handle;
@@ -464,7 +464,7 @@ TEST(StackResource, CreateResourceSuccess)
 TEST(StackResource, CreateResourceSuccessWithResourcePolicyPropNone)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
-    OC_LOG(INFO, TAG, "Starting CreateResourceSuccessWithResourcePolicyPropNone test");
+    OIC_LOG(INFO, TAG, "Starting CreateResourceSuccessWithResourcePolicyPropNone test");
     InitStack(OC_SERVER);
 
     OCResourceHandle handle;
@@ -486,7 +486,7 @@ TEST(StackResource, CreateResourceSuccessWithResourcePolicyPropNone)
 TEST(StackResource, CreateResourceWithClientStackMode)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
-    OC_LOG(INFO, TAG, "Starting CreateResourceSuccess test");
+    OIC_LOG(INFO, TAG, "Starting CreateResourceSuccess test");
     InitStack(OC_CLIENT);
 
     OCResourceHandle handle;
@@ -504,7 +504,7 @@ TEST(StackResource, CreateResourceWithClientStackMode)
 TEST(StackResource, CreateResourceFailDuplicateUri)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
-    OC_LOG(INFO, TAG, "Starting CreateResourceFailDuplicateUri test");
+    OIC_LOG(INFO, TAG, "Starting CreateResourceFailDuplicateUri test");
     InitStack(OC_SERVER);
 
     OCResourceHandle handle;
@@ -532,7 +532,7 @@ TEST(StackResource, CreateResourceFailDuplicateUri)
 TEST(StackResource, CreateResourceMultipleResources)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
-    OC_LOG(INFO, TAG, "Starting CreateResourceMultipleResources test");
+    OIC_LOG(INFO, TAG, "Starting CreateResourceMultipleResources test");
     InitStack(OC_SERVER);
 
     OCResourceHandle handle1;
@@ -576,7 +576,7 @@ TEST(StackResource, CreateResourceMultipleResources)
 TEST(StackResource, CreateResourceBadResoureType)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
-    OC_LOG(INFO, TAG, "Starting CreateResourceBadResoureType test");
+    OIC_LOG(INFO, TAG, "Starting CreateResourceBadResoureType test");
     InitStack(OC_SERVER);
 
     OCResourceHandle handle;
@@ -603,7 +603,7 @@ TEST(StackResource, CreateResourceBadResoureType)
 TEST(StackResource, CreateResourceGoodResourceType)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
-    OC_LOG(INFO, TAG, "Starting CreateResourceGoodResourceType test");
+    OIC_LOG(INFO, TAG, "Starting CreateResourceGoodResourceType test");
     InitStack(OC_SERVER);
 
     OCResourceHandle handle;
@@ -621,7 +621,7 @@ TEST(StackResource, CreateResourceGoodResourceType)
 TEST(StackResource, ResourceTypeName)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
-    OC_LOG(INFO, TAG, "Starting ResourceTypeName test");
+    OIC_LOG(INFO, TAG, "Starting ResourceTypeName test");
     InitStack(OC_SERVER);
 
     OCResourceHandle handle;
@@ -652,7 +652,7 @@ TEST(StackResource, ResourceTypeName)
 TEST(StackResource, ResourceTypeAttrRepresentation)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
-    OC_LOG(INFO, TAG, "Starting ResourceTypeAttrRepresentation test");
+    OIC_LOG(INFO, TAG, "Starting ResourceTypeAttrRepresentation test");
     InitStack(OC_SERVER);
 
     OCResourceHandle handle;
@@ -674,7 +674,7 @@ TEST(StackResource, ResourceTypeAttrRepresentation)
 TEST(StackResource, ResourceTypeInterface)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
-    OC_LOG(INFO, TAG, "Starting ResourceTypeInterface test");
+    OIC_LOG(INFO, TAG, "Starting ResourceTypeInterface test");
     InitStack(OC_SERVER);
 
     OCResourceHandle handle;
@@ -706,7 +706,7 @@ TEST(StackResource, ResourceDefaultInterfaceAlwaysFirst)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
 
-    OC_LOG(INFO, TAG, "Starting ResourceDefaultInterfaceAlwaysFirst test");
+    OIC_LOG(INFO, TAG, "Starting ResourceDefaultInterfaceAlwaysFirst test");
 
     InitStack(OC_SERVER);
 
@@ -737,7 +737,7 @@ TEST(StackResource, ResourceDuplicateDefaultInterfaces)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
 
-    OC_LOG(INFO, TAG, "Starting ResourceDuplicateDefaultInterfaces test");
+    OIC_LOG(INFO, TAG, "Starting ResourceDuplicateDefaultInterfaces test");
 
     InitStack(OC_SERVER);
 
@@ -769,7 +769,7 @@ TEST(StackResource, ResourceDuplicateNonDefaultInterfaces)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
 
-    OC_LOG(INFO, TAG, "Starting ResourceDuplicateInterfaces test");
+    OIC_LOG(INFO, TAG, "Starting ResourceDuplicateInterfaces test");
 
     InitStack(OC_SERVER);
 
@@ -797,7 +797,7 @@ TEST(StackResource, ResourceDuplicateNonDefaultInterfaces)
 TEST(StackResource, ResourceTypeInterfaceMethods)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
-    OC_LOG(INFO, TAG, "Starting ResourceTypeInterfaceMethods test");
+    OIC_LOG(INFO, TAG, "Starting ResourceTypeInterfaceMethods test");
     InitStack(OC_SERVER);
 
     OCResourceHandle handle;
@@ -819,7 +819,7 @@ TEST(StackResource, ResourceTypeInterfaceMethods)
 TEST(StackResource, GetResourceProperties)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
-    OC_LOG(INFO, TAG, "Starting GetResourceProperties test");
+    OIC_LOG(INFO, TAG, "Starting GetResourceProperties test");
     InitStack(OC_SERVER);
 
     OCResourceHandle handle;
@@ -840,7 +840,7 @@ TEST(StackResource, GetResourceProperties)
 TEST(StackResource, StackTestResourceDiscoverOneResourceBad)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
-    OC_LOG(INFO, TAG, "Starting StackTestResourceDiscoverOneResourceBad test");
+    OIC_LOG(INFO, TAG, "Starting StackTestResourceDiscoverOneResourceBad test");
     InitStack(OC_SERVER);
     uint8_t numResources = 0;
     EXPECT_EQ(OC_STACK_OK, OCGetNumberOfResources(&numResources));
@@ -869,7 +869,7 @@ TEST(StackResource, StackTestResourceDiscoverOneResourceBad)
 TEST(StackResource, StackTestResourceDiscoverOneResource)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
-    OC_LOG(INFO, TAG, "Starting StackTestResourceDiscoverOneResource test");
+    OIC_LOG(INFO, TAG, "Starting StackTestResourceDiscoverOneResource test");
     InitStack(OC_SERVER);
 
     OCResourceHandle handle;
@@ -892,7 +892,7 @@ TEST(StackResource, StackTestResourceDiscoverOneResource)
 TEST(StackResource, StackTestResourceDiscoverManyResources)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
-    OC_LOG(INFO, TAG, "Starting StackTestResourceDiscoverManyResources test");
+    OIC_LOG(INFO, TAG, "Starting StackTestResourceDiscoverManyResources test");
     InitStack(OC_SERVER);
 
     OCResourceHandle handle1;
@@ -957,7 +957,7 @@ TEST(StackResource, StackTestResourceDiscoverManyResources)
 TEST(StackBind, BindResourceTypeNameBad)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
-    OC_LOG(INFO, TAG, "Starting BindResourceTypeNameBad test");
+    OIC_LOG(INFO, TAG, "Starting BindResourceTypeNameBad test");
     InitStack(OC_SERVER);
 
     OCResourceHandle handle;
@@ -983,7 +983,7 @@ TEST(StackBind, BindResourceTypeNameBad)
 TEST(StackBind, BindResourceTypeNameGood)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
-    OC_LOG(INFO, TAG, "Starting BindResourceTypeNameGood test");
+    OIC_LOG(INFO, TAG, "Starting BindResourceTypeNameGood test");
     InitStack(OC_SERVER);
 
     OCResourceHandle handle;
@@ -1019,7 +1019,7 @@ TEST(StackBind, BindResourceTypeNameGood)
 TEST(StackBind, BindResourceTypeAttribRepGood)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
-    OC_LOG(INFO, TAG, "Starting BindResourceTypeAttribRepGood test");
+    OIC_LOG(INFO, TAG, "Starting BindResourceTypeAttribRepGood test");
     InitStack(OC_SERVER);
 
     OCResourceHandle handle;
@@ -1050,7 +1050,7 @@ TEST(StackBind, BindResourceTypeAttribRepGood)
 TEST(StackBind, BindResourceInterfaceNameBad)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
-    OC_LOG(INFO, TAG, "Starting BindResourceInterfaceNameBad test");
+    OIC_LOG(INFO, TAG, "Starting BindResourceInterfaceNameBad test");
     InitStack(OC_SERVER);
 
     OCResourceHandle handle;
@@ -1076,7 +1076,7 @@ TEST(StackBind, BindResourceInterfaceNameBad)
 TEST(StackBind, BindResourceInterfaceNameGood)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
-    OC_LOG(INFO, TAG, "Starting BindResourceInterfaceNameGood test");
+    OIC_LOG(INFO, TAG, "Starting BindResourceInterfaceNameGood test");
     InitStack(OC_SERVER);
 
     OCResourceHandle handle;
@@ -1107,7 +1107,7 @@ TEST(StackBind, BindResourceInterfaceNameGood)
 TEST(StackBind, BindResourceInterfaceMethodsBad)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
-    OC_LOG(INFO, TAG, "Starting BindResourceInterfaceMethodsBad test");
+    OIC_LOG(INFO, TAG, "Starting BindResourceInterfaceMethodsBad test");
     InitStack(OC_SERVER);
 
     OCResourceHandle handle;
@@ -1131,7 +1131,7 @@ TEST(StackBind, BindResourceInterfaceMethodsBad)
 TEST(StackBind, BindResourceInterfaceMethodsGood)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
-    OC_LOG(INFO, TAG, "Starting BindResourceInterfaceMethodsGood test");
+    OIC_LOG(INFO, TAG, "Starting BindResourceInterfaceMethodsGood test");
     InitStack(OC_SERVER);
 
     OCResourceHandle handle;
@@ -1158,7 +1158,7 @@ TEST(StackBind, BindResourceInterfaceMethodsGood)
 TEST(StackBind, BindContainedResourceBad)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
-    OC_LOG(INFO, TAG, "Starting BindContainedResourceBad test");
+    OIC_LOG(INFO, TAG, "Starting BindContainedResourceBad test");
     InitStack(OC_SERVER);
 
     OCResourceHandle containerHandle;
@@ -1189,7 +1189,7 @@ TEST(StackBind, BindContainedResourceBad)
 TEST(StackBind, BindContainedResourceGood)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
-    OC_LOG(INFO, TAG, "Starting BindContainedResourceGood test");
+    OIC_LOG(INFO, TAG, "Starting BindContainedResourceGood test");
     InitStack(OC_SERVER);
 
     uint8_t numResources = 0;
@@ -1297,7 +1297,7 @@ TEST(StackBind, BindContainedResourceGood)
 TEST(StackBind, BindEntityHandlerBad)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
-    OC_LOG(INFO, TAG, "Starting BindEntityHandlerBad test");
+    OIC_LOG(INFO, TAG, "Starting BindEntityHandlerBad test");
     InitStack(OC_SERVER);
 
     OCResourceHandle handle;
@@ -1317,7 +1317,7 @@ TEST(StackBind, BindEntityHandlerBad)
 TEST(StackBind, BindEntityHandlerGood)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
-    OC_LOG(INFO, TAG, "Starting BindEntityHandlerGood test");
+    OIC_LOG(INFO, TAG, "Starting BindEntityHandlerGood test");
     InitStack(OC_SERVER);
 
     OCResourceHandle handle;
@@ -1341,7 +1341,7 @@ TEST(StackBind, BindEntityHandlerGood)
 TEST(StackResourceAccess, GetResourceByIndex)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
-    OC_LOG(INFO, TAG, "Starting GetResourceByIndex test");
+    OIC_LOG(INFO, TAG, "Starting GetResourceByIndex test");
     InitStack(OC_SERVER);
 
     uint8_t numResources = 0;
@@ -1441,7 +1441,7 @@ TEST(StackResourceAccess, GetResourceByIndex)
 TEST(StackResourceAccess, DeleteHeadResource)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
-    OC_LOG(INFO, TAG, "Starting DeleteHeadResource test");
+    OIC_LOG(INFO, TAG, "Starting DeleteHeadResource test");
     InitStack(OC_SERVER);
 
     uint8_t numResources = 0;
@@ -1470,7 +1470,7 @@ TEST(StackResourceAccess, DeleteHeadResource)
 TEST(StackResourceAccess, DeleteHeadResource2)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
-    OC_LOG(INFO, TAG, "Starting DeleteHeadResource2 test");
+    OIC_LOG(INFO, TAG, "Starting DeleteHeadResource2 test");
     InitStack(OC_SERVER);
 
     uint8_t numResources = 0;
@@ -1512,7 +1512,7 @@ TEST(StackResourceAccess, DeleteHeadResource2)
 TEST(StackResourceAccess, DeleteLastResource)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
-    OC_LOG(INFO, TAG, "Starting DeleteLastResource test");
+    OIC_LOG(INFO, TAG, "Starting DeleteLastResource test");
     InitStack(OC_SERVER);
 
     uint8_t numResources = 0;
@@ -1565,7 +1565,7 @@ TEST(StackResourceAccess, DeleteLastResource)
 TEST(StackResourceAccess, DeleteMiddleResource)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
-    OC_LOG(INFO, TAG, "Starting DeleteMiddleResource test");
+    OIC_LOG(INFO, TAG, "Starting DeleteMiddleResource test");
     InitStack(OC_SERVER);
 
     uint8_t numResources = 0;