removed duplicated OC_LOG and replace it with OIC_LOG
authorjihwan.seo <jihwan.seo@samsung.com>
Fri, 19 Feb 2016 07:22:22 +0000 (16:22 +0900)
committerJon A. Cruz <jonc@osg.samsung.com>
Tue, 23 Feb 2016 18:46:09 +0000 (18:46 +0000)
Change-Id: I9294ccb4da022ac845d54a215ea157bfedd3cce2
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/5073
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Madan Lanka <lanka.madan@samsung.com>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
19 files changed:
plugins/samples/linux/IotivityandZigbeeClient.c
plugins/samples/linux/IotivityandZigbeeServer.c
plugins/src/plugininterface.c
plugins/src/pluginlist.c
plugins/zigbee_wrapper/src/zigbee_wrapper.c
plugins/zigbee_wrapper/telegesis_wrapper/src/telegesis_socket.c
plugins/zigbee_wrapper/telegesis_wrapper/src/telegesis_wrapper.c
plugins/zigbee_wrapper/telegesis_wrapper/src/twsocketlist.c
resource/csdk/logger/include/logger.h
resource/csdk/logger/test/android/loggertests.cpp
resource/csdk/logger/test/arduino/ArduinoLoggerTest.cpp
resource/csdk/logger/test/loggertests.cpp
resource/csdk/routing/include/routingutility.h
resource/csdk/stack/include/payload_logging.h
resource/csdk/stack/src/ocserverrequest.c
resource/csdk/stack/src/oickeepalive.c
resource/provisioning/examples/provisioningclient.cpp
service/resource-directory/src/rd_client.c
service/resource-directory/src/rd_server.c

index 99b4d3b..9265df6 100644 (file)
@@ -92,7 +92,7 @@ void rememberDiscoveredResources(OCClientResponse *clientResponse)
     OCResourcePayload* itr = NULL;
     if (!(OCDiscoveryPayload*)clientResponse->payload)
     {
-        OC_LOG(INFO, TAG, "No resources discovered.");
+        OIC_LOG(INFO, TAG, "No resources discovered.");
         return;
     }
 
@@ -102,7 +102,7 @@ void rememberDiscoveredResources(OCClientResponse *clientResponse)
     {
         if (countDiscoveredResources == MAX_RESOURCES_REMEMBERED)
         {
-            OC_LOG_V(INFO, TAG, "Only remembering %u resources. Ignoring rest.",
+            OIC_LOG_V(INFO, TAG, "Only remembering %u resources. Ignoring rest.",
                 MAX_RESOURCES_REMEMBERED);
             break;
         }
@@ -133,7 +133,7 @@ OCStackResult InvokeOCDoResource(const char *query,
     if (ret != OC_STACK_OK)
     {
         promptUser = true;
-        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;
 }
@@ -146,30 +146,30 @@ OCStackApplicationResult responseCallbacks(void* ctx,
     (void) ctx;
     if (clientResponse == NULL)
     {
-        OC_LOG(INFO, TAG, "responseCallbacks received NULL clientResponse");
+        OIC_LOG(INFO, TAG, "responseCallbacks received NULL clientResponse");
         return   OC_STACK_DELETE_TRANSACTION;
     }
 
-    OC_LOG_PAYLOAD(INFO, clientResponse->payload);
+    OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
     promptUser = true;
     return OC_STACK_KEEP_TRANSACTION;
 }
 
 int InitGetRequest(const char *resourceUri)
 {
-    OC_LOG_V(INFO, TAG, "Executing %s for resource: %s", __func__, resourceUri);
+    OIC_LOG_V(INFO, TAG, "Executing %s for resource: %s", __func__, resourceUri);
     return (InvokeOCDoResource(resourceUri, NULL, OC_REST_GET, responseCallbacks));
 }
 
 int InitPutRequest(const char *resourceUri, OCPayload* payload)
 {
-    OC_LOG_V(INFO, TAG, "Executing %s for resource: %s", __func__, resourceUri);
+    OIC_LOG_V(INFO, TAG, "Executing %s for resource: %s", __func__, resourceUri);
     return (InvokeOCDoResource(resourceUri, payload, OC_REST_PUT, responseCallbacks));
 }
 
 int InitObserveRequest(const char *resourceUri)
 {
-    OC_LOG_V(INFO, TAG, "Executing %s for resource: %s", __func__, resourceUri);
+    OIC_LOG_V(INFO, TAG, "Executing %s for resource: %s", __func__, resourceUri);
     return (InvokeOCDoResource(resourceUri, NULL, OC_REST_OBSERVE, responseCallbacks));
 }
 
@@ -178,7 +178,7 @@ OCPayload * getSwitchStatePayload(bool state)
     OCRepPayload* payload = OCRepPayloadCreate();
     if (!payload)
     {
-       OC_LOG(ERROR, TAG, "Failed to create payload object");
+       OIC_LOG(ERROR, TAG, "Failed to create payload object");
        exit(1);
     }
     OCRepPayloadSetPropBool(payload, "value", state);
@@ -190,18 +190,18 @@ OCPayload* getChangeBulbTempLevelPayload(uint32_t level)
     OCRepPayload* payload = OCRepPayloadCreate();
     if (!payload)
     {
-        OC_LOG(ERROR, TAG, "Failed to create payload object");
+        OIC_LOG(ERROR, TAG, "Failed to create payload object");
         exit(1);
     }
 
-    OC_LOG_V(INFO, TAG, "Setting level to : %u", level);
+    OIC_LOG_V(INFO, TAG, "Setting level to : %u", level);
     char value[4] = "";
     errno = 0;
     size_t sizeValue = sizeof(value);
     int strRet = snprintf(value, sizeValue, "%d", level);
     if (strRet < 0 || strRet >= sizeValue)
     {
-        OC_LOG_V(ERROR, TAG, "Failed to parse string due to errno: %d", errno);
+        OIC_LOG_V(ERROR, TAG, "Failed to parse string due to errno: %d", errno);
         exit(1);
     }
     OCRepPayloadSetPropString(payload, "colourspacevalue", value);
@@ -213,11 +213,11 @@ OCPayload* getChangeDimLevelPayload(uint32_t level)
     OCRepPayload* payload = OCRepPayloadCreate();
     if (!payload)
     {
-        OC_LOG(ERROR, TAG, "Failed to create payload object");
+        OIC_LOG(ERROR, TAG, "Failed to create payload object");
         exit(1);
     }
 
-    OC_LOG_V(INFO, TAG, "Setting level to : %u", level);
+    OIC_LOG_V(INFO, TAG, "Setting level to : %u", level);
     OCRepPayloadSetPropInt(payload, "dimmingSetting", level);
     return (OCPayload*) payload;
 }
@@ -229,12 +229,12 @@ OCStackApplicationResult discoveryReqCB(void* ctx, OCDoHandle handle,
     (void) ctx;
     if (!clientResponse)
     {
-        OC_LOG(INFO, TAG, "Discovery response is NULL");
+        OIC_LOG(INFO, TAG, "Discovery response is NULL");
         return OC_STACK_KEEP_TRANSACTION;
     }
 
-    OC_LOG_PAYLOAD(INFO, clientResponse->payload);
-    OC_LOG_V(INFO, TAG, "Discovered @ %s:%d", clientResponse->devAddr.addr,
+    OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
+    OIC_LOG_V(INFO, TAG, "Discovered @ %s:%d", clientResponse->devAddr.addr,
                                 clientResponse->devAddr.port);
 
     destinationAddress = clientResponse->devAddr;
@@ -251,7 +251,7 @@ OCPayload* getCustomPutPayload()
     OCRepPayload* payload = OCRepPayloadCreate();
     if (!payload)
     {
-        OC_LOG(ERROR, TAG, "Failed to create payload object");
+        OIC_LOG(ERROR, TAG, "Failed to create payload object");
         exit(1);
     }
 
@@ -306,7 +306,7 @@ OCPayload* getCustomPutPayload()
         }
         else
         {
-            OC_LOG(ERROR, TAG, "Invalid entry. Stopping accepting key-values");
+            OIC_LOG(ERROR, TAG, "Invalid entry. Stopping accepting key-values");
             OCRepPayloadDestroy(payload);
             promptUser = true;
             return NULL;
@@ -349,7 +349,7 @@ void processUserInput(int resourceNo, int testCase)
             }
             else
             {
-                OC_LOG(ERROR, TAG, "Error creating payload. Not sending PUT request");
+                OIC_LOG(ERROR, TAG, "Error creating payload. Not sending PUT request");
                 promptUser = true;
             }
             break;
@@ -406,7 +406,7 @@ void processUserInput(int resourceNo, int testCase)
 
         default:
             promptUser = true;
-            OC_LOG(INFO, TAG, "Invalid test case");
+            OIC_LOG(INFO, TAG, "Invalid test case");
     }
 }
 
@@ -451,7 +451,7 @@ OCStackResult DiscoverResources()
 
     if (ret != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCDoResource error");
+        OIC_LOG(ERROR, TAG, "OCDoResource error");
     }
     return ret;
 }
@@ -479,12 +479,12 @@ int main(int argc, char* argv[])
     (void) argc;
     (void) argv;
     OCStackResult result;
-    OC_LOG(INFO, TAG, "Initializing IoTivity...");
+    OIC_LOG(INFO, TAG, "Initializing IoTivity...");
 
     result = OCInit(NULL, 0, OC_CLIENT);
     if (result != OC_STACK_OK)
     {
-        OC_LOG_V(ERROR, TAG, "OCInit Failed %d", result);
+        OIC_LOG_V(ERROR, TAG, "OCInit Failed %d", result);
         return -1;
     }
 
@@ -492,18 +492,18 @@ int main(int argc, char* argv[])
 
     if (signal(SIGINT, processCancel) == SIG_ERR)
     {
-        OC_LOG(ERROR, TAG, "Unable to catch SIGINT, terminating...");
+        OIC_LOG(ERROR, TAG, "Unable to catch SIGINT, terminating...");
     }
     else
     {
-        OC_LOG(INFO, TAG, "Press Ctrl-C to terminate");
+        OIC_LOG(INFO, TAG, "Press Ctrl-C to terminate");
         // Loop until sigint
         while (!processSignal(false) && result == OC_STACK_OK)
         {
             result = OCProcess();
             if (result != OC_STACK_OK)
             {
-                OC_LOG_V(ERROR, TAG, "OCProcess Failed: %d", result);
+                OIC_LOG_V(ERROR, TAG, "OCProcess Failed: %d", result);
                 break;
             }
 
@@ -515,11 +515,11 @@ int main(int argc, char* argv[])
         }
     }
 
-    OC_LOG(INFO, TAG, "Stopping IoTivity...");
+    OIC_LOG(INFO, TAG, "Stopping IoTivity...");
     result = OCStop();
     if (result != OC_STACK_OK)
     {
-        OC_LOG_V(ERROR, TAG, "OCStop Failed: %d", result);
+        OIC_LOG_V(ERROR, TAG, "OCStop Failed: %d", result);
     }
 
     return 0;
index be95b5a..30a8c79 100644 (file)
 #define defaultComPort "/dev/ttyUSB0"
 int main()
 {
-    OC_LOG(INFO, TAG, "Initializing IoTivity...");
+    OIC_LOG(INFO, TAG, "Initializing IoTivity...");
     OCStackResult result = OCInit(NULL, 0, OC_SERVER);
     if (result != OC_STACK_OK)
     {
-        OC_LOG_V(ERROR, TAG, "OCInit Failed %d", result);
+        OIC_LOG_V(ERROR, TAG, "OCInit Failed %d", result);
         return -1;
     }
 
     result = SetPlatformInfo();
     if (result != OC_STACK_OK)
     {
-        OC_LOG_V(ERROR, TAG, "SetPlatformInfo Failed %d", result);
+        OIC_LOG_V(ERROR, TAG, "SetPlatformInfo Failed %d", result);
         goto IotivityStop;
     }
 
     result  = SetDeviceInfo();
     if (result != OC_STACK_OK)
     {
-        OC_LOG_V(ERROR, TAG, "SetPlatformInfo Failed: %d", result);
+        OIC_LOG_V(ERROR, TAG, "SetPlatformInfo Failed: %d", result);
         goto IotivityStop;
     }
 
     result  = OCStartPresence(0);
     if (result != OC_STACK_OK)
     {
-        OC_LOG_V(ERROR, TAG, "OCStartPresence Failed: %d", result);
+        OIC_LOG_V(ERROR, TAG, "OCStartPresence Failed: %d", result);
         goto IotivityStop;
     }
 
     // PIStartPlugin
     PIPlugin* plugin = NULL;
-    OC_LOG(INFO, TAG, "IoTivity Initialized properly, Starting Zigbee Plugin...");
+    OIC_LOG(INFO, TAG, "IoTivity Initialized properly, Starting Zigbee Plugin...");
     result = PIStartPlugin(defaultComPort, PLUGIN_ZIGBEE, &plugin);
     if (result != OC_STACK_OK)
     {
-        OC_LOG_V(ERROR, TAG, "Zigbee Plugin Start Failed: %d", result);
+        OIC_LOG_V(ERROR, TAG, "Zigbee Plugin Start Failed: %d", result);
         goto IotivityStop;
     }
 
     if (signal(SIGINT, processCancel) == SIG_ERR)
     {
-        OC_LOG(ERROR, TAG, "Unable to catch SIGINT, terminating...");
+        OIC_LOG(ERROR, TAG, "Unable to catch SIGINT, terminating...");
     }
     else
     {
-        OC_LOG(INFO, TAG, "Zigbee Plugin started correctly, press Ctrl-C to terminate application");
+        OIC_LOG(INFO, TAG, "Zigbee Plugin started correctly, press Ctrl-C to terminate application");
         // Loop until sigint
         while (!processSignal(false) && result == OC_STACK_OK)
         {
             result = OCProcess();
             if (result != OC_STACK_OK)
             {
-                OC_LOG_V(ERROR, TAG, "OCProcess Failed: %d", result);
+                OIC_LOG_V(ERROR, TAG, "OCProcess Failed: %d", result);
                 break;
             }
 
             result = PIProcess(plugin);
             if (result != OC_STACK_OK)
             {
-                OC_LOG_V(ERROR, TAG, "PIProcess Failed: %d", result);
+                OIC_LOG_V(ERROR, TAG, "PIProcess Failed: %d", result);
             }
         }
     }
 
-    OC_LOG(INFO, TAG, "Stopping Zigbee Plugin...");
+    OIC_LOG(INFO, TAG, "Stopping Zigbee Plugin...");
     result = PIStopPlugin(plugin);
     if (result != OC_STACK_OK)
     {
-        OC_LOG_V(ERROR, TAG, "Zigbee Plugin Stop Failed: %d", result);
+        OIC_LOG_V(ERROR, TAG, "Zigbee Plugin Stop Failed: %d", result);
     }
-    OC_LOG(INFO, TAG, "Zigbee Plugin Stopped");
+    OIC_LOG(INFO, TAG, "Zigbee Plugin Stopped");
     // OCStop
 IotivityStop:
-    OC_LOG(INFO, TAG, "Stopping IoTivity...");
+    OIC_LOG(INFO, TAG, "Stopping IoTivity...");
     result = OCStop();
     if (result != OC_STACK_OK)
     {
-        OC_LOG_V(ERROR, TAG, "OCStop Failed: %d", result);
+        OIC_LOG_V(ERROR, TAG, "OCStop Failed: %d", result);
         return 0;
     }
 
-    OC_LOG(INFO, TAG, "Application Completed Successfully");
+    OIC_LOG(INFO, TAG, "Application Completed Successfully");
     return 0;
 }
 
index d5b200f..483a3a5 100644 (file)
@@ -48,7 +48,7 @@ OCEntityHandlerResult PluginInterfaceEntityHandler(OCEntityHandlerFlag flag,
 {
     if (!entityHandlerRequest)
     {
-        OC_LOG (ERROR, TAG, "Invalid request pointer");
+        OIC_LOG (ERROR, TAG, "Invalid request pointer");
         return OC_EH_ERROR;
     }
 
@@ -88,20 +88,20 @@ OCEntityHandlerResult PluginInterfaceEntityHandler(OCEntityHandlerFlag flag,
         result = OCDoResponse(response);
         if (result != OC_STACK_OK)
         {
-            OC_LOG_V(ERROR, TAG, "Error sending response %u", result);
+            OIC_LOG_V(ERROR, TAG, "Error sending response %u", result);
             ehResult = OC_EH_ERROR;
         }
     }
     else
     {
-        OC_LOG_V(ERROR, TAG, "Error handling request %u", ehResult);
+        OIC_LOG_V(ERROR, TAG, "Error handling request %u", ehResult);
         PIResource * piResource = NULL;
         result = GetResourceFromHandle(plugin, &piResource, response->resourceHandle);
-        OC_LOG_V(ERROR, TAG, "Deleting resource \"%s\" because of failed request.", piResource->uri);
+        OIC_LOG_V(ERROR, TAG, "Deleting resource \"%s\" because of failed request.", piResource->uri);
         result = DeleteResource(plugin, piResource);
         if(result != OC_STACK_OK)
         {
-            OC_LOG_V(ERROR, TAG, "Failed to delete resource after failed request.");
+            OIC_LOG_V(ERROR, TAG, "Failed to delete resource after failed request.");
             ehResult = OC_EH_ERROR;
         }
     }
@@ -132,7 +132,7 @@ void piNewResourceCB(PIPluginBase * p_plugin, PIResourceBase * r_newResource)
         OICFree (r_newResource);
         return;
     }
-    OC_LOG_V(INFO, TAG, "Created resource of type: %s\n",
+    OIC_LOG_V(INFO, TAG, "Created resource of type: %s\n",
         r_newResource->piResource.resourceTypeName);
 
     result = AddResourceToPlugin(p_plugin, r_newResource);
@@ -148,7 +148,7 @@ void piObserveNotificationUpdate(PIPluginBase * plugin, OCResourceHandle resourc
     OCStackResult result = OCNotifyAllObservers(resourceHandle, OC_LOW_QOS);
     if(result != OC_STACK_OK && result != OC_STACK_NO_OBSERVERS)
     {
-        OC_LOG_V(ERROR, TAG, "Failed to notify observers of update. Result: %d", result);
+        OIC_LOG_V(ERROR, TAG, "Failed to notify observers of update. Result: %d", result);
     }
 }
 
index 59d5ac2..01c7adc 100644 (file)
@@ -121,15 +121,15 @@ OCStackResult GetResourceFromZigBeeNodeId(PIPluginBase * plugin,
                                           const char * endpointId,
                                           const char * clusterId)
 {
-    OC_LOG(INFO, TAG, "Entered GetResourceFromZigBeeNodeId().");
+    OIC_LOG(INFO, TAG, "Entered GetResourceFromZigBeeNodeId().");
     if(!plugin || !piResource || !nodeId || !clusterId || !endpointId)
     {
-        OC_LOG(ERROR, TAG, "Invalid param.");
+        OIC_LOG(ERROR, TAG, "Invalid param.");
         return OC_STACK_INVALID_PARAM;
     }
     if(plugin->type != PLUGIN_ZIGBEE)
     {
-        OC_LOG(ERROR, TAG, "Plugin Type is not Zigbee.");
+        OIC_LOG(ERROR, TAG, "Plugin Type is not Zigbee.");
         return OC_STACK_INVALID_PARAM;
     }
 
@@ -165,7 +165,7 @@ OCStackResult GetResourceFromZigBeeNodeId(PIPluginBase * plugin,
         {
             continue;
         }
-        OC_LOG_V(INFO, TAG, "Found a match! URI = %s", out->piResource.uri);
+        OIC_LOG_V(INFO, TAG, "Found a match! URI = %s", out->piResource.uri);
         *piResource = (PIResource_Zigbee *) out;
         return OC_STACK_OK;
     }
@@ -227,7 +227,7 @@ OCStackResult DeleteResource(PIPluginBase * plugin, PIResourceBase * resource)
     OCStackResult result = OCDeleteResource(resource->piResource.resourceHandle);
     if(result != OC_STACK_OK)
     {
-        OC_LOG_V(ERROR, TAG, "Failed to delete resource with error: %d", result);
+        OIC_LOG_V(ERROR, TAG, "Failed to delete resource with error: %d", result);
         return result;
     }
 
index 20df3d8..ee17a9b 100644 (file)
@@ -220,7 +220,7 @@ const char * getResourceTypeForIASZoneType(TWDevice *device, PIPluginBase* plugi
 
     if (ret != OC_STACK_OK || !IASZoneType)
     {
-        OC_LOG_V(ERROR, TAG, "Error %u getting IAS Zone Type", ret);
+        OIC_LOG_V(ERROR, TAG, "Error %u getting IAS Zone Type", ret);
         return NULL;
     }
 
@@ -238,7 +238,7 @@ const char * getResourceTypeForIASZoneType(TWDevice *device, PIPluginBase* plugi
     }
     else
     {
-        OC_LOG_V(ERROR, TAG, "Unsupported Zone Type %s", IASZoneType);
+        OIC_LOG_V(ERROR, TAG, "Unsupported Zone Type %s", IASZoneType);
         resourceType = NULL;
     }
 
@@ -268,7 +268,7 @@ OCStackResult buildURI(char ** output,
 
     if (!*output)
     {
-        OC_LOG(ERROR, TAG, "Out of memory");
+        OIC_LOG(ERROR, TAG, "Out of memory");
         return OC_STACK_NO_MEMORY;
     }
 
@@ -320,7 +320,7 @@ void foundZigbeeCallback(TWDevice *device, PIPlugin_Zigbee* plugin)
 {
     if (!device)
     {
-        OC_LOG(ERROR, TAG, "foundZigbeeCallback: Invalid parameter.");
+        OIC_LOG(ERROR, TAG, "foundZigbeeCallback: Invalid parameter.");
         return;
     }
     int count = device->endpointOfInterest->clusterList->count;
@@ -329,7 +329,7 @@ void foundZigbeeCallback(TWDevice *device, PIPlugin_Zigbee* plugin)
         PIResource_Zigbee *piResource = (PIResource_Zigbee *) OICMalloc(sizeof(*piResource));
         if (!piResource)
         {
-            OC_LOG(ERROR, TAG, "Out of memory");
+            OIC_LOG(ERROR, TAG, "Out of memory");
             return;
         }
         piResource->header.plugin = (PIPluginBase *)plugin;
@@ -362,7 +362,7 @@ void foundZigbeeCallback(TWDevice *device, PIPlugin_Zigbee* plugin)
             {
                 // Just log it and move on if this fails?
                 // or not create this resource at all?
-                OC_LOG(ERROR, TAG, "Command to listen for status updates failed");
+                OIC_LOG(ERROR, TAG, "Command to listen for status updates failed");
             }
         }
         else
@@ -373,7 +373,7 @@ void foundZigbeeCallback(TWDevice *device, PIPlugin_Zigbee* plugin)
 
         if (piResource->header.piResource.resourceTypeName == NULL)
         {
-            OC_LOG_V(ERROR, TAG, "unsupported clusterId : %s",
+            OIC_LOG_V(ERROR, TAG, "unsupported clusterId : %s",
                 device->endpointOfInterest->clusterList->clusterIds[i].clusterId);
             OICFree(piResource->header.piResource.uri);
             OICFree(piResource);
@@ -408,7 +408,7 @@ void zigbeeZoneStatusUpdate(TWUpdate * update, PIPlugin_Zigbee* plugin)
                                                     ZB_IAS_ZONE_CLUSTER);
     if (result != OC_STACK_OK || !piResource)
     {
-        OC_LOG_V(ERROR, TAG, "Failed to retrieve resource handle with result: %d", result);
+        OIC_LOG_V(ERROR, TAG, "Failed to retrieve resource handle with result: %d", result);
         return;
     }
 
@@ -427,7 +427,7 @@ void deviceNodeIdChanged(const char * eui, const char * nodeId, PIPlugin_Zigbee*
                                                   nodeId);
     if(result != OC_STACK_OK)
     {
-        OC_LOG_V(ERROR, TAG, "Failed to update Zigbee Resource NodeId due to result: %s", result);
+        OIC_LOG_V(ERROR, TAG, "Failed to update Zigbee Resource NodeId due to result: %s", result);
     }
 }
 
@@ -470,7 +470,7 @@ OCStackResult ZigbeeDiscover(PIPlugin_Zigbee * plugin)
     OCStackResult result = OC_STACK_ERROR;
     TWSetDiscoveryCallback(foundZigbeeCallback, plugin);
     result = TWDiscover(plugin);
-    OC_LOG_V(DEBUG, TAG, "ZigbeeDiscover : Status = %d\n", result);
+    OIC_LOG_V(DEBUG, TAG, "ZigbeeDiscover : Status = %d\n", result);
 
     return result;
 }
@@ -823,14 +823,14 @@ OCEntityHandlerResult processGetRequest(PIPluginBase * plugin,
                         ehRequest->resource);
     if (stackResult != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "Failed to get resource from handle");
+        OIC_LOG(ERROR, TAG, "Failed to get resource from handle");
         return OC_EH_ERROR;
     }
     stackResult = getZigBeeAttributesForOICResource(
         piResource->header.piResource.resourceTypeName, &attributeList);
     if (stackResult != OC_STACK_OK)
     {
-        OC_LOG_V(ERROR, TAG, "Failed to fetch attributes for %s",
+        OIC_LOG_V(ERROR, TAG, "Failed to fetch attributes for %s",
             piResource->header.piResource.resourceTypeName);
         return OC_EH_ERROR;
     }
@@ -838,7 +838,7 @@ OCEntityHandlerResult processGetRequest(PIPluginBase * plugin,
     *payload = OCRepPayloadCreate();
     if (!payload)
     {
-        OC_LOG(ERROR, TAG, PCF("Failed to allocate Payload"));
+        OIC_LOG(ERROR, TAG, PCF("Failed to allocate Payload"));
         return OC_EH_ERROR;
     }
     bool boolRes = OCRepPayloadSetUri(*payload, piResource->header.piResource.uri);
@@ -1006,7 +1006,7 @@ OCEntityHandlerResult processPutRequest(PIPluginBase * plugin,
                                         ehRequest->resource);
     if (stackResult != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "Failed to get resource from handle");
+        OIC_LOG(ERROR, TAG, "Failed to get resource from handle");
         return OC_EH_ERROR;
     }
 
@@ -1015,7 +1015,7 @@ OCEntityHandlerResult processPutRequest(PIPluginBase * plugin,
                         &attributeList, *payload);
     if (boolRes == false)
     {
-        OC_LOG_V(ERROR, TAG, "Failed to fetch attributes for %s",
+        OIC_LOG_V(ERROR, TAG, "Failed to fetch attributes for %s",
             piResource->header.piResource.resourceTypeName);
         return OC_EH_ERROR;
     }
@@ -1046,7 +1046,7 @@ OCEntityHandlerResult processPutRequest(PIPluginBase * plugin,
                     int strRet = snprintf(value, sizeof(value), "%02x", (unsigned int) rangeDiff);
                     if (strRet <= 0)
                     {
-                        OC_LOG_V(ERROR, TAG, "Failed to parse string due to errno: %d", errno);
+                        OIC_LOG_V(ERROR, TAG, "Failed to parse string due to errno: %d", errno);
                         return OC_EH_ERROR;
                     }
                 }
@@ -1063,7 +1063,7 @@ OCEntityHandlerResult processPutRequest(PIPluginBase * plugin,
                                       attributeList.list[i].val.i);
                 if (strRet <= 0)
                 {
-                    OC_LOG_V(ERROR, TAG, "Failed to parse string due to errno: %d", errno);
+                    OIC_LOG_V(ERROR, TAG, "Failed to parse string due to errno: %d", errno);
                     return OC_EH_ERROR;
                 }
                 stackResult = TWSetAttribute(piResource->eui,
@@ -1084,7 +1084,7 @@ OCEntityHandlerResult processPutRequest(PIPluginBase * plugin,
             int strRet = snprintf(value, sizeof(value), "%f", attributeList.list[i].val.d);
             if (strRet <= 0)
             {
-                OC_LOG_V(ERROR, TAG, "Failed to parse string due to errno: %d", errno);
+                OIC_LOG_V(ERROR, TAG, "Failed to parse string due to errno: %d", errno);
                 return OC_EH_ERROR;
             }
             stackResult = TWSetAttribute(piResource->eui,
@@ -1105,7 +1105,7 @@ OCEntityHandlerResult processPutRequest(PIPluginBase * plugin,
                 int strRet = snprintf(value, sizeof(value), "%04x", zbVal);
                 if (strRet <= 0)
                 {
-                    OC_LOG_V(ERROR, TAG, "Failed to parse string due to errno: %d", errno);
+                    OIC_LOG_V(ERROR, TAG, "Failed to parse string due to errno: %d", errno);
                     return OC_EH_ERROR;
                 }
                 stackResult =
index f5d91d8..877cf06 100644 (file)
@@ -136,13 +136,13 @@ TWResultCode TWWait(pthread_cond_t * cond, pthread_mutex_t * mutex, uint8_t time
         case 0:
             return TW_RESULT_OK;
         case ETIMEDOUT:
-            OC_LOG(INFO, TAG, "Timed out waiting for CV. Non-error. Please try again.");
+            OIC_LOG(INFO, TAG, "Timed out waiting for CV. Non-error. Please try again.");
             return TW_RESULT_OK;
         case EINVAL:
-            OC_LOG(ERROR, TAG, "Cond or Mutex is invalid. OR timeout value for CV is invalid.");
+            OIC_LOG(ERROR, TAG, "Cond or Mutex is invalid. OR timeout value for CV is invalid.");
             break;
         case EPERM:
-            OC_LOG(ERROR, TAG, "Cannot use CV because the current thread does not own the CV.");
+            OIC_LOG(ERROR, TAG, "Cannot use CV because the current thread does not own the CV.");
             break;
     }
 
@@ -158,16 +158,16 @@ TWResultCode TWGrabMutex(pthread_mutex_t * mutex)
         case 0:
             return TW_RESULT_OK;
         case EINVAL:
-            OC_LOG(ERROR, TAG, "Mutex was not initialized.");
+            OIC_LOG(ERROR, TAG, "Mutex was not initialized.");
             break;
         case ETIMEDOUT:
-            OC_LOG(INFO, TAG, "Timed out waiting for mutex. Non-error. Please try again.");
+            OIC_LOG(INFO, TAG, "Timed out waiting for mutex. Non-error. Please try again.");
             return TW_RESULT_OK;
         case EAGAIN:
-            OC_LOG(ERROR, TAG, "Maximum number of locks for mutex have been exceeded.");
+            OIC_LOG(ERROR, TAG, "Maximum number of locks for mutex have been exceeded.");
             break;
         case EDEADLK:
-            OC_LOG(ERROR, TAG, "Deadlock OR this thread already owns the mutex.");
+            OIC_LOG(ERROR, TAG, "Deadlock OR this thread already owns the mutex.");
             break;
     }
     return TW_RESULT_ERROR;
@@ -182,13 +182,13 @@ TWResultCode TWReleaseMutex(pthread_mutex_t * mutex)
         case 0:
             return TW_RESULT_OK;
         case EINVAL:
-            OC_LOG(ERROR, TAG, "Mutex was not initialized.");
+            OIC_LOG(ERROR, TAG, "Mutex was not initialized.");
             break;
         case EAGAIN:
-            OC_LOG(ERROR, TAG, "Maximum number of locks for mutex have been exceeded.");
+            OIC_LOG(ERROR, TAG, "Maximum number of locks for mutex have been exceeded.");
             break;
         case EPERM:
-            OC_LOG(ERROR, TAG, "Cannot unlock because the current thread does not own the mutex.");
+            OIC_LOG(ERROR, TAG, "Cannot unlock because the current thread does not own the mutex.");
             break;
     }
     return TW_RESULT_ERROR;
@@ -207,7 +207,7 @@ char readBufferChar(int fd, ssize_t * readDataBytes)
     *readDataBytes = read(fd, &byte, sizeof(byte));
     if(*readDataBytes < 0)
     {
-        OC_LOG_V(ERROR, TAG, "\tCould not read from port. Errno is: %d\n", errno);
+        OIC_LOG_V(ERROR, TAG, "\tCould not read from port. Errno is: %d\n", errno);
         return '\0';
     }
     return byte;
@@ -282,7 +282,7 @@ const char * readBufferLine(int fd)
             bufferLine = (char *) OICRealloc(bufferLineHold, bufferLineSize);
             if(!bufferLine)
             {
-                OC_LOG(ERROR, TAG, "Ran out of memory.");
+                OIC_LOG(ERROR, TAG, "Ran out of memory.");
                 return NULL;
             }
             bufferLine[bufferLoc] = '\0';
@@ -290,7 +290,7 @@ const char * readBufferLine(int fd)
             bufferLoc++;
             bufferLineHold = bufferLine;
 
-            OC_LOG_V(DEBUG, TAG, "Incoming: %s", bufferLine);
+            OIC_LOG_V(DEBUG, TAG, "Incoming: %s", bufferLine);
         }
         else
         {
@@ -302,7 +302,7 @@ const char * readBufferLine(int fd)
             bufferLine = (char *) OICRealloc(bufferLineHold, bufferLineSize);
             if(!bufferLine)
             {
-                OC_LOG(ERROR, TAG, "Ran out of memory.");
+                OIC_LOG(ERROR, TAG, "Ran out of memory.");
                 return NULL;
             }
             bufferLine[bufferLoc] = '\0';
@@ -330,13 +330,13 @@ TWResultCode TWAddLineToEntry(const char * line, TWEntry * entry)
 {
     if(!line || !entry)
     {
-        OC_LOG(ERROR, TAG, "Invalid/NULL parameter(s) received.");
+        OIC_LOG(ERROR, TAG, "Invalid/NULL parameter(s) received.");
         return TW_RESULT_ERROR_INVALID_PARAMS;
     }
     TWLine * twLine = (TWLine *) OICCalloc(1, sizeof(TWLine));
     if(!twLine)
     {
-        OC_LOG(ERROR, TAG, "Ran out of memory.");
+        OIC_LOG(ERROR, TAG, "Ran out of memory.");
         return TW_RESULT_ERROR_NO_MEMORY;
     }
     size_t lineLength = strlen(line);
@@ -381,7 +381,7 @@ TWEntry * readEntry(int fd)
     TWEntry * entry = (TWEntry *) OICCalloc(1, sizeof(TWEntry));
     if(!entry)
     {
-        OC_LOG(ERROR, TAG, "Ran out of memory.");
+        OIC_LOG(ERROR, TAG, "Ran out of memory.");
         return NULL;
     }
     entry->count = 0;
@@ -437,12 +437,12 @@ TWResultCode TWRetrieveEUI(PIPlugin_Zigbee * plugin, TWSock * twSock)
 {
     if(!plugin || !twSock)
     {
-        OC_LOG(ERROR, TAG, "Invalid param.");
+        OIC_LOG(ERROR, TAG, "Invalid param.");
         return TW_RESULT_ERROR_INVALID_PARAMS;
     }
     if(twSock->isActive == false)
     {
-        OC_LOG(ERROR, TAG, "Tried to retrieve Zigbee EUI on an uninitialized socket.");
+        OIC_LOG(ERROR, TAG, "Tried to retrieve Zigbee EUI on an uninitialized socket.");
         return TW_RESULT_ERROR;
     }
 
@@ -455,7 +455,7 @@ TWResultCode TWRetrieveEUI(PIPlugin_Zigbee * plugin, TWSock * twSock)
         p = read(twSock->fd, hideBuffer, 1);
         if(p < 0)
         {
-            OC_LOG_V(ERROR, TAG, "\tCould not read from port. Errno is: %d\n", errno);
+            OIC_LOG_V(ERROR, TAG, "\tCould not read from port. Errno is: %d\n", errno);
             return TW_RESULT_ERROR;
         }
     }
@@ -547,7 +547,7 @@ TWResultCode TWStartSock(PIPlugin_Zigbee * plugin, const char * fileLoc)
     ret = TWRetrieveEUI((PIPlugin_Zigbee *)plugin, sock);
     if(ret != TW_RESULT_OK)
     {
-        OC_LOG(ERROR, TAG, "Unable to retrieve Zigbee Radio's EUI.");
+        OIC_LOG(ERROR, TAG, "Unable to retrieve Zigbee Radio's EUI.");
         return ret;
     }
 
@@ -557,7 +557,7 @@ TWResultCode TWStartSock(PIPlugin_Zigbee * plugin, const char * fileLoc)
                                 (void *) plugin);
     if(result != 0)
     {
-        OC_LOG_V(ERROR, TAG, "Thread start failed with error %d", result);
+        OIC_LOG_V(ERROR, TAG, "Thread start failed with error %d", result);
         ret = TW_RESULT_ERROR;
         goto exit;
     }
@@ -574,8 +574,8 @@ static void sigHandler(int signal)
     pthread_t tid = pthread_self();
     (void)tid;
     (void)signal;
-    OC_LOG_V(INFO, TAG, "Received signal on thread: %lu\n", tid);
-    OC_LOG_V(INFO, TAG, "Signal is: %d", signal);
+    OIC_LOG_V(INFO, TAG, "Received signal on thread: %lu\n", tid);
+    OIC_LOG_V(INFO, TAG, "Signal is: %d", signal);
 }
 
 void * readForever(/*PIPlugin*/ void * plugin)
@@ -585,13 +585,13 @@ void * readForever(/*PIPlugin*/ void * plugin)
     TWSock * twSock = TWGetSock((PIPlugin_Zigbee *)plugin);
     if(!twSock)
     {
-        OC_LOG(ERROR, TAG, "Unable to retrieve associated socket.");
+        OIC_LOG(ERROR, TAG, "Unable to retrieve associated socket.");
         return NULL;
     }
 
     pthread_t tid = pthread_self();
     (void)tid;
-    OC_LOG_V(INFO, TAG, "ReadForever Telegesis ThreadId: %lu", tid);
+    OIC_LOG_V(INFO, TAG, "ReadForever Telegesis ThreadId: %lu", tid);
 
     struct sigaction action = { .sa_handler = 0 };
 
@@ -625,13 +625,13 @@ void * readForever(/*PIPlugin*/ void * plugin)
                 }
                 // Notify other threads waiting for a response that the stack is going down.
                 pthread_cond_signal(&twSock->queueCV);
-                OC_LOG(DEBUG, TAG, "Thread has been joined. Exiting thread.");
+                OIC_LOG(DEBUG, TAG, "Thread has been joined. Exiting thread.");
                 pthread_exit(PTHREAD_CANCELED);
                 return NULL;
             }
             else
             {
-                OC_LOG_V(ERROR, TAG, "Unaccounted error occurred. Exiting thread."
+                OIC_LOG_V(ERROR, TAG, "Unaccounted error occurred. Exiting thread."
                                      "Errno is: %d", errno);
                 return NULL;
             }
@@ -648,7 +648,7 @@ void * readForever(/*PIPlugin*/ void * plugin)
                     result = TWGrabMutex(&twSock->mutex);
                     if(result != TW_RESULT_OK)
                     {
-                        OC_LOG(ERROR, TAG, "Unable to grab mutex.");
+                        OIC_LOG(ERROR, TAG, "Unable to grab mutex.");
                         return NULL;
                     }
                     haveMutex = true;
@@ -659,7 +659,7 @@ void * readForever(/*PIPlugin*/ void * plugin)
                     result = TWReleaseMutex(&twSock->mutex);
                     if(result != TW_RESULT_OK)
                     {
-                        OC_LOG(ERROR, TAG, "Unable to release mutex.");
+                        OIC_LOG(ERROR, TAG, "Unable to release mutex.");
                         return NULL;
                     }
                     haveMutex = false;
@@ -670,7 +670,7 @@ void * readForever(/*PIPlugin*/ void * plugin)
                 result = TWEnqueueEntry((PIPlugin_Zigbee *)plugin, entry);
                 if(result != TW_RESULT_OK)
                 {
-                    OC_LOG_V(ERROR, TAG, "Could not add TWEntry to queue for"
+                    OIC_LOG_V(ERROR, TAG, "Could not add TWEntry to queue for"
                                           "consumption by the application"
                                           "layer. Error is: %d", result);
                     TWDeleteEntry((PIPlugin_Zigbee *)plugin, entry);
@@ -701,7 +701,7 @@ TWResultCode TWIssueATCommand(PIPlugin_Zigbee * plugin, const char * command)
     {
         return TW_RESULT_ERROR_INVALID_PARAMS;
     }
-    OC_LOG_V(INFO, TAG, "Attempt to write %s.", command);
+    OIC_LOG_V(INFO, TAG, "Attempt to write %s.", command);
     TWSock * twSock = TWGetSock(plugin);
     if(!twSock)
     {
@@ -743,13 +743,13 @@ TWResultCode TWIssueATCommand(PIPlugin_Zigbee * plugin, const char * command)
     size_t actualWrittenBytes = write(twSock->fd, sendCommand, expectedWrittenBytes);
     if(actualWrittenBytes <= 0)
     {
-        OC_LOG_V(ERROR, TAG, "Could not write to port. Errno is: %d\n", errno);
+        OIC_LOG_V(ERROR, TAG, "Could not write to port. Errno is: %d\n", errno);
         result =  TW_RESULT_ERROR;
         goto exit;
     }
     if(actualWrittenBytes != expectedWrittenBytes)
     {
-        OC_LOG(ERROR, TAG, "Telegesis Adapter did not receive expected command. Unknown state.");
+        OIC_LOG(ERROR, TAG, "Telegesis Adapter did not receive expected command. Unknown state.");
         result = TW_RESULT_ERROR;
     }
 
@@ -912,7 +912,7 @@ TWResultCode TWDeleteEntry(PIPlugin_Zigbee * plugin, TWEntry * entry)
     {
         if(out == entry)
         {
-            OC_LOG(ERROR, TAG, "Tried to delete an entry that is still in the queue. \
+            OIC_LOG(ERROR, TAG, "Tried to delete an entry that is still in the queue. \
                                 Please dequeue the entry first.");
             return TW_RESULT_ERROR;
         }
@@ -985,16 +985,16 @@ TWResultCode TWStopSock(PIPlugin_Zigbee * plugin)
         switch(pthreadRet)
         {
             case EDEADLK:
-                OC_LOG(ERROR, TAG, "A deadlock has occurred.");
+                OIC_LOG(ERROR, TAG, "A deadlock has occurred.");
                 break;
             case EINVAL:
-                OC_LOG(ERROR, TAG, "Thread is not joinable or another thread has already joined.");
+                OIC_LOG(ERROR, TAG, "Thread is not joinable or another thread has already joined.");
                 break;
             case ESRCH:
-                OC_LOG(ERROR, TAG, "No thread with the ID could be found.");
+                OIC_LOG(ERROR, TAG, "No thread with the ID could be found.");
                 break;
             default:
-                OC_LOG_V(ERROR, TAG, "Unknown error occurred when joining thread: %d", pthreadRet);
+                OIC_LOG_V(ERROR, TAG, "Unknown error occurred when joining thread: %d", pthreadRet);
         }
         return TW_RESULT_ERROR;
     }
index 6367bca..08728ef 100644 (file)
@@ -264,7 +264,7 @@ void InitializeContext(TWContext* context)
 /*****************************************************************************/
 OCStackResult TWInitialize(PIPlugin_Zigbee* plugin, const char* deviceDevPath)
 {
-    OC_LOG(INFO, TAG, "Enter TWInitialize()");
+    OIC_LOG(INFO, TAG, "Enter TWInitialize()");
 
     TWResultCode twCode = TW_RESULT_ERROR;
 
@@ -296,12 +296,12 @@ OCStackResult TWInitialize(PIPlugin_Zigbee* plugin, const char* deviceDevPath)
     ctx->g_plugin = plugin;
     ctx->g_port = deviceDevPath;
 
-    OC_LOG_V(INFO, TAG, "Attempt to open %s", deviceDevPath);
+    OIC_LOG_V(INFO, TAG, "Attempt to open %s", deviceDevPath);
 
     twCode = TWStartSock(ctx->g_plugin, deviceDevPath);  //TODO:
     if (twCode != TW_RESULT_OK)
     {
-        OC_LOG_V(ERROR, TAG, "Failed to open %s because of error: %d", deviceDevPath, twCode);
+        OIC_LOG_V(ERROR, TAG, "Failed to open %s because of error: %d", deviceDevPath, twCode);
         OICFree(ctx);
         return OC_STACK_ERROR;
     }
@@ -310,12 +310,12 @@ OCStackResult TWInitialize(PIPlugin_Zigbee* plugin, const char* deviceDevPath)
     twCode = TWGetEUI(ctx->g_plugin, &eui);
     if (twCode != TW_RESULT_OK)
     {
-        OC_LOG_V(ERROR, TAG, "Failed to get EUI because of error: %d", twCode);
+        OIC_LOG_V(ERROR, TAG, "Failed to get EUI because of error: %d", twCode);
         OICFree(ctx);
         return OC_STACK_ERROR;
     }
     OICStrcpy(ctx->g_LocalEUI, sizeof(ctx->g_LocalEUI), eui);
-    OC_LOG_V(INFO, TAG, "LocalEUI=%s", ctx->g_LocalEUI);
+    OIC_LOG_V(INFO, TAG, "LocalEUI=%s", ctx->g_LocalEUI);
     OICFree(eui);
 
     bool wantReset = false;     //TODO:
@@ -324,7 +324,7 @@ OCStackResult TWInitialize(PIPlugin_Zigbee* plugin, const char* deviceDevPath)
         twCode = Reset(ctx);
         if (twCode != TW_RESULT_OK)
         {
-            OC_LOG(ERROR, TAG, "ZigBee Initialization - Reset");
+            OIC_LOG(ERROR, TAG, "ZigBee Initialization - Reset");
             OICFree(ctx);
             return OC_STACK_ERROR;
         }
@@ -333,16 +333,16 @@ OCStackResult TWInitialize(PIPlugin_Zigbee* plugin, const char* deviceDevPath)
     twCode = CreatePAN(ctx);
     if (twCode != TW_RESULT_OK)
     {
-        OC_LOG(ERROR, TAG, "CreatePan Failed");
-        OC_LOG(ERROR, TAG, "TWInitialize() - MUST STOP NOW");
+        OIC_LOG(ERROR, TAG, "CreatePan Failed");
+        OIC_LOG(ERROR, TAG, "TWInitialize() - MUST STOP NOW");
         ctx->g_ZigBeeStatus.state = ZB_STATE_UNKNOWN;
         OICFree(ctx);
         return OC_STACK_ERROR;
     }
     else
     {
-        OC_LOG(INFO, TAG, "CreatePan Succeed");
-        OC_LOG(INFO, TAG, "TWInitialize() Succeed");
+        OIC_LOG(INFO, TAG, "CreatePan Succeed");
+        OIC_LOG(INFO, TAG, "TWInitialize() Succeed");
         ctx->g_ZigBeeStatus.state = ZB_STATE_INIT;
         LL_APPEND(g_twContextList, ctx);
         return OC_STACK_OK;
@@ -351,7 +351,7 @@ OCStackResult TWInitialize(PIPlugin_Zigbee* plugin, const char* deviceDevPath)
 
 OCStackResult TWDiscover(PIPlugin_Zigbee* plugin)
 {
-    OC_LOG(INFO, TAG, "Enter TWDiscover()");
+    OIC_LOG(INFO, TAG, "Enter TWDiscover()");
 
     OCStackResult ret = OC_STACK_ERROR;
     TWResultCode twRet = TW_RESULT_ERROR;
@@ -359,36 +359,36 @@ OCStackResult TWDiscover(PIPlugin_Zigbee* plugin)
     TWContext* ctx = GetTWContext(plugin);
     if (ctx == NULL)
     {
-        OC_LOG(ERROR, TAG, "Invalid Param");
+        OIC_LOG(ERROR, TAG, "Invalid Param");
         return OC_STACK_INVALID_PARAM;
     }
 
     if (ctx->g_DeviceFoundCallback == NULL)
     {
-        OC_LOG(INFO, TAG, "Required TWDeviceFoundCallback.");
+        OIC_LOG(INFO, TAG, "Required TWDeviceFoundCallback.");
         return OC_STACK_ERROR;
     }
 
     twRet = EnableJoin(false, ctx);
     if (twRet != TW_RESULT_OK)
     {
-        OC_LOG(ERROR, TAG, "EnableJoin");
+        OIC_LOG(ERROR, TAG, "EnableJoin");
         return OC_STACK_ERROR;
     }
 
     twRet = FindMatchNodes(ctx);
     if (twRet == TW_RESULT_OK)
     {
-        OC_LOG(INFO, TAG, "FindMatchNodes");
+        OIC_LOG(INFO, TAG, "FindMatchNodes");
         ret = OC_STACK_OK;
     }
     else
     {
-        OC_LOG(ERROR, TAG, "FindMatchNodes");
+        OIC_LOG(ERROR, TAG, "FindMatchNodes");
         ret = OC_STACK_ERROR;
     }
 
-    OC_LOG_V(INFO, TAG, "Leave TWDiscover() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave TWDiscover() with ret=%d", ret);
     return ret;
 }
 
@@ -398,12 +398,12 @@ OCStackResult TWSetAttribute(char* extendedUniqueId, char* nodeId, char* endpoin
 {
     //Ask:  AT+WRITEATR:5DA7,01,0,0003,0000,21,01
 
-    OC_LOG(INFO, TAG, "Enter TWSetAttribute()");
+    OIC_LOG(INFO, TAG, "Enter TWSetAttribute()");
 
     TWContext* ctx = GetTWContext(plugin);
     if (ctx == NULL)
     {
-        OC_LOG(ERROR, TAG, "Invalid Param");
+        OIC_LOG(ERROR, TAG, "Invalid Param");
         return OC_STACK_INVALID_PARAM;
     }
 
@@ -423,7 +423,7 @@ OCStackResult TWSetAttribute(char* extendedUniqueId, char* nodeId, char* endpoin
     char* cmdString = (char*)OICMalloc(size * sizeof(char));
     if (cmdString == NULL)
     {
-        OC_LOG(ERROR, TAG, "No Memory");
+        OIC_LOG(ERROR, TAG, "No Memory");
         ret = OC_STACK_ERROR;
         goto exit;
     }
@@ -434,23 +434,23 @@ OCStackResult TWSetAttribute(char* extendedUniqueId, char* nodeId, char* endpoin
     twRet = TWIssueATCommand(ctx->g_plugin, cmdString);
     if (twRet != TW_RESULT_OK)
     {
-        OC_LOG_V(ERROR, TAG, "Write %s", cmdString);
+        OIC_LOG_V(ERROR, TAG, "Write %s", cmdString);
         ret = OC_STACK_ERROR;
         goto exit;
     }
-    OC_LOG_V(INFO, TAG, "Write %s", cmdString);
+    OIC_LOG_V(INFO, TAG, "Write %s", cmdString);
 
     TWEntry* entry = NULL;
     twRet = TWDequeueEntry(ctx->g_plugin, &entry, TW_WRITEATTR);
     if (twRet != TW_RESULT_OK)
     {
-        OC_LOG(ERROR, TAG, "TWDequeueEntry");
+        OIC_LOG(ERROR, TAG, "TWDequeueEntry");
         ret = OC_STACK_ERROR;
         goto exit;
     }
     if (entry == NULL)
     {
-        OC_LOG(INFO, TAG, "TWEntry is NULL.");
+        OIC_LOG(INFO, TAG, "TWEntry is NULL.");
         ret = OC_STACK_ERROR;
         goto exit;
     }
@@ -458,13 +458,13 @@ OCStackResult TWSetAttribute(char* extendedUniqueId, char* nodeId, char* endpoin
     twRet = processEntry(entry, ctx);
     if (twRet == TW_RESULT_ERROR_INVALID_OP)
     {
-        OC_LOG_V(INFO, TAG, "Write %s - Invalid Operation", cmdString);
+        OIC_LOG_V(INFO, TAG, "Write %s - Invalid Operation", cmdString);
         ret = OC_STACK_INVALID_OPTION;
         goto exit;
     }
     if (twRet != TW_RESULT_OK)
     {
-        OC_LOG(ERROR, TAG, "processEntry");
+        OIC_LOG(ERROR, TAG, "processEntry");
         ret = OC_STACK_ERROR;
         goto exit;
     }
@@ -474,7 +474,7 @@ OCStackResult TWSetAttribute(char* extendedUniqueId, char* nodeId, char* endpoin
 exit:
     TWDeleteEntry(ctx->g_plugin, entry);
     OICFree(cmdString);
-    OC_LOG_V(INFO, TAG, "Leave TWSetAttribute() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave TWSetAttribute() with ret=%d", ret);
     return ret;
 }
 
@@ -485,7 +485,7 @@ OCStackResult TWGetAttribute(char* extendedUniqueId, char* nodeId, char* endpoin
 {
     //Ask:  AT+READATR:FE5A,01,0,0402,0002
 
-    OC_LOG(INFO, TAG, "Enter TWGetAttribute()");
+    OIC_LOG(INFO, TAG, "Enter TWGetAttribute()");
 
     TWContext* ctx = GetTWContext(plugin);
     if (ctx == NULL)
@@ -507,7 +507,7 @@ OCStackResult TWGetAttribute(char* extendedUniqueId, char* nodeId, char* endpoin
     char* cmdString = (char*)OICMalloc(size * sizeof(char));
     if (cmdString == NULL)
     {
-        OC_LOG(ERROR, TAG, "No Memory");
+        OIC_LOG(ERROR, TAG, "No Memory");
         ret = OC_STACK_NO_MEMORY;
         goto exit;
     }
@@ -519,30 +519,30 @@ OCStackResult TWGetAttribute(char* extendedUniqueId, char* nodeId, char* endpoin
                              SEPARATOR, attributeId);
     if(stringRet <= 0)
     {
-        OC_LOG(ERROR, TAG, "Build command error.");
+        OIC_LOG(ERROR, TAG, "Build command error.");
         ret = OC_STACK_ERROR;
         goto exit;
     }
     twRet = TWIssueATCommand(ctx->g_plugin, cmdString);
     if (twRet != TW_RESULT_OK)
     {
-        OC_LOG_V(ERROR, TAG, "Write %s", cmdString);
+        OIC_LOG_V(ERROR, TAG, "Write %s", cmdString);
         ret = OC_STACK_ERROR;
         goto exit;
     }
-    OC_LOG_V(INFO, TAG, "Write %s", cmdString);
+    OIC_LOG_V(INFO, TAG, "Write %s", cmdString);
 
     TWEntry* entry = NULL;
     twRet = TWDequeueEntry(ctx->g_plugin, &entry, TW_RESPATTR);
     if (twRet != TW_RESULT_OK)
     {
-        OC_LOG(ERROR, TAG, "TWDequeueEntry");
+        OIC_LOG(ERROR, TAG, "TWDequeueEntry");
         ret = OC_STACK_ERROR;
         goto exit;
     }
     if (entry == NULL)
     {
-        OC_LOG(INFO, TAG, "TWEntry is NULL");
+        OIC_LOG(INFO, TAG, "TWEntry is NULL");
         ret = OC_STACK_ERROR;
         goto exit;
     }
@@ -550,7 +550,7 @@ OCStackResult TWGetAttribute(char* extendedUniqueId, char* nodeId, char* endpoin
     twRet = processEntry(entry, ctx);
     if (twRet != TW_RESULT_REMOTE_ATTR_HAS_VALUE)
     {
-        OC_LOG(ERROR, TAG, "processEntry.");
+        OIC_LOG(ERROR, TAG, "processEntry.");
         ret = OC_STACK_ERROR;
         goto exit;
     }
@@ -559,7 +559,7 @@ OCStackResult TWGetAttribute(char* extendedUniqueId, char* nodeId, char* endpoin
     *outValue = (char*)OICMalloc(sizeof(char) * size);
     if (*outValue == NULL)
     {
-        OC_LOG(ERROR, TAG, "No Memory");
+        OIC_LOG(ERROR, TAG, "No Memory");
         ret = OC_STACK_NO_MEMORY;
         goto exit;
     }
@@ -569,13 +569,13 @@ OCStackResult TWGetAttribute(char* extendedUniqueId, char* nodeId, char* endpoin
     OICFree(ctx->g_ZigBeeStatus.remoteAttributeValueRead);
     ctx->g_ZigBeeStatus.remoteAttributeValueRead = NULL;
     ctx->g_ZigBeeStatus.remoteAtrributeValueReadLength = 0;
-    OC_LOG(INFO, TAG, "TWGetAttribute() gets an attribute value.");
+    OIC_LOG(INFO, TAG, "TWGetAttribute() gets an attribute value.");
     ret = OC_STACK_OK;
 
 exit:
     TWDeleteEntry(ctx->g_plugin, entry);
     OICFree(cmdString);
-    OC_LOG_V(INFO, TAG, "Leave TWGetAttribute() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave TWGetAttribute() with ret=%d", ret);
     return ret;
 }
 
@@ -587,12 +587,12 @@ OCStackResult TWSwitchOnOff(char* nodeId, char* endpointId, char* newState,
     //      OK
     //      DFTREP:9E2B,01,0006,01,00
 
-    OC_LOG(INFO, TAG, "Enter TWSwitchOnOff()");
+    OIC_LOG(INFO, TAG, "Enter TWSwitchOnOff()");
 
     TWContext* ctx = GetTWContext(plugin);
     if (ctx == NULL)
     {
-        OC_LOG(ERROR, TAG, "Invalid Param");
+        OIC_LOG(ERROR, TAG, "Invalid Param");
         return OC_STACK_INVALID_PARAM;
     }
 
@@ -617,7 +617,7 @@ OCStackResult TWSwitchOnOff(char* nodeId, char* endpointId, char* newState,
     char* cmdString = (char*)OICMalloc(size * sizeof(char));
     if (cmdString == NULL)
     {
-        OC_LOG(ERROR, TAG, "No Memory");
+        OIC_LOG(ERROR, TAG, "No Memory");
         ret = OC_STACK_NO_MEMORY;
         goto exit;
     }
@@ -627,7 +627,7 @@ OCStackResult TWSwitchOnOff(char* nodeId, char* endpointId, char* newState,
                              endpointId, SEPARATOR, SENDMODE);
     if(stringRet <= 0)
     {
-        OC_LOG(ERROR, TAG, "Build command error.");
+        OIC_LOG(ERROR, TAG, "Build command error.");
         ret = OC_STACK_ERROR;
         goto exit;
     }
@@ -640,23 +640,23 @@ OCStackResult TWSwitchOnOff(char* nodeId, char* endpointId, char* newState,
     twRet = TWIssueATCommand(ctx->g_plugin, cmdString);
     if (twRet != TW_RESULT_OK)
     {
-        OC_LOG_V(ERROR, TAG, "Write %s", cmdString);
+        OIC_LOG_V(ERROR, TAG, "Write %s", cmdString);
         ret = OC_STACK_ERROR;
         goto exit;
     }
-    OC_LOG_V(INFO, TAG, "Write %s", cmdString);
+    OIC_LOG_V(INFO, TAG, "Write %s", cmdString);
 
     TWEntry* entry = NULL;
     twRet = TWDequeueEntry(ctx->g_plugin, &entry, TW_DFTREP);
     if (twRet != TW_RESULT_OK)
     {
-        OC_LOG(ERROR, TAG, "TWDequeueEntry");
+        OIC_LOG(ERROR, TAG, "TWDequeueEntry");
         ret = OC_STACK_ERROR;
         goto exit;
     }
     if (entry == NULL)
     {
-        OC_LOG(ERROR, TAG, "TWEntry is NULL");
+        OIC_LOG(ERROR, TAG, "TWEntry is NULL");
         ret = OC_STACK_ERROR;
         goto exit;
     }
@@ -664,7 +664,7 @@ OCStackResult TWSwitchOnOff(char* nodeId, char* endpointId, char* newState,
     twRet = processEntry(entry, ctx);
     if (twRet != TW_RESULT_OK)
     {
-        OC_LOG_V(ERROR, TAG, "processEntry - %s", cmdString);
+        OIC_LOG_V(ERROR, TAG, "processEntry - %s", cmdString);
         ret = OC_STACK_ERROR;
         goto exit;
     }
@@ -674,7 +674,7 @@ OCStackResult TWSwitchOnOff(char* nodeId, char* endpointId, char* newState,
 exit:
     TWDeleteEntry(ctx->g_plugin, entry);
     OICFree(cmdString);
-    OC_LOG_V(INFO, TAG, "Leave TWSwitchOnOff() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave TWSwitchOnOff() with ret=%d", ret);
     return ret;
 }
 
@@ -684,12 +684,12 @@ OCStackResult TWMoveToLevel(char* nodeId, char* endpointId,
 {
     //AT+LCMVTOLEV:<Address>,<EP>,<SendMode>,<ON/OFF>,<LevelValue>,<TransTime>
 
-    OC_LOG(INFO, TAG, "Enter TWMoveToLevel()");
+    OIC_LOG(INFO, TAG, "Enter TWMoveToLevel()");
 
     TWContext* ctx = GetTWContext(plugin);
     if (ctx == NULL)
     {
-        OC_LOG(ERROR, TAG, "Invalid Param");
+        OIC_LOG(ERROR, TAG, "Invalid Param");
         return OC_STACK_INVALID_PARAM;
     }
 
@@ -707,7 +707,7 @@ OCStackResult TWMoveToLevel(char* nodeId, char* endpointId,
     char* cmdString = (char*)OICMalloc(size * sizeof(char));
     if (cmdString == NULL)
     {
-        OC_LOG(ERROR, TAG, "No Memory");
+        OIC_LOG(ERROR, TAG, "No Memory");
         ret = OC_STACK_NO_MEMORY;
         goto exit;
     }
@@ -721,7 +721,7 @@ OCStackResult TWMoveToLevel(char* nodeId, char* endpointId,
                              SEPARATOR, transTime);
     if(stringRet <= 0)
     {
-        OC_LOG(ERROR, TAG, "Build command error.");
+        OIC_LOG(ERROR, TAG, "Build command error.");
         ret = OC_STACK_ERROR;
         goto exit;
     }
@@ -729,24 +729,24 @@ OCStackResult TWMoveToLevel(char* nodeId, char* endpointId,
     twRet = TWIssueATCommand(ctx->g_plugin, cmdString);
     if (twRet != TW_RESULT_OK)
     {
-        OC_LOG_V(ERROR, TAG, "Write %s", cmdString);
+        OIC_LOG_V(ERROR, TAG, "Write %s", cmdString);
         ret = OC_STACK_ERROR;
         goto exit;
     }
 
-    OC_LOG_V(INFO, TAG, "Write %s", cmdString);
+    OIC_LOG_V(INFO, TAG, "Write %s", cmdString);
 
     TWEntry* entry = NULL;
     twRet = TWDequeueEntry(ctx->g_plugin, &entry, TW_DFTREP);
     if (twRet != TW_RESULT_OK)
     {
-        OC_LOG(ERROR, TAG, "TWDequeueEntry");
+        OIC_LOG(ERROR, TAG, "TWDequeueEntry");
         ret = OC_STACK_ERROR;
         goto exit;
     }
     if (entry == NULL)
     {
-        OC_LOG(ERROR, TAG, "TWEntry is NULL");
+        OIC_LOG(ERROR, TAG, "TWEntry is NULL");
         ret = OC_STACK_ERROR;
         goto exit;
     }
@@ -754,7 +754,7 @@ OCStackResult TWMoveToLevel(char* nodeId, char* endpointId,
     twRet = processEntry(entry, ctx);
     if (twRet != TW_RESULT_OK)
     {
-        OC_LOG_V(ERROR, TAG, "processEntry - %s", cmdString);
+        OIC_LOG_V(ERROR, TAG, "processEntry - %s", cmdString);
         ret = OC_STACK_ERROR;
         goto exit;
     }
@@ -764,7 +764,7 @@ OCStackResult TWMoveToLevel(char* nodeId, char* endpointId,
 exit:
     TWDeleteEntry(ctx->g_plugin, entry);
     OICFree(cmdString);
-    OC_LOG_V(INFO, TAG, "Leave TWMoveToLevel() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave TWMoveToLevel() with ret=%d", ret);
     return ret;
 }
 
@@ -773,12 +773,12 @@ OCStackResult TWSwitchDoorLockState(char* nodeId, char* endpointId, char* newSta
 {
     //AT+DRLOCK:<Address>,<EP>,<SendMode>,<Lock/Unlock>
 
-    OC_LOG(INFO, TAG, "Enter TWSwitchDoorLockState()");
+    OIC_LOG(INFO, TAG, "Enter TWSwitchDoorLockState()");
 
     TWContext* ctx = GetTWContext(plugin);
     if (ctx == NULL)
     {
-        OC_LOG(ERROR, TAG, "Invalid Param");
+        OIC_LOG(ERROR, TAG, "Invalid Param");
         return OC_STACK_INVALID_PARAM;
     }
 
@@ -794,7 +794,7 @@ OCStackResult TWSwitchDoorLockState(char* nodeId, char* endpointId, char* newSta
     char* cmdString = (char*)OICMalloc(size * sizeof(char));
     if (cmdString == NULL)
     {
-        OC_LOG(ERROR, TAG, "No Memory");
+        OIC_LOG(ERROR, TAG, "No Memory");
         ret = OC_STACK_NO_MEMORY;
         goto exit;
     }
@@ -806,7 +806,7 @@ OCStackResult TWSwitchDoorLockState(char* nodeId, char* endpointId, char* newSta
                              SEPARATOR, newState);
     if(stringRet <= 0)
     {
-        OC_LOG(ERROR, TAG, "Build command error.");
+        OIC_LOG(ERROR, TAG, "Build command error.");
         ret = OC_STACK_ERROR;
         goto exit;
     }
@@ -814,25 +814,25 @@ OCStackResult TWSwitchDoorLockState(char* nodeId, char* endpointId, char* newSta
     twRet = TWIssueATCommand(ctx->g_plugin, cmdString);
     if (twRet != TW_RESULT_OK)
     {
-        OC_LOG_V(ERROR, TAG, "Write %s", cmdString);
+        OIC_LOG_V(ERROR, TAG, "Write %s", cmdString);
         ret = OC_STACK_ERROR;
         goto exit;
     }
 
-    OC_LOG_V(INFO, TAG, "Write %s", cmdString);
+    OIC_LOG_V(INFO, TAG, "Write %s", cmdString);
 
     TWEntry* entry = NULL;
     twRet = TWDequeueEntry(ctx->g_plugin, &entry, TW_DFTREP);
     if (twRet != TW_RESULT_OK)
     {
-        OC_LOG(ERROR, TAG, "TWDequeueEntry");
+        OIC_LOG(ERROR, TAG, "TWDequeueEntry");
         ret = OC_STACK_ERROR;
         goto exit;
     }
 
     if (entry == NULL)
     {
-        OC_LOG(ERROR, TAG, "TWEntry is NULL");
+        OIC_LOG(ERROR, TAG, "TWEntry is NULL");
         ret = OC_STACK_ERROR;
         goto exit;
     }
@@ -840,7 +840,7 @@ OCStackResult TWSwitchDoorLockState(char* nodeId, char* endpointId, char* newSta
     twRet = processEntry(entry, ctx);
     if (twRet != TW_RESULT_OK)
     {
-        OC_LOG_V(ERROR, TAG, "processEntry - %s", cmdString);
+        OIC_LOG_V(ERROR, TAG, "processEntry - %s", cmdString);
         ret = OC_STACK_ERROR;
         goto exit;
     }
@@ -850,7 +850,7 @@ OCStackResult TWSwitchDoorLockState(char* nodeId, char* endpointId, char* newSta
 exit:
     TWDeleteEntry(ctx->g_plugin, entry);
     OICFree(cmdString);
-    OC_LOG_V(INFO, TAG, "Leave TWSwitchDoorLockState() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave TWSwitchDoorLockState() with ret=%d", ret);
     return ret;
 }
 
@@ -863,12 +863,12 @@ OCStackResult TWColorMoveToColorTemperature(char* nodeId, char* endpointId,
     //  OK
     //  ERROR:<errorcode>
 
-    OC_LOG(INFO, TAG, "Enter TWColorMoveToColorTemperature()");
+    OIC_LOG(INFO, TAG, "Enter TWColorMoveToColorTemperature()");
 
     TWContext* ctx = GetTWContext(plugin);
     if (ctx == NULL)
     {
-        OC_LOG(ERROR, TAG, "Invalid Param");
+        OIC_LOG(ERROR, TAG, "Invalid Param");
         return OC_STACK_INVALID_PARAM;
     }
 
@@ -885,7 +885,7 @@ OCStackResult TWColorMoveToColorTemperature(char* nodeId, char* endpointId,
     char* cmdString = (char*)OICMalloc(size * sizeof(char));
     if (cmdString == NULL)
     {
-        OC_LOG(ERROR, TAG, "No Memory");
+        OIC_LOG(ERROR, TAG, "No Memory");
         ret = OC_STACK_NO_MEMORY;
         goto exit;
     }
@@ -898,30 +898,30 @@ OCStackResult TWColorMoveToColorTemperature(char* nodeId, char* endpointId,
                              SEPARATOR, transTime);
     if(stringRet <= 0)
     {
-        OC_LOG(ERROR, TAG, "Build command error.");
+        OIC_LOG(ERROR, TAG, "Build command error.");
         ret = OC_STACK_ERROR;
         goto exit;
     }
     twRet = TWIssueATCommand(ctx->g_plugin, cmdString);
     if (twRet != TW_RESULT_OK)
     {
-        OC_LOG_V(ERROR, TAG, "Write %s", cmdString);
+        OIC_LOG_V(ERROR, TAG, "Write %s", cmdString);
         ret = OC_STACK_ERROR;
         goto exit;
     }
-    OC_LOG_V(INFO, TAG, "Write %s", cmdString);
+    OIC_LOG_V(INFO, TAG, "Write %s", cmdString);
 
     TWEntry* entry = NULL;
     twRet = TWDequeueEntry(ctx->g_plugin, &entry, TW_DFTREP);
     if (twRet != TW_RESULT_OK)
     {
-        OC_LOG_V(ERROR, TAG, "TWDequeueEntry - %s", cmdString);
+        OIC_LOG_V(ERROR, TAG, "TWDequeueEntry - %s", cmdString);
         ret = OC_STACK_ERROR;
         goto exit;
     }
     if (entry == NULL)
     {
-        OC_LOG_V(ERROR, TAG, "TWEntry is NULL - %s", cmdString);
+        OIC_LOG_V(ERROR, TAG, "TWEntry is NULL - %s", cmdString);
         ret = OC_STACK_ERROR;
         goto exit;
     }
@@ -929,7 +929,7 @@ OCStackResult TWColorMoveToColorTemperature(char* nodeId, char* endpointId,
     twRet = processEntry(entry, ctx);
     if (twRet != TW_RESULT_OK)
     {
-        OC_LOG_V(ERROR, TAG, "processEntry - %s", cmdString);
+        OIC_LOG_V(ERROR, TAG, "processEntry - %s", cmdString);
         ret = OC_STACK_ERROR;
         goto exit;
     }
@@ -939,13 +939,13 @@ OCStackResult TWColorMoveToColorTemperature(char* nodeId, char* endpointId,
 exit:
     TWDeleteEntry(ctx->g_plugin, entry);
     OICFree(cmdString);
-    OC_LOG_V(INFO, TAG, "Leave TWColorMoveToColorTemperature() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave TWColorMoveToColorTemperature() with ret=%d", ret);
     return ret;
 }
 
 OCStackResult TWSetDiscoveryCallback(const TWDeviceFoundCallback callback, PIPlugin_Zigbee* plugin)
 {
-    OC_LOG(INFO, TAG, "Enter TWSetDiscoveryCallback()");
+    OIC_LOG(INFO, TAG, "Enter TWSetDiscoveryCallback()");
 
     OCStackResult ret = OC_STACK_OK;
 
@@ -966,14 +966,14 @@ OCStackResult TWSetDiscoveryCallback(const TWDeviceFoundCallback callback, PIPlu
         }
     }
 
-    OC_LOG_V(INFO, TAG, "Leave TWSetDiscoveryCallback() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave TWSetDiscoveryCallback() with ret=%d", ret);
     return ret;
 }
 
 OCStackResult TWSetEndDeviceNodeIdChangedCallback(TWDeviceNodeIdChangedCallback callback,
                                                   PIPlugin_Zigbee* plugin)
 {
-    OC_LOG(INFO, TAG, "Enter TWSetEndDeviceNodeIdChangedCallback()");
+    OIC_LOG(INFO, TAG, "Enter TWSetEndDeviceNodeIdChangedCallback()");
 
     OCStackResult ret = OC_STACK_OK;
 
@@ -993,14 +993,14 @@ OCStackResult TWSetEndDeviceNodeIdChangedCallback(TWDeviceNodeIdChangedCallback
             ctx->g_EndDeviceNodeIdChangedCallback = NULL;
         }
     }
-    OC_LOG_V(INFO, TAG, "Leave TWSetEndDeviceNodeIdChangedCallback() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave TWSetEndDeviceNodeIdChangedCallback() with ret=%d", ret);
     return ret;
 }
 
 OCStackResult TWSetStatusUpdateCallback(TWDeviceStatusUpdateCallback callback,
                                         PIPlugin_Zigbee* plugin)
 {
-    OC_LOG(INFO, TAG, "Enter TWSetStatusUpdateCallback()");
+    OIC_LOG(INFO, TAG, "Enter TWSetStatusUpdateCallback()");
 
     OCStackResult ret = OC_STACK_OK;
 
@@ -1021,13 +1021,13 @@ OCStackResult TWSetStatusUpdateCallback(TWDeviceStatusUpdateCallback callback,
         }
     }
 
-    OC_LOG_V(INFO, TAG, "Leave TWSetStatusUpdateCallback() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave TWSetStatusUpdateCallback() with ret=%d", ret);
     return ret;
 }
 
 OCStackResult TWListenForStatusUpdates(char* nodeId, char* endpointId, PIPlugin_Zigbee* plugin)
 {
-    OC_LOG(INFO, TAG, "Enter TWListenForStatusUpdates()");
+    OIC_LOG(INFO, TAG, "Enter TWListenForStatusUpdates()");
 
     OCStackResult ret = OC_STACK_OK;
 
@@ -1048,11 +1048,11 @@ OCStackResult TWListenForStatusUpdates(char* nodeId, char* endpointId, PIPlugin_
 
         if (ret == OC_STACK_INVALID_OPTION)
         {
-            OC_LOG(INFO, TAG, "Already registered for ZoneStatusUpdate");
+            OIC_LOG(INFO, TAG, "Already registered for ZoneStatusUpdate");
             ret = OC_STACK_OK;
         }
     }
-    OC_LOG_V(INFO, TAG, "Leave TWListenForStatusUpdates() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave TWListenForStatusUpdates() with ret=%d", ret);
     return ret;
 }
 
@@ -1076,7 +1076,7 @@ OCStackResult TWProcess(PIPlugin_Zigbee* plugin)
         ret = TWDequeueEntry(ctx->g_plugin, &entry, TW_NONE);
         if (ret != TW_RESULT_OK)
         {
-            OC_LOG(ERROR, TAG, "TWDequeueEntry");
+            OIC_LOG(ERROR, TAG, "TWDequeueEntry");
             ret = OC_STACK_ERROR;
             break;
         }
@@ -1089,22 +1089,22 @@ OCStackResult TWProcess(PIPlugin_Zigbee* plugin)
         ret = processEntry(entry, ctx);
         if (ret != TW_RESULT_OK)
         {
-            OC_LOG(ERROR, TAG, "processEntry");
+            OIC_LOG(ERROR, TAG, "processEntry");
             ret = TWDeleteEntry(ctx->g_plugin, entry);
             if(ret != TW_RESULT_OK)
             {
-                OC_LOG(ERROR, TAG, "Failed to delete entry.");
+                OIC_LOG(ERROR, TAG, "Failed to delete entry.");
                 ret = OC_STACK_ERROR;
                 break;
             }
         }
         else
         {
-            OC_LOG(INFO, TAG, "processEntry");
+            OIC_LOG(INFO, TAG, "processEntry");
             ret = TWDeleteEntry(ctx->g_plugin, entry);
             if(ret != TW_RESULT_OK)
             {
-                OC_LOG(ERROR, TAG, "Failed to delete entry.");
+                OIC_LOG(ERROR, TAG, "Failed to delete entry.");
                 ret = OC_STACK_ERROR;
                 break;
             }
@@ -1116,7 +1116,7 @@ OCStackResult TWProcess(PIPlugin_Zigbee* plugin)
 
 OCStackResult TWUninitialize(PIPlugin_Zigbee* plugin)
 {
-    OC_LOG(INFO, TAG, "Enter TWUninitializeZigBee()");
+    OIC_LOG(INFO, TAG, "Enter TWUninitializeZigBee()");
     OCStackResult ret = OC_STACK_ERROR;
 
     TWContext* ctx = GetTWContext(plugin);
@@ -1129,12 +1129,12 @@ OCStackResult TWUninitialize(PIPlugin_Zigbee* plugin)
         TWResultCode twRet = TWStopSock(ctx->g_plugin);
         if (twRet == TW_RESULT_OK)
         {
-            OC_LOG(INFO, TAG, "TWStopSock");
+            OIC_LOG(INFO, TAG, "TWStopSock");
             ret = OC_STACK_OK;
         }
         else
         {
-            OC_LOG(ERROR, TAG, "TWStopSock");
+            OIC_LOG(ERROR, TAG, "TWStopSock");
             ret = OC_STACK_ERROR;
         }
         DeallocateTWDeviceList(ctx);
@@ -1143,7 +1143,7 @@ OCStackResult TWUninitialize(PIPlugin_Zigbee* plugin)
         OICFree(ctx);
     }
 
-    OC_LOG_V(INFO, TAG, "Leave TWUninitializeZigBee() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave TWUninitializeZigBee() with ret=%d", ret);
     return ret;
 }
 
@@ -1153,7 +1153,7 @@ OCStackResult TWUninitialize(PIPlugin_Zigbee* plugin)
 
 TWResultCode processEntry(TWEntry *entry, TWContext* ctx)
 {
-    OC_LOG(INFO, TAG, "Enter processEntry()");
+    OIC_LOG(INFO, TAG, "Enter processEntry()");
 
     TWResultCode ret = TW_RESULT_UNKNOWN;
     switch(entry->type)
@@ -1163,139 +1163,139 @@ TWResultCode processEntry(TWEntry *entry, TWContext* ctx)
             if ((ret != TW_RESULT_NO_LOCAL_PAN) &&
                 (ret != TW_RESULT_HAS_LOCAL_PAN))
             {
-                OC_LOG(ERROR, TAG, "processEntryNETWORK_INFO.");
+                OIC_LOG(ERROR, TAG, "processEntryNETWORK_INFO.");
             }
             break;
         case TW_JPAN:
             ret = processEntryJPAN(entry, ctx);
             if (ret != TW_RESULT_OK)
             {
-                OC_LOG(ERROR, TAG, "processEntryJPAN.");
+                OIC_LOG(ERROR, TAG, "processEntryJPAN.");
             }
             break;
         case TW_SED:
             ret = processEntryEndDevice(entry, ctx);
             if (ret != TW_RESULT_OK)
             {
-                OC_LOG(ERROR, TAG, "processEntrySED.");
+                OIC_LOG(ERROR, TAG, "processEntrySED.");
             }
             break;
         case TW_RFD:
             ret = processEntryEndDevice(entry, ctx);
             if (ret != TW_RESULT_OK)
             {
-                OC_LOG(ERROR, TAG, "processEntryRFD.");
+                OIC_LOG(ERROR, TAG, "processEntryRFD.");
             }
             break;
         case TW_FFD:
             ret = processEntryEndDevice(entry, ctx);
             if (ret != TW_RESULT_OK)
             {
-                OC_LOG(ERROR, TAG, "processEntryFFD.");
+                OIC_LOG(ERROR, TAG, "processEntryFFD.");
             }
             break;
         case TW_ZED:
             ret = processEntryEndDevice(entry, ctx);
             if (ret != TW_RESULT_OK)
             {
-                OC_LOG(ERROR, TAG, "processEntryZED.");
+                OIC_LOG(ERROR, TAG, "processEntryZED.");
             }
             break;
         case TW_MATCHDESC:
             ret = processEntryMatchDesc(entry, ctx);
             if (ret != TW_RESULT_OK)
             {
-                OC_LOG(ERROR, TAG, "processEntryMatchDesc.");
+                OIC_LOG(ERROR, TAG, "processEntryMatchDesc.");
             }
             break;
         case TW_SIMPLEDESC:
             ret = processEntrySimpleDesc(entry, ctx);
             if (ret != TW_RESULT_OK)
             {
-                OC_LOG(ERROR, TAG, "processEntrySimpleDesc.");
+                OIC_LOG(ERROR, TAG, "processEntrySimpleDesc.");
             }
             break;
         case TW_WRITEATTR:
             ret = processEntryWriteAttr(entry, ctx);
             if (ret == TW_RESULT_ERROR_INVALID_OP)
             {
-               OC_LOG_V(INFO, TAG, "processEntryWriteAttr - ret=%d", TW_RESULT_ERROR_INVALID_OP);
+               OIC_LOG_V(INFO, TAG, "processEntryWriteAttr - ret=%d", TW_RESULT_ERROR_INVALID_OP);
             }
             else if (ret != TW_RESULT_OK)
             {
-                OC_LOG(ERROR, TAG, "processEntryWriteAttr.");
+                OIC_LOG(ERROR, TAG, "processEntryWriteAttr.");
             }
             break;
         case TW_RESPATTR:
             ret = processEntryReadAttr(entry, ctx);
             if (ret != TW_RESULT_REMOTE_ATTR_HAS_VALUE)
             {
-                OC_LOG(ERROR, TAG, "processEntryReadAttr.");
+                OIC_LOG(ERROR, TAG, "processEntryReadAttr.");
             }
             break;
         case TW_TEMPERATURE:
             ret = processEntryTemperature(entry, ctx);
             if (ret != TW_RESULT_REMOTE_ATTR_HAS_VALUE)
             {
-                OC_LOG(ERROR, TAG, "processEntryTemperature.");
+                OIC_LOG(ERROR, TAG, "processEntryTemperature.");
             }
             break;
         case TW_DRLOCRSP:
             ret = processEntrySwitchDoorLockState(entry, ctx);
             if (ret != TW_RESULT_OK)
             {
-                OC_LOG(ERROR, TAG, "processEntrySwitchDoorLockState.");
+                OIC_LOG(ERROR, TAG, "processEntrySwitchDoorLockState.");
             }
             break;
         case TW_DRUNLOCKRSP:
             ret = processEntrySwitchDoorLockState(entry, ctx);
             if (ret != TW_RESULT_OK)
             {
-                OC_LOG(ERROR, TAG, "processEntrySwitchDoorLockState.");
+                OIC_LOG(ERROR, TAG, "processEntrySwitchDoorLockState.");
             }
             break;
         case TW_DFTREP:
             ret = processEntryZCLDefaultResponse(entry, ctx);
             if (ret != TW_RESULT_OK)
             {
-                OC_LOG(ERROR, TAG, "processEntryZCLDefaultResponse.");
+                OIC_LOG(ERROR, TAG, "processEntryZCLDefaultResponse.");
             }
             break;
         case TW_ZENROLLREQ:
             ret = processEntryZoneEnrollRequest(entry, ctx);
             if (ret != TW_RESULT_OK)
             {
-                OC_LOG(ERROR, TAG, "processEntryZoneEnrollRequest.");
+                OIC_LOG(ERROR, TAG, "processEntryZoneEnrollRequest.");
             }
             break;
         case TW_ENROLLED:
             ret = processEntryEnrolled(entry, ctx);
             if (ret != TW_RESULT_OK)
             {
-                OC_LOG(ERROR, TAG, "processEntryEnrolled.");
+                OIC_LOG(ERROR, TAG, "processEntryEnrolled.");
             }
             break;
         case TW_ZONESTATUS:
             ret = processEntryZoneStatus(entry, ctx);
             if (ret != TW_RESULT_OK)
             {
-                OC_LOG(ERROR, TAG, "processEntryZoneStatus.");
+                OIC_LOG(ERROR, TAG, "processEntryZoneStatus.");
             }
             break;
         case TW_ADDRESS_RESPONSE:
             ret = processEntryAddressResponse(entry, ctx);
             if (ret != TW_RESULT_OK)
             {
-                OC_LOG(ERROR, TAG, "processEntryAddressResponse.");
+                OIC_LOG(ERROR, TAG, "processEntryAddressResponse.");
             }
             break;
         default:
-            OC_LOG(ERROR, TAG, "processEntry() doesn't receive an valid entry.");
+            OIC_LOG(ERROR, TAG, "processEntry() doesn't receive an valid entry.");
             ret = TW_RESULT_ERROR;
             break;
     }
 
-    OC_LOG_V(INFO, TAG, "Leave processEntry() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave processEntry() with ret=%d", ret);
     return ret;
 }
 
@@ -1311,13 +1311,13 @@ TWResultCode processEntryNETWORK_INFO(TWEntry* entry, TWContext* ctx)
     //      OK
     */
 
-    OC_LOG(INFO, TAG, "Enter processEntryNETWORK_INFO()");
+    OIC_LOG(INFO, TAG, "Enter processEntryNETWORK_INFO()");
 
     TWResultCode ret = TW_RESULT_UNKNOWN;
 
     if (strcmp(entry->atErrorCode, AT_STR_ERROR_EVERYTHING_OK) != 0)
     {
-        OC_LOG_V(ERROR, TAG, "TWEntry contains AT_ERROR: %s", entry->atErrorCode);
+        OIC_LOG_V(ERROR, TAG, "TWEntry contains AT_ERROR: %s", entry->atErrorCode);
         ret = TW_RESULT_ERROR;
         goto exit;
     }
@@ -1325,7 +1325,7 @@ TWResultCode processEntryNETWORK_INFO(TWEntry* entry, TWContext* ctx)
     ret = HandleATResponse(entry,ctx);
 
 exit:
-    OC_LOG_V(INFO, TAG, "Leave processEntryNETWORK_INFO() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave processEntryNETWORK_INFO() with ret=%d", ret);
     return ret;
 }
 
@@ -1340,7 +1340,7 @@ TWResultCode processEntryJPAN(TWEntry* entry, TWContext* ctx)
     //      ERROR:28
     */
 
-    OC_LOG(INFO, TAG, "Enter processEntryJPAN()");
+    OIC_LOG(INFO, TAG, "Enter processEntryJPAN()");
 
     TWResultCode ret = TW_RESULT_UNKNOWN;
     if (strcmp(entry->atErrorCode, AT_STR_ERROR_EVERYTHING_OK) == 0)
@@ -1348,7 +1348,7 @@ TWResultCode processEntryJPAN(TWEntry* entry, TWContext* ctx)
         ret = HandleATResponse(entry,ctx);
         if (ret == TW_RESULT_NEW_LOCAL_PAN_ESTABLISHED)
         {
-            OC_LOG(INFO, TAG, "New Local PAN established.");
+            OIC_LOG(INFO, TAG, "New Local PAN established.");
             ret =  TW_RESULT_OK;
         }
         else
@@ -1358,31 +1358,31 @@ TWResultCode processEntryJPAN(TWEntry* entry, TWContext* ctx)
     }
     else if (strcmp(entry->atErrorCode, AT_STR_ERROR_NODE_IS_PART_OF_PAN) == 0)
     {
-        OC_LOG(INFO, TAG, "Already Established PAN.");
+        OIC_LOG(INFO, TAG, "Already Established PAN.");
         ret = TW_RESULT_OK;
     }
     else
     {
-        OC_LOG_V(ERROR, TAG, "TWEntry contains AT_ERROR: %s", entry->atErrorCode);
+        OIC_LOG_V(ERROR, TAG, "TWEntry contains AT_ERROR: %s", entry->atErrorCode);
         ret = TW_RESULT_ERROR;
     }
 
-    OC_LOG_V(INFO, TAG, "Leave processEntryJPAN() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave processEntryJPAN() with ret=%d", ret);
     return ret;
 }
 
 TWResultCode processEntryEndDevice(TWEntry* entry, TWContext* ctx)
 {
-    OC_LOG(INFO, TAG, "Enter processEntryEndDevice()");
+    OIC_LOG(INFO, TAG, "Enter processEntryEndDevice()");
 
     TWResultCode ret = TW_RESULT_UNKNOWN;
     ret = HandleATResponse(entry,ctx);
     if (ret != TW_RESULT_OK)
     {
-        OC_LOG(ERROR, TAG, "HandleATResponse");
+        OIC_LOG(ERROR, TAG, "HandleATResponse");
     }
 
-    OC_LOG_V(INFO, TAG, "Leave processEntryEndDevice() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave processEntryEndDevice() with ret=%d", ret);
     return ret;
 }
 
@@ -1390,12 +1390,12 @@ TWResultCode processEntryMatchDesc(TWEntry* entry, TWContext* ctx)
 {
     //MatchDesc:0B4A,00,01
 
-    OC_LOG(INFO, TAG, "Enter processEntryMatchDesc()");
+    OIC_LOG(INFO, TAG, "Enter processEntryMatchDesc()");
     TWResultCode ret = TW_RESULT_UNKNOWN;
 
     if (strcmp(entry->atErrorCode, AT_STR_ERROR_EVERYTHING_OK) != 0)
     {
-        OC_LOG_V(ERROR, TAG, "TWEntry contains AT_ERROR = %s", entry->atErrorCode);
+        OIC_LOG_V(ERROR, TAG, "TWEntry contains AT_ERROR = %s", entry->atErrorCode);
         ret = TW_RESULT_ERROR;
     }
     else
@@ -1403,36 +1403,36 @@ TWResultCode processEntryMatchDesc(TWEntry* entry, TWContext* ctx)
         ret = HandleATResponse(entry,ctx);
         if (ret == TW_RESULT_OK)
         {
-            OC_LOG(INFO, TAG, "HandleATResponse");
+            OIC_LOG(INFO, TAG, "HandleATResponse");
             ret = FindClusters(ctx->g_WIPDevice->nodeId,
                                ctx->g_WIPDevice->endpointOfInterest->endpointId,
                                ctx);
             if (ret == TW_RESULT_OK)
             {
-                OC_LOG(INFO, TAG, "FindClusters - Found a match node");
+                OIC_LOG(INFO, TAG, "FindClusters - Found a match node");
                 if (ctx->g_DeviceFoundCallback != NULL)
                 {
-                    OC_LOG(INFO, TAG, "Found a match node -- invoke callback");
+                    OIC_LOG(INFO, TAG, "Found a match node -- invoke callback");
                     ctx->g_DeviceFoundCallback(ctx->g_WIPDevice, ctx->g_plugin);
                 }
                 ret =  TW_RESULT_OK;
             }
             else
             {
-                OC_LOG(ERROR, TAG, "FindClusters");
+                OIC_LOG(ERROR, TAG, "FindClusters");
                 ret = TW_RESULT_ERROR;
             }
         }
         else
         {
-            OC_LOG(ERROR, TAG, "HandleATResponse");
+            OIC_LOG(ERROR, TAG, "HandleATResponse");
             ret = TW_RESULT_ERROR;
         }
 
         ctx->g_WIPDevice = NULL; //reset and do not deallocate it
     }
 
-    OC_LOG_V(INFO, TAG, "Leave processEntryMatchDesc() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave processEntryMatchDesc() with ret=%d", ret);
     return ret;
 }
 
@@ -1452,13 +1452,13 @@ TWResultCode processEntrySimpleDesc(TWEntry* entry, TWContext* ctx)
     //
     //      ACK:97
     */
-    OC_LOG(INFO, TAG, "Enter processEntrySimpleDesc()");
+    OIC_LOG(INFO, TAG, "Enter processEntrySimpleDesc()");
 
     TWResultCode ret = TW_RESULT_UNKNOWN;
 
     if (strcmp((entry->atErrorCode), AT_STR_ERROR_EVERYTHING_OK) != 0)
     {
-        OC_LOG_V(ERROR, TAG, "TWEntry contains AT_ERROR = %s", (entry->atErrorCode));
+        OIC_LOG_V(ERROR, TAG, "TWEntry contains AT_ERROR = %s", (entry->atErrorCode));
         ret = TW_RESULT_ERROR;
     }
     else
@@ -1468,18 +1468,18 @@ TWResultCode processEntrySimpleDesc(TWEntry* entry, TWContext* ctx)
             ret = HandleATResponse(entry,ctx);
             if (ret == TW_RESULT_HAS_CLUSTERS)
             {
-                OC_LOG(INFO, TAG, "has clusters.");
+                OIC_LOG(INFO, TAG, "has clusters.");
                 ret = TW_RESULT_OK;
             }
         }
         else
         {
-            OC_LOG(INFO, TAG, "Received an invalid Simple Descriptor.");
+            OIC_LOG(INFO, TAG, "Received an invalid Simple Descriptor.");
             ret = TW_RESULT_ERROR;
         }
     }
 
-    OC_LOG_V(INFO, TAG, "Leave processEntrySimpleDesc() returns with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave processEntrySimpleDesc() returns with ret=%d", ret);
     return ret;
 }
 
@@ -1489,13 +1489,13 @@ TWResultCode processEntryWriteAttr(TWEntry* entry, TWContext* ctx)
     //      OK
     //      WRITEATTR:3A3D,01,0003,,00
 
-    OC_LOG(INFO, TAG, "Enter processEntryWriteAttr()");
+    OIC_LOG(INFO, TAG, "Enter processEntryWriteAttr()");
 
     TWResultCode ret = TW_RESULT_UNKNOWN;
 
     if (strcmp((entry->atErrorCode), AT_STR_ERROR_EVERYTHING_OK) != 0)
     {
-        OC_LOG_V(ERROR, TAG, "TWEntry contains AT_ERROR = %s", entry->atErrorCode);
+        OIC_LOG_V(ERROR, TAG, "TWEntry contains AT_ERROR = %s", entry->atErrorCode);
         ret = TW_RESULT_ERROR;
     }
     else
@@ -1503,19 +1503,19 @@ TWResultCode processEntryWriteAttr(TWEntry* entry, TWContext* ctx)
         ret = HandleATResponse(entry,ctx);
     }
 
-    OC_LOG_V(INFO, TAG, "Leave processEntryWriteAttr() returns with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave processEntryWriteAttr() returns with ret=%d", ret);
     return ret;
 }
 
 TWResultCode processEntryReadAttr(TWEntry* entry, TWContext* ctx)
 {
-    OC_LOG(INFO, TAG, "Enter processEntryReadAttr()");
+    OIC_LOG(INFO, TAG, "Enter processEntryReadAttr()");
 
     TWResultCode ret = TW_RESULT_UNKNOWN;
 
     if (strcmp((entry->atErrorCode), AT_STR_ERROR_EVERYTHING_OK) != 0)
     {
-        OC_LOG_V(ERROR, TAG, "TWEntry contains AT_ERROR = %s", entry->atErrorCode);
+        OIC_LOG_V(ERROR, TAG, "TWEntry contains AT_ERROR = %s", entry->atErrorCode);
         ret = TW_RESULT_ERROR;
     }
     else
@@ -1523,19 +1523,19 @@ TWResultCode processEntryReadAttr(TWEntry* entry, TWContext* ctx)
         ret = HandleATResponse(entry,ctx);
     }
 
-    OC_LOG_V(INFO, TAG, "Leave processEntryReadAttr() returns with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave processEntryReadAttr() returns with ret=%d", ret);
     return ret;
 }
 
 TWResultCode processEntryTemperature(TWEntry* entry, TWContext* ctx)
 {
-    OC_LOG(INFO, TAG, "Enter processEntryTemperature()");
+    OIC_LOG(INFO, TAG, "Enter processEntryTemperature()");
 
     TWResultCode ret = TW_RESULT_UNKNOWN;
 
     if (strcmp((entry->atErrorCode), AT_STR_ERROR_EVERYTHING_OK) != 0)
     {
-        OC_LOG_V(ERROR, TAG, "TWEntry contains AT_ERROR = %s", entry->atErrorCode);
+        OIC_LOG_V(ERROR, TAG, "TWEntry contains AT_ERROR = %s", entry->atErrorCode);
         ret = TW_RESULT_ERROR;
     }
     else
@@ -1543,19 +1543,19 @@ TWResultCode processEntryTemperature(TWEntry* entry, TWContext* ctx)
         ret = HandleATResponse(entry,ctx);
     }
 
-    OC_LOG_V(INFO, TAG, "Leave processEntryTemperature() returns with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave processEntryTemperature() returns with ret=%d", ret);
     return ret;
 }
 
 TWResultCode processEntrySwitchDoorLockState(TWEntry* entry, TWContext* ctx)
 {
-    OC_LOG(INFO, TAG, "Enter processEntrySwitchDoorLockState()");
+    OIC_LOG(INFO, TAG, "Enter processEntrySwitchDoorLockState()");
 
     TWResultCode ret = TW_RESULT_UNKNOWN;
 
     if (strcmp((entry->atErrorCode), AT_STR_ERROR_EVERYTHING_OK) != 0)
     {
-        OC_LOG_V(ERROR, TAG, "TWEntry contains AT_ERROR = %s", entry->atErrorCode);
+        OIC_LOG_V(ERROR, TAG, "TWEntry contains AT_ERROR = %s", entry->atErrorCode);
         ret = TW_RESULT_ERROR;
     }
     else
@@ -1563,13 +1563,13 @@ TWResultCode processEntrySwitchDoorLockState(TWEntry* entry, TWContext* ctx)
         ret = HandleATResponse(entry,ctx);
     }
 
-    OC_LOG_V(INFO, TAG, "Leave processEntrySwitchDoorLockState() returns with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave processEntrySwitchDoorLockState() returns with ret=%d", ret);
     return ret;
 }
 
 TWResultCode processEntryZCLDefaultResponse(TWEntry* entry, TWContext* ctx)
 {
-    OC_LOG(INFO, TAG, "Enter processEntryZCLDefaultResponse()");
+    OIC_LOG(INFO, TAG, "Enter processEntryZCLDefaultResponse()");
 
     TWResultCode ret = TW_RESULT_UNKNOWN;
 
@@ -1577,12 +1577,12 @@ TWResultCode processEntryZCLDefaultResponse(TWEntry* entry, TWContext* ctx)
     {
         if (strcmp(entry->atErrorCode, AT_STR_ERROR_MESSAGE_NOT_SENT_TO_TARGET_SUCCESSFULLY) == 0)
         {
-            OC_LOG(ERROR, TAG, "Send to the target not succeed.");
+            OIC_LOG(ERROR, TAG, "Send to the target not succeed.");
             ret = TW_RESULT_ERROR;
         }
         else
         {
-            OC_LOG_V(ERROR, TAG, "TWEntry contains AT_ERROR = %s", entry->atErrorCode);
+            OIC_LOG_V(ERROR, TAG, "TWEntry contains AT_ERROR = %s", entry->atErrorCode);
             ret = TW_RESULT_ERROR;
         }
     }
@@ -1591,18 +1591,18 @@ TWResultCode processEntryZCLDefaultResponse(TWEntry* entry, TWContext* ctx)
         ret = HandleATResponse(entry,ctx);
     }
 
-    OC_LOG_V(INFO, TAG, "Leave processEntryZCLDefaultResponse() returns with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave processEntryZCLDefaultResponse() returns with ret=%d", ret);
     return ret;
 }
 
 TWResultCode processEntryZoneEnrollRequest(TWEntry* entry, TWContext* ctx)
 {
-    OC_LOG(INFO, TAG, "Enter processEntryZoneEnrollRequest()");
+    OIC_LOG(INFO, TAG, "Enter processEntryZoneEnrollRequest()");
 
     TWResultCode ret = TW_RESULT_UNKNOWN;
     if (strcmp(entry->atErrorCode, AT_STR_ERROR_EVERYTHING_OK) != 0)
     {
-        OC_LOG_V(ERROR, TAG, "TWEntry contains AT_ERROR: %s", entry->atErrorCode);
+        OIC_LOG_V(ERROR, TAG, "TWEntry contains AT_ERROR: %s", entry->atErrorCode);
         ret = TW_RESULT_ERROR;
     }
     else
@@ -1610,18 +1610,18 @@ TWResultCode processEntryZoneEnrollRequest(TWEntry* entry, TWContext* ctx)
         ret = HandleATResponse(entry,ctx);
     }
 
-    OC_LOG_V(INFO, TAG, "Leave processEntryZoneEnrollRequest() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave processEntryZoneEnrollRequest() with ret=%d", ret);
     return ret;
 }
 
 TWResultCode processEntryEnrolled(TWEntry* entry, TWContext* ctx)
 {
-    OC_LOG(INFO, TAG, "Enter processEntryEnrolled()");
+    OIC_LOG(INFO, TAG, "Enter processEntryEnrolled()");
 
     TWResultCode ret = TW_RESULT_UNKNOWN;
     if (strcmp(entry->atErrorCode, AT_STR_ERROR_EVERYTHING_OK) != 0)
     {
-        OC_LOG_V(ERROR, TAG, "TWEntry contains AT_ERROR: %s", entry->atErrorCode);
+        OIC_LOG_V(ERROR, TAG, "TWEntry contains AT_ERROR: %s", entry->atErrorCode);
         ret = TW_RESULT_ERROR;
     }
     else
@@ -1629,18 +1629,18 @@ TWResultCode processEntryEnrolled(TWEntry* entry, TWContext* ctx)
         ret = HandleATResponse(entry,ctx);
     }
 
-    OC_LOG_V(INFO, TAG, "Leave processEntryEnrolled() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave processEntryEnrolled() with ret=%d", ret);
     return ret;
 }
 
 TWResultCode processEntryZoneStatus(TWEntry* entry, TWContext* ctx)
 {
-    OC_LOG(INFO, TAG, "Enter processEntryZoneStatus()");
+    OIC_LOG(INFO, TAG, "Enter processEntryZoneStatus()");
 
     TWResultCode ret = TW_RESULT_UNKNOWN;
     if (strcmp(entry->atErrorCode, AT_STR_ERROR_EVERYTHING_OK) != 0)
     {
-        OC_LOG_V(ERROR, TAG, "TWEntry contains AT_ERROR: %s", entry->atErrorCode);
+        OIC_LOG_V(ERROR, TAG, "TWEntry contains AT_ERROR: %s", entry->atErrorCode);
         ret = TW_RESULT_ERROR;
     }
     else
@@ -1648,18 +1648,18 @@ TWResultCode processEntryZoneStatus(TWEntry* entry, TWContext* ctx)
         ret = HandleATResponse(entry,ctx);
     }
 
-    OC_LOG_V(INFO, TAG, "Leave processEntryZoneStatus() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave processEntryZoneStatus() with ret=%d", ret);
     return ret;
 }
 
 TWResultCode processEntryAddressResponse(TWEntry* entry, TWContext* ctx)
 {
-    OC_LOG(INFO, TAG, "Enter processEntryAddressResponse()");
+    OIC_LOG(INFO, TAG, "Enter processEntryAddressResponse()");
 
     TWResultCode ret = TW_RESULT_UNKNOWN;
     if (strcmp(entry->atErrorCode, AT_STR_ERROR_EVERYTHING_OK) != 0)
     {
-        OC_LOG_V(ERROR, TAG, "TWEntry contains AT_ERROR: %s", entry->atErrorCode);
+        OIC_LOG_V(ERROR, TAG, "TWEntry contains AT_ERROR: %s", entry->atErrorCode);
         ret = TW_RESULT_ERROR;
     }
     else
@@ -1667,25 +1667,25 @@ TWResultCode processEntryAddressResponse(TWEntry* entry, TWContext* ctx)
         ret = HandleATResponse(entry,ctx);
     }
 
-    OC_LOG_V(INFO, TAG, "Leave processEntryAddressResponse() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave processEntryAddressResponse() with ret=%d", ret);
     return ret;
 }
 
 TWResultCode Reset(TWContext* ctx)
 {
-    OC_LOG(INFO, TAG, "Enter Reset()");
+    OIC_LOG(INFO, TAG, "Enter Reset()");
 
     TWResultCode ret = TW_RESULT_ERROR;
     ret = TWIssueATCommand(ctx->g_plugin, AT_CMD_RESET);
     if (ret == TW_RESULT_OK)
     {
-        OC_LOG_V(INFO, TAG, "Write %s", AT_CMD_RESET);
+        OIC_LOG_V(INFO, TAG, "Write %s", AT_CMD_RESET);
     }
     else
     {
-        OC_LOG_V(ERROR, TAG, "Write %s", AT_CMD_RESET);
+        OIC_LOG_V(ERROR, TAG, "Write %s", AT_CMD_RESET);
     }
-    OC_LOG_V(INFO, TAG, "Leave Reset() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave Reset() with ret=%d", ret);
     return ret;
 }
 
@@ -1708,7 +1708,7 @@ TWResultCode CreatePAN(TWContext* ctx)
     //      ERROR:28
     */
 
-    OC_LOG(INFO, TAG, "Enter CreatePAN()");
+    OIC_LOG(INFO, TAG, "Enter CreatePAN()");
 
     TWResultCode twRet1 = TW_RESULT_UNKNOWN;
     TWResultCode twRet2 = TW_RESULT_UNKNOWN;
@@ -1716,68 +1716,68 @@ TWResultCode CreatePAN(TWContext* ctx)
     ret = TWIssueATCommand(ctx->g_plugin, AT_CMD_GET_NETWORK_INFO);
     if (ret != TW_RESULT_OK)
     {
-        OC_LOG_V(ERROR, TAG, "Write %s", AT_CMD_GET_NETWORK_INFO);
+        OIC_LOG_V(ERROR, TAG, "Write %s", AT_CMD_GET_NETWORK_INFO);
         goto exit;
     }
-    OC_LOG_V(INFO, TAG, "Write %s", AT_CMD_GET_NETWORK_INFO);
+    OIC_LOG_V(INFO, TAG, "Write %s", AT_CMD_GET_NETWORK_INFO);
     TWEntry* entry = NULL;
     TWEntry* entry2 = NULL;
     ret = TWDequeueEntry(ctx->g_plugin, &entry, TW_NETWORK_INFO);
     if (ret != TW_RESULT_OK)
     {
-        OC_LOG_V(ERROR, TAG, "TWDequeueEntry - %s", AT_CMD_GET_NETWORK_INFO);
+        OIC_LOG_V(ERROR, TAG, "TWDequeueEntry - %s", AT_CMD_GET_NETWORK_INFO);
         goto exit;
     }
     if (entry == NULL)
     {
-        OC_LOG_V(ERROR, TAG, "TWEntry is NULL - %s", AT_CMD_GET_NETWORK_INFO);
+        OIC_LOG_V(ERROR, TAG, "TWEntry is NULL - %s", AT_CMD_GET_NETWORK_INFO);
         ret = TW_RESULT_ERROR;
         goto exit;
     }
     ret = processEntry(entry, ctx);
     if (ret == TW_RESULT_HAS_LOCAL_PAN)
     {
-        OC_LOG(INFO, TAG, "Has local PAN.");
+        OIC_LOG(INFO, TAG, "Has local PAN.");
         ret = TW_RESULT_OK;
     }
     else if (ret == TW_RESULT_NO_LOCAL_PAN)
     {
-        OC_LOG(INFO, TAG, "Has no local PAN.");
+        OIC_LOG(INFO, TAG, "Has no local PAN.");
         ret = TWIssueATCommand(ctx->g_plugin, AT_CMD_ESTABLISH_NETWORK);
         if (ret != TW_RESULT_OK)
         {
-            OC_LOG_V(ERROR, TAG, "Write %s", AT_CMD_ESTABLISH_NETWORK);
+            OIC_LOG_V(ERROR, TAG, "Write %s", AT_CMD_ESTABLISH_NETWORK);
             goto exit;
         }
-        OC_LOG_V(INFO, TAG, "Write %s", AT_CMD_ESTABLISH_NETWORK);
+        OIC_LOG_V(INFO, TAG, "Write %s", AT_CMD_ESTABLISH_NETWORK);
 
         ret = TWDequeueEntry(ctx->g_plugin, &entry2, TW_JPAN);
         if (ret != TW_RESULT_OK)
         {
-            OC_LOG_V(ERROR, TAG, "TWDequeueEntry - %s", AT_CMD_ESTABLISH_NETWORK);
+            OIC_LOG_V(ERROR, TAG, "TWDequeueEntry - %s", AT_CMD_ESTABLISH_NETWORK);
             goto exit;
         }
         if (entry2 == NULL)
         {
-            OC_LOG_V(ERROR, TAG, "TWEntry is NULL - %s", AT_CMD_ESTABLISH_NETWORK);
+            OIC_LOG_V(ERROR, TAG, "TWEntry is NULL - %s", AT_CMD_ESTABLISH_NETWORK);
             ret = TW_RESULT_ERROR;
             goto exit;
         }
         ret = processEntry(entry2, ctx);
         if (ret == TW_RESULT_OK)
         {
-            OC_LOG_V(INFO, TAG, "processEntry - %s", AT_CMD_ESTABLISH_NETWORK);
+            OIC_LOG_V(INFO, TAG, "processEntry - %s", AT_CMD_ESTABLISH_NETWORK);
             ret = TW_RESULT_OK;
         }
         else
         {
-            OC_LOG_V(ERROR, TAG, "processEntry - %s", AT_CMD_ESTABLISH_NETWORK);
+            OIC_LOG_V(ERROR, TAG, "processEntry - %s", AT_CMD_ESTABLISH_NETWORK);
             ret = TW_RESULT_ERROR;
         }
     }
     else
     {
-        OC_LOG_V(ERROR, TAG, "processEntry - unexpected return code: %d", ret);
+        OIC_LOG_V(ERROR, TAG, "processEntry - unexpected return code: %d", ret);
         ret = TW_RESULT_ERROR;
     }
 
@@ -1787,7 +1787,7 @@ exit:
         twRet1 = TWDeleteEntry(ctx->g_plugin, entry);
         if(twRet1 != TW_RESULT_OK)
         {
-            OC_LOG_V(ERROR, TAG, "TWDeleteEntry 1 - ret=%d", twRet1);
+            OIC_LOG_V(ERROR, TAG, "TWDeleteEntry 1 - ret=%d", twRet1);
         }
     }
     if (entry2)
@@ -1795,11 +1795,11 @@ exit:
         twRet2 = TWDeleteEntry(ctx->g_plugin, entry2);
         if(twRet2 != TW_RESULT_OK)
         {
-            OC_LOG_V(ERROR, TAG, "TWDeleteEntry 2 - ret=%d", twRet2);
+            OIC_LOG_V(ERROR, TAG, "TWDeleteEntry 2 - ret=%d", twRet2);
         }
     }
 
-    OC_LOG_V(INFO, TAG, "Leave CreatePan with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave CreatePan with ret=%d", ret);
     return ret;
 }
 
@@ -1841,7 +1841,7 @@ TWResultCode EnableJoin(bool isKeyEncrypted, TWContext* ctx)
     char* cmdString = (char*)OICMalloc(size * sizeof(char));
     if (cmdString == NULL)
     {
-        OC_LOG(ERROR, TAG, "No Memory");
+        OIC_LOG(ERROR, TAG, "No Memory");
         ret = TW_RESULT_ERROR_NO_MEMORY;
         goto exit;
     }
@@ -1850,17 +1850,17 @@ TWResultCode EnableJoin(bool isKeyEncrypted, TWContext* ctx)
     ret = TWIssueATCommand(ctx->g_plugin, cmdString);
     if (ret != TW_RESULT_OK)
     {
-        OC_LOG_V(ERROR, TAG, "Write %s", cmdString);
+        OIC_LOG_V(ERROR, TAG, "Write %s", cmdString);
         ret = TW_RESULT_ERROR;
         goto exit;
     }
-    OC_LOG_V(INFO, TAG, "Write %s", cmdString);
+    OIC_LOG_V(INFO, TAG, "Write %s", cmdString);
 
     sleep(15);  //must sleep here to permit joining for 15 seconds
 
 exit:
     OICFree(cmdString);
-    OC_LOG_V(INFO, TAG, "Leave EnableJoin() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave EnableJoin() with ret=%d", ret);
     return ret;
 }
 
@@ -1873,7 +1873,7 @@ TWResultCode FindMatchNodes(TWContext* ctx)
     //AT+MATCHREQ:0104,03,0999,0999,0999,00
     //      OK
 
-    OC_LOG(INFO, TAG, "Enter FindMatchNodes()");
+    OIC_LOG(INFO, TAG, "Enter FindMatchNodes()");
 
     TWResultCode ret = TW_RESULT_UNKNOWN;
 
@@ -1891,7 +1891,7 @@ TWResultCode FindMatchNodes(TWContext* ctx)
     char* cmdString = (char*)OICMalloc(size * sizeof(char));
     if (cmdString == NULL)
     {
-        OC_LOG(ERROR, TAG, "No Memory");
+        OIC_LOG(ERROR, TAG, "No Memory");
         ret = TW_RESULT_ERROR_NO_MEMORY;
         goto exit;
     }
@@ -1907,21 +1907,21 @@ TWResultCode FindMatchNodes(TWContext* ctx)
                              SEPARATOR, OUT_CLUSTER_COUNT_STRING);
     if(stringRet <= 0)
     {
-        OC_LOG(ERROR, TAG, "Build command error.");
+        OIC_LOG(ERROR, TAG, "Build command error.");
         ret = OC_STACK_ERROR;
         goto exit;
     }
     ret = TWIssueATCommand(ctx->g_plugin, cmdString);
     if (ret != TW_RESULT_OK)
     {
-        OC_LOG_V(ERROR, TAG, "Write %s.", cmdString);
+        OIC_LOG_V(ERROR, TAG, "Write %s.", cmdString);
         goto exit;
     }
-    OC_LOG_V(INFO, TAG, "Write %s.", cmdString);
+    OIC_LOG_V(INFO, TAG, "Write %s.", cmdString);
 
 exit:
     OICFree(cmdString);
-    OC_LOG_V(INFO, TAG, "Leave FindMatchNodes() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave FindMatchNodes() with ret=%d", ret);
     return ret;
 }
 
@@ -1942,7 +1942,7 @@ TWResultCode FindClusters(char nodeId[], char endpoint[], TWContext* ctx)
     //      ACK:97
     */
 
-    OC_LOG(INFO, TAG, "Enter FindClusters()");
+    OIC_LOG(INFO, TAG, "Enter FindClusters()");
 
     TWResultCode ret = TW_RESULT_UNKNOWN;
 
@@ -1953,7 +1953,7 @@ TWResultCode FindClusters(char nodeId[], char endpoint[], TWContext* ctx)
     char* cmdString = (char*)OICMalloc(size * sizeof(char));
     if (cmdString == NULL)
     {
-        OC_LOG(ERROR, TAG, "No Memory");
+        OIC_LOG(ERROR, TAG, "No Memory");
         ret = TW_RESULT_ERROR_NO_MEMORY;
         goto exit;
     }
@@ -1964,29 +1964,29 @@ TWResultCode FindClusters(char nodeId[], char endpoint[], TWContext* ctx)
                              SEPARATOR, endpoint);
     if(stringRet <= 0)
     {
-        OC_LOG(ERROR, TAG, "Build command error.");
+        OIC_LOG(ERROR, TAG, "Build command error.");
         ret = OC_STACK_ERROR;
         goto exit;
     }
     ret = TWIssueATCommand(ctx->g_plugin, cmdString);
     if (ret != TW_RESULT_OK)
     {
-        OC_LOG_V(ERROR, TAG, "Write %s", cmdString);
+        OIC_LOG_V(ERROR, TAG, "Write %s", cmdString);
         ret = TW_RESULT_ERROR;
         goto exit;
     }
-    OC_LOG_V(INFO, TAG, "Write %s", cmdString);
+    OIC_LOG_V(INFO, TAG, "Write %s", cmdString);
 
     TWEntry* entry = NULL;
     ret = TWDequeueEntry(ctx->g_plugin, &entry, TW_SIMPLEDESC);
     if (ret != TW_RESULT_OK)
     {
-        OC_LOG_V(ERROR, TAG, "TWDequeueEntry - %s", cmdString);
+        OIC_LOG_V(ERROR, TAG, "TWDequeueEntry - %s", cmdString);
         goto exit;
     }
     if (entry == NULL)
     {
-        OC_LOG_V(ERROR, TAG, "TWEntry is NULL - %s", cmdString);
+        OIC_LOG_V(ERROR, TAG, "TWEntry is NULL - %s", cmdString);
         ret = TW_RESULT_ERROR;
         goto exit;
     }
@@ -1994,17 +1994,17 @@ TWResultCode FindClusters(char nodeId[], char endpoint[], TWContext* ctx)
     ret = processEntry(entry, ctx);
     if (ret == TW_RESULT_OK)
     {
-        OC_LOG_V(INFO, TAG, "processEntry - %s", cmdString);
+        OIC_LOG_V(INFO, TAG, "processEntry - %s", cmdString);
     }
     else
     {
-        OC_LOG_V(ERROR, TAG, "processEntry - %s", cmdString);
+        OIC_LOG_V(ERROR, TAG, "processEntry - %s", cmdString);
     }
 
 exit:
     TWDeleteEntry(ctx->g_plugin, entry);
     OICFree(cmdString);
-    OC_LOG_V(INFO, TAG, "Leave FindClusters() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave FindClusters() with ret=%d", ret);
     return ret;
 }
 
@@ -2014,7 +2014,7 @@ TWResultCode GetRemoteEUI(char *nodeId, char* outRemoteEUI, TWContext* ctx)
     //  AddrResp:<errorcode>[,<NodeID>,<EUI64>]
     //  AddrResp:00,15ED,000D6F00040574B8
 
-    OC_LOG(INFO, TAG, "Enter GetRemoteEUI()");
+    OIC_LOG(INFO, TAG, "Enter GetRemoteEUI()");
     TWResultCode ret = TW_RESULT_UNKNOWN;
 
     int size = strlen(AT_CMD_REMOTE_EUI_REQUEST) + strlen(nodeId) +
@@ -2022,7 +2022,7 @@ TWResultCode GetRemoteEUI(char *nodeId, char* outRemoteEUI, TWContext* ctx)
     char* cmdString = (char*)OICMalloc(size * sizeof(char));
     if (cmdString == NULL)
     {
-        OC_LOG(ERROR, TAG, "No Memory");
+        OIC_LOG(ERROR, TAG, "No Memory");
         ret = TW_RESULT_ERROR_NO_MEMORY;
         goto exit;
     }
@@ -2032,30 +2032,30 @@ TWResultCode GetRemoteEUI(char *nodeId, char* outRemoteEUI, TWContext* ctx)
                          SEPARATOR, nodeId);
     if(stringRet <= 0)
     {
-        OC_LOG(ERROR, TAG, "Build command error.");
+        OIC_LOG(ERROR, TAG, "Build command error.");
         ret = OC_STACK_ERROR;
         goto exit;
     }
     ret = TWIssueATCommand(ctx->g_plugin, cmdString);
     if (ret != TW_RESULT_OK)
     {
-        OC_LOG_V(ERROR, TAG, "Write %s", cmdString);
+        OIC_LOG_V(ERROR, TAG, "Write %s", cmdString);
         ret = TW_RESULT_ERROR;
         goto exit;
     }
-    OC_LOG_V(INFO, TAG, "Write %s", cmdString);
+    OIC_LOG_V(INFO, TAG, "Write %s", cmdString);
 
     TWEntry* entry = NULL;
     ret = TWDequeueEntry(ctx->g_plugin, &entry, TW_ADDRESS_RESPONSE);
     if (ret != TW_RESULT_OK)
     {
-        OC_LOG_V(ERROR, TAG, "TWDequeueEntry - %s", cmdString);
+        OIC_LOG_V(ERROR, TAG, "TWDequeueEntry - %s", cmdString);
         ret = TW_RESULT_ERROR;
         goto exit;
     }
     if (entry == NULL)
     {
-        OC_LOG_V(ERROR, TAG, "TWEntry is NULL - %s", cmdString);
+        OIC_LOG_V(ERROR, TAG, "TWEntry is NULL - %s", cmdString);
         ret = TW_RESULT_ERROR;
         goto exit;
     }
@@ -2063,20 +2063,20 @@ TWResultCode GetRemoteEUI(char *nodeId, char* outRemoteEUI, TWContext* ctx)
     ret = processEntry(entry, ctx);
     if (ret != TW_RESULT_OK)
     {
-        OC_LOG_V(ERROR, TAG, "processEntry - %s", cmdString);
+        OIC_LOG_V(ERROR, TAG, "processEntry - %s", cmdString);
         ret = TW_RESULT_ERROR;
         goto exit;
     }
-    OC_LOG_V(INFO, TAG, "Wanted   eui of NodeID=%s ", nodeId);
-    OC_LOG_V(INFO, TAG, "Received eui of g_WIPRemoteNodeId=%s ", ctx->g_WIPRemoteNodeId);
+    OIC_LOG_V(INFO, TAG, "Wanted   eui of NodeID=%s ", nodeId);
+    OIC_LOG_V(INFO, TAG, "Received eui of g_WIPRemoteNodeId=%s ", ctx->g_WIPRemoteNodeId);
     if (strcmp(nodeId, ctx->g_WIPRemoteNodeId) != 0)
     {
-        OC_LOG(ERROR, TAG, "Received eui for an unexpected remote node id.");
+        OIC_LOG(ERROR, TAG, "Received eui for an unexpected remote node id.");
         ret = TW_RESULT_ERROR;
         goto exit;
     }
 
-    OC_LOG_V(INFO, TAG, "Remote NodeId:%s has EUI: %s \n",
+    OIC_LOG_V(INFO, TAG, "Remote NodeId:%s has EUI: %s \n",
                         ctx->g_WIPRemoteNodeId, ctx->g_WIPRemoteEUI);
     OICStrcpy(outRemoteEUI, sizeof(ctx->g_WIPRemoteEUI), ctx->g_WIPRemoteEUI);
 
@@ -2087,13 +2087,13 @@ exit:
     memset(ctx->g_WIPRemoteNodeId, '\0', sizeof(ctx->g_WIPRemoteNodeId));
     TWDeleteEntry(ctx->g_plugin, entry);
     OICFree(cmdString);
-    OC_LOG_V(INFO, TAG, "Leave GetRemoteEUI() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave GetRemoteEUI() with ret=%d", ret);
     return ret;
 }
 
 TWResultCode HandleATResponse(TWEntry* entry, TWContext* ctx)
 {
-    OC_LOG(INFO, TAG, "Enter HandleATResponse()");
+    OIC_LOG(INFO, TAG, "Enter HandleATResponse()");
 
     TWResultCode ret = TW_RESULT_ERROR;
 
@@ -2130,7 +2130,7 @@ TWResultCode HandleATResponse(TWEntry* entry, TWContext* ctx)
         }
     }
 
-    OC_LOG_V(INFO, TAG, "Leave HandleATResponse() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave HandleATResponse() with ret=%d", ret);
     return ret;
 }
 
@@ -2144,7 +2144,7 @@ TWResultCode TelAddressResponseHandler(int count, char* tokens[], TWContext* ctx
     //  AddrResp:<errorcode>[,<NodeID>,<EUI64>]
     //  AddrResp:00,15ED,000D6F00040574B8
 
-    OC_LOG(INFO, TAG, "Enter TelAddressResponseHandler()");
+    OIC_LOG(INFO, TAG, "Enter TelAddressResponseHandler()");
 
     TWResultCode ret = TW_RESULT_UNKNOWN;
 
@@ -2156,21 +2156,21 @@ TWResultCode TelAddressResponseHandler(int count, char* tokens[], TWContext* ctx
     {
         if (strcmp(tokens[TOKEN_ADDRRESP_STATUS_CODE], AT_STR_ERROR_OK) != 0)
         {
-            OC_LOG(ERROR, TAG, "AddrResp prompt contained error status.");
+            OIC_LOG(ERROR, TAG, "AddrResp prompt contained error status.");
             ret = TW_RESULT_ERROR;
         }
         else
         {
             OICStrcpy(ctx->g_WIPRemoteNodeId, SIZE_NODEID, tokens[TOKEN_ADDRRESP_NODEID]);
             OICStrcpy(ctx->g_WIPRemoteEUI, SIZE_EUI, tokens[TOKEN_ADDRRESP_EUI]);
-            OC_LOG_V(INFO, TAG, "Received eui %s for g_WIPRemoteNodeId=%s ",
+            OIC_LOG_V(INFO, TAG, "Received eui %s for g_WIPRemoteNodeId=%s ",
                      ctx->g_WIPRemoteEUI,
                      ctx->g_WIPRemoteNodeId);
             ret = TW_RESULT_OK;
         }
     }
 
-    OC_LOG_V(INFO, TAG, "Leave TelAddressResponseHandler() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave TelAddressResponseHandler() with ret=%d", ret);
     return ret;
 }
 
@@ -2183,7 +2183,7 @@ TWResultCode TelNetworkInfoHandler(int count, char* tokens[], TWContext* ctx)
     //
     //              +N=<devicetype>,<channel>,<power>,<PANID>,<EPANID>
 
-    OC_LOG(INFO, TAG, "Enter TelNetworkInfoHandler()");
+    OIC_LOG(INFO, TAG, "Enter TelNetworkInfoHandler()");
 
     TWResultCode ret = TW_RESULT_UNKNOWN;
 
@@ -2200,25 +2200,25 @@ TWResultCode TelNetworkInfoHandler(int count, char* tokens[], TWContext* ctx)
     {
         if (tokens[i] != NULL)
         {
-            OC_LOG_V(INFO, TAG, "Token[%d] = %s", i, tokens[i]);
+            OIC_LOG_V(INFO, TAG, "Token[%d] = %s", i, tokens[i]);
         }
     }
 
     char* temp = tokens[TOKEN_PLUS_N_DEVICE_TYPE];
     if (strcmp(temp, "NoPAN") == 0)
     {
-        OC_LOG(INFO, TAG, "It is NoPan.");
+        OIC_LOG(INFO, TAG, "It is NoPan.");
         ret = TW_RESULT_NO_LOCAL_PAN;
         goto exit;
     }
 
-    OC_LOG(INFO, TAG, "Already have an established network.");
+    OIC_LOG(INFO, TAG, "Already have an established network.");
     ret = AsciiHexToValue(tokens[TOKEN_PLUS_N_PANID],
                           strlen(tokens[TOKEN_PLUS_N_PANID]),
                           &(ctx->g_ZigBeeStatus.panId));
     if(ret != TW_RESULT_OK)
     {
-        OC_LOG(ERROR, TAG, "AsciiHexToValue - panId");
+        OIC_LOG(ERROR, TAG, "AsciiHexToValue - panId");
         goto exit;
     }
 
@@ -2227,22 +2227,22 @@ TWResultCode TelNetworkInfoHandler(int count, char* tokens[], TWContext* ctx)
                           &(ctx->g_ZigBeeStatus.extPanId));
     if(ret != TW_RESULT_OK)
     {
-        OC_LOG(ERROR, TAG, "AsciiHexToValue - extPanId");
+        OIC_LOG(ERROR, TAG, "AsciiHexToValue - extPanId");
         goto exit;
     }
-    OC_LOG_V(INFO, TAG, "PanId=%" PRId64 , ctx->g_ZigBeeStatus.panId);
-    OC_LOG_V(INFO, TAG, "ExtPanId=%" PRId64 , ctx->g_ZigBeeStatus.extPanId);
-    OC_LOG_V(INFO, TAG, "PanId=%s", tokens[TOKEN_PLUS_N_PANID]);
-    OC_LOG_V(INFO, TAG, "ExtPanId=%s", tokens[TOKEN_PLUS_N_PANID_EXTENDED]);
+    OIC_LOG_V(INFO, TAG, "PanId=%" PRId64 , ctx->g_ZigBeeStatus.panId);
+    OIC_LOG_V(INFO, TAG, "ExtPanId=%" PRId64 , ctx->g_ZigBeeStatus.extPanId);
+    OIC_LOG_V(INFO, TAG, "PanId=%s", tokens[TOKEN_PLUS_N_PANID]);
+    OIC_LOG_V(INFO, TAG, "ExtPanId=%s", tokens[TOKEN_PLUS_N_PANID_EXTENDED]);
 
-    OC_LOG_V(INFO, TAG, "TelNetworkInfoHandler set ExtPanId to %08X%08X",
+    OIC_LOG_V(INFO, TAG, "TelNetworkInfoHandler set ExtPanId to %08X%08X",
              (unsigned int)(ctx->g_ZigBeeStatus.extPanId >> 32),
              (unsigned int)(ctx->g_ZigBeeStatus.extPanId & 0xFFFFFFFF));
 
     ret = TW_RESULT_HAS_LOCAL_PAN;
 
 exit:
-    OC_LOG_V(INFO, TAG, "Leave TelNetworkInfoHandler() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave TelNetworkInfoHandler() with ret=%d", ret);
     return ret;
 }
 
@@ -2251,7 +2251,7 @@ TWResultCode TelJpanHandler(int count, char* tokens[], TWContext* ctx)
     //Ask:        AT+EN:[<channel>],[<POWER>],[<PANID>]
     //Response:   JPAN:<channel>,<PANID>,<EPANID>
 
-    OC_LOG(INFO, TAG, "Enter TelJpanHandler()");
+    OIC_LOG(INFO, TAG, "Enter TelJpanHandler()");
 
     TWResultCode ret = TW_RESULT_UNKNOWN;
 
@@ -2267,7 +2267,7 @@ TWResultCode TelJpanHandler(int count, char* tokens[], TWContext* ctx)
 
     if(ret != TW_RESULT_OK)
     {
-        OC_LOG(ERROR, TAG, "AsciiHexToValue - panId");
+        OIC_LOG(ERROR, TAG, "AsciiHexToValue - panId");
         goto exit;
     }
 
@@ -2276,15 +2276,15 @@ TWResultCode TelJpanHandler(int count, char* tokens[], TWContext* ctx)
                           &(ctx->g_ZigBeeStatus.extPanId));
     if(ret != TW_RESULT_OK)
     {
-        OC_LOG(ERROR, TAG, "AsciiHexToValue - extPanId");
+        OIC_LOG(ERROR, TAG, "AsciiHexToValue - extPanId");
         goto exit;
     }
-    OC_LOG_V(INFO, TAG, "PanId = %" PRId64 "\n", ctx->g_ZigBeeStatus.panId);
-    OC_LOG_V(INFO, TAG, "ExtPanId = %" PRId64 "\n", ctx->g_ZigBeeStatus.extPanId);
+    OIC_LOG_V(INFO, TAG, "PanId = %" PRId64 "\n", ctx->g_ZigBeeStatus.panId);
+    OIC_LOG_V(INFO, TAG, "ExtPanId = %" PRId64 "\n", ctx->g_ZigBeeStatus.extPanId);
     ret = TW_RESULT_NEW_LOCAL_PAN_ESTABLISHED;
 
 exit:
-    OC_LOG_V(INFO, TAG, "Leave TelJpanHandler() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave TelJpanHandler() with ret=%d", ret);
     return ret;
 }
 
@@ -2297,7 +2297,7 @@ TWResultCode TelEndDeviceJoinHandler(int count, char* tokens[], TWContext* ctx)
     //Prompt:   SED:<IEEE Address>,<NodeID>
     //Prompt:   ZED:<IEEE Address>,<NodeID>
 
-    OC_LOG(INFO, TAG, "Enter TelEndDeviceJoinHandler()");
+    OIC_LOG(INFO, TAG, "Enter TelEndDeviceJoinHandler()");
     TWResultCode ret = TW_RESULT_UNKNOWN;
 
     if(!tokens || count != RESPONSE_PARAMS_COUNT_DEVICE_JOINED)
@@ -2307,7 +2307,7 @@ TWResultCode TelEndDeviceJoinHandler(int count, char* tokens[], TWContext* ctx)
     }
 
     //TODO: Might need to add into the list if needed - log it for now.
-    OC_LOG_V(INFO, TAG, "Received RFD/FFD/SED/ZED - EUI:%s; NodeID:%s.\n",
+    OIC_LOG_V(INFO, TAG, "Received RFD/FFD/SED/ZED - EUI:%s; NodeID:%s.\n",
             tokens[TOKEN_PJOIN_RESPONSE_IEEE_ADDRESS],
             tokens[TOKEN_PJOIN_RESPONSE_NODEID]);
 
@@ -2321,7 +2321,7 @@ TWResultCode TelEndDeviceJoinHandler(int count, char* tokens[], TWContext* ctx)
     ret = TW_RESULT_OK;
 
 exit:
-    OC_LOG_V(INFO, TAG, "Leave TelEndDeviceJoinHandler() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave TelEndDeviceJoinHandler() with ret=%d", ret);
     return ret;
 }
 
@@ -2329,7 +2329,7 @@ TWResultCode TelMatchDescHandler(int count, char* tokens[], TWContext* ctx)
 {
     //Prompt:       MatchDesc:0B4A,00,01
 
-    OC_LOG(INFO, TAG, "Enter TelMatchDescHandler()");
+    OIC_LOG(INFO, TAG, "Enter TelMatchDescHandler()");
     TWResultCode ret = TW_RESULT_ERROR;
 
     if(!tokens || count != RESPONSE_PARAMS_COUNT_MATCH_DESC)
@@ -2340,7 +2340,7 @@ TWResultCode TelMatchDescHandler(int count, char* tokens[], TWContext* ctx)
 
     if (strcmp(tokens[TOKEN_MATCHDESC_STATUS_CODE], AT_STR_ERROR_OK) != 0)
     {
-        OC_LOG(INFO, TAG, "MatchDesc prompt contained error status.");
+        OIC_LOG(INFO, TAG, "MatchDesc prompt contained error status.");
         ret = TW_RESULT_ERROR;
         goto exit;
     }
@@ -2350,7 +2350,7 @@ TWResultCode TelMatchDescHandler(int count, char* tokens[], TWContext* ctx)
         ret = GetRemoteEUI(tokens[TOKEN_MATCHDESC_NODEID], remoteEUI, ctx);
         if (ret != TW_RESULT_OK)
         {
-            OC_LOG(ERROR, TAG, "GetRemoteEUI()");
+            OIC_LOG(ERROR, TAG, "GetRemoteEUI()");
             goto exit;
         }
         else
@@ -2446,7 +2446,7 @@ TWResultCode TelMatchDescHandler(int count, char* tokens[], TWContext* ctx)
     }
 
 exit:
-    OC_LOG_V(INFO, TAG, "Leave TelMatchDescHandler() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave TelMatchDescHandler() with ret=%d", ret);
     return ret;
 }
 
@@ -2464,7 +2464,7 @@ TWResultCode TelSimpleDescHandler(int count, char* tokens[], TWContext* ctx)
     //      OutCluster:0019
     //      ACK:97
 
-    OC_LOG(INFO, TAG, "Enter TelSimpleDescHandler().");
+    OIC_LOG(INFO, TAG, "Enter TelSimpleDescHandler().");
     TWResultCode ret = TW_RESULT_UNKNOWN;
 
     if(!tokens || count != RESPONSE_PARAMS_COUNT_SIMPLE_DESC)
@@ -2475,7 +2475,7 @@ TWResultCode TelSimpleDescHandler(int count, char* tokens[], TWContext* ctx)
 
     if (ctx->g_WIPDevice == NULL)
     {
-        OC_LOG_V(ERROR, TAG,
+        OIC_LOG_V(ERROR, TAG,
                  "Receive simple descriptor unexpectedly - %s",
                  tokens[TOKEN_SIMPLEDESC_SIMPLEDESC_NODEID]);
         ret = TW_RESULT_ERROR;
@@ -2484,7 +2484,7 @@ TWResultCode TelSimpleDescHandler(int count, char* tokens[], TWContext* ctx)
 
     if (strcmp(tokens[TOKEN_SIMPLEDESC_SIMPLEDESC_STATUS_CODE], AT_STR_ERROR_OK) != 0)
     {
-        OC_LOG_V(ERROR,
+        OIC_LOG_V(ERROR,
                  TAG,
                  "SimpleDesc: prompt contained error status %s.",
                  tokens[TOKEN_SIMPLEDESC_SIMPLEDESC_STATUS_CODE]);
@@ -2495,7 +2495,7 @@ TWResultCode TelSimpleDescHandler(int count, char* tokens[], TWContext* ctx)
         if (strcmp(tokens[TOKEN_SIMPLEDESC_SIMPLEDESC_NODEID],
                    ctx->g_WIPDevice->nodeId) == 0)
         {
-            OC_LOG_V(INFO,
+            OIC_LOG_V(INFO,
                      TAG,
                      "Got simple descriptor for nodeid %s",
                      tokens[TOKEN_SIMPLEDESC_SIMPLEDESC_NODEID]);
@@ -2503,7 +2503,7 @@ TWResultCode TelSimpleDescHandler(int count, char* tokens[], TWContext* ctx)
         }
         else
         {
-            OC_LOG_V(ERROR,
+            OIC_LOG_V(ERROR,
                      TAG,
                      "Finding simple descriptor for non existing nodeid %s.",
                      tokens[TOKEN_SIMPLEDESC_SIMPLEDESC_NODEID]);
@@ -2512,7 +2512,7 @@ TWResultCode TelSimpleDescHandler(int count, char* tokens[], TWContext* ctx)
     }
 
 exit:
-    OC_LOG_V(INFO, TAG, "Leave TelSimpleDescHandler() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave TelSimpleDescHandler() with ret=%d", ret);
     return ret;
 }
 
@@ -2530,19 +2530,19 @@ TWResultCode TelSimpleDescInClusterHandler(int count, char* tokens[], TWContext*
     //      OutCluster:0019
     //      ACK:97
 
-    OC_LOG(INFO, TAG, "Enter TelSimpleDescInClusterHandler()");
+    OIC_LOG(INFO, TAG, "Enter TelSimpleDescInClusterHandler()");
     TWResultCode ret = TW_RESULT_ERROR;
 
     if (!tokens || count < RESPONSE_PARAMS_COUNT_SIMPLE_DESC_IN_CLUSTER_MIN )
     {
-        OC_LOG(ERROR, TAG, "Invalid Params");
+        OIC_LOG(ERROR, TAG, "Invalid Params");
         ret = TW_RESULT_ERROR_INVALID_PARAMS;
                goto exit;
     }
 
     if (ctx->g_WIPDevice == NULL)
     {
-        OC_LOG_V(ERROR, TAG,
+        OIC_LOG_V(ERROR, TAG,
                  "Receive simple descriptor unexpectedly - %s",
                  tokens[TOKEN_SIMPLEDESC_INCLUSTER_STRING]);
         ret = TW_RESULT_ERROR;
@@ -2551,7 +2551,7 @@ TWResultCode TelSimpleDescInClusterHandler(int count, char* tokens[], TWContext*
 
     if (ctx->g_WIPDevice->endpointOfInterest->clusterList != NULL)
     {
-        OC_LOG(ERROR, TAG, "Expected an empty cluster list.");
+        OIC_LOG(ERROR, TAG, "Expected an empty cluster list.");
         ret = TW_RESULT_ERROR;
         goto exit;
     }
@@ -2561,7 +2561,7 @@ TWResultCode TelSimpleDescInClusterHandler(int count, char* tokens[], TWContext*
             (TWClusterList*)OICMalloc(sizeof(TWClusterList));
     if (ctx->g_WIPDevice->endpointOfInterest->clusterList == NULL)
     {
-        OC_LOG(ERROR, TAG, "No Memory - clusterList");
+        OIC_LOG(ERROR, TAG, "No Memory - clusterList");
         ret = TW_RESULT_ERROR_NO_MEMORY;
         goto exit;
     }
@@ -2571,7 +2571,7 @@ TWResultCode TelSimpleDescInClusterHandler(int count, char* tokens[], TWContext*
     if (ctx->g_WIPDevice->endpointOfInterest->clusterList->clusterIds == NULL)
     {
         OICFree(ctx->g_WIPDevice->endpointOfInterest->clusterList);
-        OC_LOG(ERROR, TAG, "No Memory - clusterIds");
+        OIC_LOG(ERROR, TAG, "No Memory - clusterIds");
         ret = TW_RESULT_ERROR_NO_MEMORY;
         goto exit;
     }
@@ -2583,7 +2583,7 @@ TWResultCode TelSimpleDescInClusterHandler(int count, char* tokens[], TWContext*
                   SIZE_CLUSTERID,
                   tokens[i]);
 
-        OC_LOG_V(INFO, TAG, "ClusterIds[%d]=%s",
+        OIC_LOG_V(INFO, TAG, "ClusterIds[%d]=%s",
                  i,
                  ctx->g_WIPDevice->endpointOfInterest->clusterList->clusterIds[i].clusterId);
     }
@@ -2591,7 +2591,7 @@ TWResultCode TelSimpleDescInClusterHandler(int count, char* tokens[], TWContext*
     ret = TW_RESULT_HAS_CLUSTERS;
 
 exit:
-    OC_LOG_V(INFO, TAG, "Leave TelSimpleDescInClusterHandler() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave TelSimpleDescInClusterHandler() with ret=%d", ret);
     return ret;
 }
 
@@ -2605,7 +2605,7 @@ TWResultCode TelWriteAttrHandler(int count, char* tokens[], TWContext* ctx)
     //      OK
     //      WRITEATTR:B826,01,0500,0010,70
 
-    OC_LOG(INFO, TAG, "Enter TelWriteAttrHandler()");
+    OIC_LOG(INFO, TAG, "Enter TelWriteAttrHandler()");
     (void)ctx;
 
     TWResultCode ret = TW_RESULT_ERROR;
@@ -2643,7 +2643,7 @@ TWResultCode TelWriteAttrHandler(int count, char* tokens[], TWContext* ctx)
     }
 
 exit:
-    OC_LOG_V(INFO, TAG, "Leave TelWriteAttrHandler() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave TelWriteAttrHandler() with ret=%d", ret);
     return ret;
 }
 
@@ -2657,19 +2657,19 @@ TWResultCode TelReadAttrHandlerTemperature(int count, char* tokens[], TWContext*
     //      OK
     //      ERROR:66
 
-    OC_LOG(INFO, TAG, "Enter TelReadAttrHandlerTemperature().");
+    OIC_LOG(INFO, TAG, "Enter TelReadAttrHandlerTemperature().");
     TWResultCode ret = TW_RESULT_UNKNOWN;
 
     if(!tokens || count != RESPONSE_PARAMS_COUNT_TEMPERATURE)
     {
-        OC_LOG(ERROR, TAG, "Invalid Params");
+        OIC_LOG(ERROR, TAG, "Invalid Params");
         ret = TW_RESULT_ERROR_INVALID_PARAMS;
         goto exit;
     }
 
     if (strcmp(tokens[TOKEN_TEMPERATURE_STATUS_CODE], AT_STR_ERROR_OK) != 0)
     {
-        OC_LOG(ERROR, TAG, "TEMPERATURE prompt contained error status.");
+        OIC_LOG(ERROR, TAG, "TEMPERATURE prompt contained error status.");
         ret = TW_RESULT_ERROR;
         goto exit;
     }
@@ -2681,12 +2681,12 @@ TWResultCode TelReadAttrHandlerTemperature(int count, char* tokens[], TWContext*
         OICFree(ctx->g_ZigBeeStatus.remoteAttributeValueRead);
         ctx->g_ZigBeeStatus.remoteAttributeValueRead = NULL;
     }
-    OC_LOG_V(INFO, TAG, "Read Attribute Value: %s", tokens[TOKEN_TEMPERATURE_VALUE]);
+    OIC_LOG_V(INFO, TAG, "Read Attribute Value: %s", tokens[TOKEN_TEMPERATURE_VALUE]);
     ctx->g_ZigBeeStatus.remoteAttributeValueRead =
             (char*)OICMalloc(sizeof(char) * strlen(tokens[TOKEN_TEMPERATURE_VALUE]));
     if (ctx->g_ZigBeeStatus.remoteAttributeValueRead == NULL)
     {
-        OC_LOG_V(ERROR, TAG, "No Memory");
+        OIC_LOG_V(ERROR, TAG, "No Memory");
         ret = TW_RESULT_ERROR_NO_MEMORY;
     }
     else
@@ -2699,7 +2699,7 @@ TWResultCode TelReadAttrHandlerTemperature(int count, char* tokens[], TWContext*
     }
 
 exit:
-    OC_LOG_V(INFO, TAG, "Leave TelReadAttrHandlerTemperature() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave TelReadAttrHandlerTemperature() with ret=%d", ret);
     return ret;
 }
 
@@ -2713,19 +2713,19 @@ TWResultCode TelReadAttrHandler(int count, char* tokens[], TWContext* ctx)
     //      OK
     //      ERROR:66
 
-    OC_LOG(INFO, TAG, "Enter TelReadAttrHandler()");
+    OIC_LOG(INFO, TAG, "Enter TelReadAttrHandler()");
     TWResultCode ret = TW_RESULT_UNKNOWN;
 
     if(!tokens || count != RESPONSE_PARAMS_COUNT_RESPATTR)
     {
-        OC_LOG(ERROR, TAG, "Invalid Params");
+        OIC_LOG(ERROR, TAG, "Invalid Params");
         ret = TW_RESULT_ERROR_INVALID_PARAMS;
         goto exit;
     }
 
     if (strcmp(tokens[TOKEN_RESPATTR_STATUS_CODE], AT_STR_ERROR_OK) != 0)
     {
-        OC_LOG(INFO, TAG, "READATTR prompt contained error status.");
+        OIC_LOG(INFO, TAG, "READATTR prompt contained error status.");
         ret = TW_RESULT_ERROR;
         goto exit;
     }
@@ -2734,7 +2734,7 @@ TWResultCode TelReadAttrHandler(int count, char* tokens[], TWContext* ctx)
     {
         OICFree(ctx->g_ZigBeeStatus.remoteAttributeValueRead);
     }
-    OC_LOG_V(INFO, TAG, "Read Attribute Value: %s.", tokens[TOKEN_RESPATTR_ATTRIBUTE_VALUE]);
+    OIC_LOG_V(INFO, TAG, "Read Attribute Value: %s.", tokens[TOKEN_RESPATTR_ATTRIBUTE_VALUE]);
     ctx->g_ZigBeeStatus.remoteAttributeValueRead =
             (char*)OICMalloc(sizeof(char) * strlen(tokens[TOKEN_RESPATTR_ATTRIBUTE_VALUE]));
     if (ctx->g_ZigBeeStatus.remoteAttributeValueRead != NULL)
@@ -2747,12 +2747,12 @@ TWResultCode TelReadAttrHandler(int count, char* tokens[], TWContext* ctx)
     }
     else
     {
-        OC_LOG(ERROR, TAG, "No Memory");
+        OIC_LOG(ERROR, TAG, "No Memory");
         ret = TW_RESULT_ERROR_NO_MEMORY;
     }
 
 exit:
-    OC_LOG(INFO, TAG, "Leave TelReadAttrHandler()");
+    OIC_LOG(INFO, TAG, "Leave TelReadAttrHandler()");
     return ret;
 }
 
@@ -2767,18 +2767,18 @@ TWResultCode TelZCLDefaultResponseHandler(int count, char* tokens[], TWContext*
     //AT+LCMVTOLEV:<Address>,<EP>,<SendMode>,<ON/OFF>,<LevelValue>,<TransTime>
     //      DFTREP:<NodeID>,<EP>,<ClusterID>,<CMD>,<Status>
 
-    OC_LOG(INFO, TAG, "Enter TelZCLDefaultResponseHandler()");
+    OIC_LOG(INFO, TAG, "Enter TelZCLDefaultResponseHandler()");
     (void)ctx;
     TWResultCode ret = TW_RESULT_UNKNOWN;
 
     if(!tokens || count != RESPONSE_PARAMS_COUNT_DFTREP)
     {
-        OC_LOG(ERROR, TAG, "Invalid Params");
+        OIC_LOG(ERROR, TAG, "Invalid Params");
         ret = TW_RESULT_ERROR_INVALID_PARAMS;
         goto exit;
     }
 
-    OC_LOG_V(INFO, TAG,
+    OIC_LOG_V(INFO, TAG,
              "DFTREP prompt succeed for NodeId:%s, EP:%s, ClusterId:%s, CMD:%s.\n",
              tokens[TOKEN_DFTREP_NODEID],
              tokens[TOKEN_DFTREP_ENDPOINTID],
@@ -2795,7 +2795,7 @@ TWResultCode TelZCLDefaultResponseHandler(int count, char* tokens[], TWContext*
     }
 
 exit:
-    OC_LOG(INFO, TAG, "Leave TelZCLDefaultResponseHandler()");
+    OIC_LOG(INFO, TAG, "Leave TelZCLDefaultResponseHandler()");
     return ret;
 }
 
@@ -2806,20 +2806,20 @@ TWResultCode TelSwitchDoorLockStateHandler(int count, char* tokens[], TWContext*
     //      or
     //      DRUNLOCKRSP:<nodeID>,<ep>,<status>
 
-    OC_LOG(INFO, TAG, "Enter TelSwitchDoorLockStateHandler()");
+    OIC_LOG(INFO, TAG, "Enter TelSwitchDoorLockStateHandler()");
     (void)ctx;
     TWResultCode ret = TW_RESULT_UNKNOWN;
 
     if(!tokens || count != RESPONSE_PARAMS_COUNT_DRLOCKUNLOCKRSP)
     {
-        OC_LOG(ERROR, TAG, "Invalid Params");
+        OIC_LOG(ERROR, TAG, "Invalid Params");
         ret = TW_RESULT_ERROR_INVALID_PARAMS;
         goto exit;
     }
 
     if (strcmp(tokens[TOKEN_DRLOCKRSP_STATUS_CODE], AT_STR_ERROR_OK) != 0)
     {
-        OC_LOG_V(INFO,
+        OIC_LOG_V(INFO,
                  TAG,
                  "DRLOCRSP/DRUNLOCKRSP prompt contained error status %s.",
                  tokens[TOKEN_DRLOCKRSP_STATUS_CODE]);
@@ -2827,14 +2827,14 @@ TWResultCode TelSwitchDoorLockStateHandler(int count, char* tokens[], TWContext*
     }
     else
     {
-        OC_LOG_V(INFO, TAG, "DRLOCRSP/DRUNLOCKRSP prompt succeed for nodeId:%s, ep:%s.",
+        OIC_LOG_V(INFO, TAG, "DRLOCRSP/DRUNLOCKRSP prompt succeed for nodeId:%s, ep:%s.",
                  tokens[TOKEN_DRLOCKRSP_NODEID],
                  tokens[TOKEN_DRLOCKRSP_ENDPOINTID]);
         ret = TW_RESULT_OK;
     }
 
 exit:
-    OC_LOG_V(INFO, TAG, "Leave TelSwitchDoorLockStateHandler() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave TelSwitchDoorLockStateHandler() with ret=%d", ret);
     return ret;
 }
 
@@ -2842,26 +2842,26 @@ TWResultCode TelZoneEnrollRequestHandler(int count, char* tokens[], TWContext* c
 {
     //ZENROLLREQ:<NodeID>,<EndPoint>,<ZoneType>,<ManufactureCode>
 
-    OC_LOG(INFO, TAG, "Enter TelZoneEnrollRequestHandler()");
+    OIC_LOG(INFO, TAG, "Enter TelZoneEnrollRequestHandler()");
     (void)ctx;
     TWResultCode ret = TW_RESULT_UNKNOWN;
 
     if(!tokens || count != RESPONSE_PARAMS_COUNT_ZENROLLREQ)
     {
-        OC_LOG(ERROR, TAG, "Invalid Params");
+        OIC_LOG(ERROR, TAG, "Invalid Params");
         ret = TW_RESULT_ERROR_INVALID_PARAMS;
         goto exit;
     }
 
-    OC_LOG(INFO, TAG, "Received zone request from:");
-    OC_LOG_V(INFO, TAG, "Node:%s", tokens[TOKEN_ZENROLLREQ_NODEID]);
-    OC_LOG_V(INFO, TAG, "EP:%s", tokens[TOKEN_ZENROLLREQ_ENDPOINTID]);
-    OC_LOG_V(INFO, TAG, "ZoneType:%s", tokens[TOKEN_ZENROLLREQ_ZONETYPE]);
-    OC_LOG_V(INFO, TAG, "ManufactureCode:%s", tokens[TOKEN_ZENROLLREQ_MANUFACTURE_CODE]);
+    OIC_LOG(INFO, TAG, "Received zone request from:");
+    OIC_LOG_V(INFO, TAG, "Node:%s", tokens[TOKEN_ZENROLLREQ_NODEID]);
+    OIC_LOG_V(INFO, TAG, "EP:%s", tokens[TOKEN_ZENROLLREQ_ENDPOINTID]);
+    OIC_LOG_V(INFO, TAG, "ZoneType:%s", tokens[TOKEN_ZENROLLREQ_ZONETYPE]);
+    OIC_LOG_V(INFO, TAG, "ManufactureCode:%s", tokens[TOKEN_ZENROLLREQ_MANUFACTURE_CODE]);
     ret = TW_RESULT_OK;
 
 exit:
-    OC_LOG_V(INFO, TAG, "Leave TelZoneEnrollRequestHandler() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave TelZoneEnrollRequestHandler() with ret=%d", ret);
     return ret;
 }
 
@@ -2869,20 +2869,20 @@ TWResultCode TelEnrolledHandler(int count, char* tokens[], TWContext* ctx)
 {
     //ENROLLED:<ZID>,<ZoneType>,<EUI>
 
-    OC_LOG(INFO, TAG, "Enter TelEnrolledHandler()");
+    OIC_LOG(INFO, TAG, "Enter TelEnrolledHandler()");
     TWResultCode ret = TW_RESULT_OK;
 
     if(!tokens || count != RESPONSE_PARAMS_COUNT_ENROLLED)
     {
-        OC_LOG(ERROR, TAG, "Invalid Params");
+        OIC_LOG(ERROR, TAG, "Invalid Params");
         ret = TW_RESULT_ERROR_INVALID_PARAMS;
         goto exit;
     }
 
-    OC_LOG(INFO, TAG, "Received zone enrollment for:");
-    OC_LOG_V(INFO, TAG, "ZID:%s", tokens[TOKEN_ENROLLED_ZONEID]);
-    OC_LOG_V(INFO, TAG, "ZoneType:%s", tokens[TOKEN_ENROLLED_ZONETYPE]);
-    OC_LOG_V(INFO, TAG, "EUI:%s", tokens[TOKEN_ENROLLED_EUI]);
+    OIC_LOG(INFO, TAG, "Received zone enrollment for:");
+    OIC_LOG_V(INFO, TAG, "ZID:%s", tokens[TOKEN_ENROLLED_ZONEID]);
+    OIC_LOG_V(INFO, TAG, "ZoneType:%s", tokens[TOKEN_ENROLLED_ZONETYPE]);
+    OIC_LOG_V(INFO, TAG, "EUI:%s", tokens[TOKEN_ENROLLED_EUI]);
 
     TWEnrollee enrollee;
     OICStrcpy(enrollee.zoneId, SIZE_ZONEID, tokens[TOKEN_ENROLLED_ZONEID]);
@@ -2891,13 +2891,13 @@ TWResultCode TelEnrolledHandler(int count, char* tokens[], TWContext* ctx)
 
     if (ctx->g_EnrollmentSucceedCallback != NULL)
     {
-        OC_LOG_V(INFO, TAG, "Enrolled - Invoke callback");
+        OIC_LOG_V(INFO, TAG, "Enrolled - Invoke callback");
         ctx->g_EnrollmentSucceedCallback(&enrollee, ctx->g_plugin);
     }
     ret = TW_RESULT_OK;
 
 exit:
-    OC_LOG_V(INFO, TAG, "Leave TelEnrolledHandler() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave TelEnrolledHandler() with ret=%d", ret);
     return ret;
 }
 
@@ -2906,13 +2906,13 @@ TWResultCode TelZoneStatusHandler(int count, char* tokens[], TWContext* ctx)
     //ZONESTATUS:<NodeID>,<EP>,<ZoneStatus>,<ExtendStatus>[,<ZoneID>,<Delay>]
     //ZONESTATUS:5FBA,01,0021,00,01,00AF
 
-    OC_LOG(INFO, TAG, "Enter TelZoneStatusHandler()");
+    OIC_LOG(INFO, TAG, "Enter TelZoneStatusHandler()");
     TWResultCode ret = TW_RESULT_UNKNOWN;
     if(!tokens ||
        ((count != RESPONSE_PARAMS_COUNT_ZONESTATUS_4) &&
         (count != RESPONSE_PARAMS_COUNT_ZONESTATUS_6)))
     {
-        OC_LOG(ERROR, TAG, "Invalid Params");
+        OIC_LOG(ERROR, TAG, "Invalid Params");
         ret = TW_RESULT_ERROR_INVALID_PARAMS;
         goto exit;
     }
@@ -2931,14 +2931,14 @@ TWResultCode TelZoneStatusHandler(int count, char* tokens[], TWContext* ctx)
 
     if (ctx->g_DeviceStatusUpdateCallback != NULL)
     {
-        OC_LOG(INFO, TAG, "device status update - invoke callback");
+        OIC_LOG(INFO, TAG, "device status update - invoke callback");
         ctx->g_DeviceStatusUpdateCallback(&update, ctx->g_plugin);
-        OC_LOG(INFO, TAG, "device status update - callback done");
+        OIC_LOG(INFO, TAG, "device status update - callback done");
     }
     ret = TW_RESULT_OK;
 
 exit:
-    OC_LOG_V(INFO, TAG, "Leave TelZoneStatusHandler() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave TelZoneStatusHandler() with ret=%d", ret);
     return ret;
 }
 
@@ -2953,11 +2953,11 @@ exit:
  */
 int Tokenize(const char *input, const char* delimiters, char* output[])
 {
-    OC_LOG_V(INFO, TAG, "Enter Tokenize() - %s", input);
+    OIC_LOG_V(INFO, TAG, "Enter Tokenize() - %s", input);
 
     if (output == NULL)
     {
-        OC_LOG(INFO, TAG, "Invalid parameter.");
+        OIC_LOG(INFO, TAG, "Invalid parameter.");
         return -1;
     }
 
@@ -2973,13 +2973,13 @@ int Tokenize(const char *input, const char* delimiters, char* output[])
         int size = strlen(p) + 1;   //for null char
         output[index] = (char*)OICCalloc(size, sizeof(char));
         OICStrcpy(output[index], size, p);
-        OC_LOG_V(INFO, TAG, "Token[%d]=%s", index, output[index]);
+        OIC_LOG_V(INFO, TAG, "Token[%d]=%s", index, output[index]);
         p = strtok_r (NULL, delimiters, &savePtr);
         index++;
     }
 
     OICFree(str);
-    OC_LOG(INFO, TAG, "Leave Tokenize()");
+    OIC_LOG(INFO, TAG, "Leave Tokenize()");
     return index;
 }
 
@@ -3007,7 +3007,7 @@ TWResultCode AsciiHexToValue(char* hexString, int length, uint64_t* value)
     int retVal = AsciiToHex(hexString[0]);
     if(retVal == -1)
     {
-        OC_LOG(ERROR, TAG, "Bad conversion from ASCII To Hex.");
+        OIC_LOG(ERROR, TAG, "Bad conversion from ASCII To Hex.");
         return TW_RESULT_ERROR;
     }
     *value = (uint64_t)retVal;
@@ -3019,7 +3019,7 @@ TWResultCode AsciiHexToValue(char* hexString, int length, uint64_t* value)
             retVal = AsciiToHex(hexString[i]);
             if(retVal == -1)
             {
-                OC_LOG(ERROR, TAG, "Bad conversion from ASCII To Hex.");
+                OIC_LOG(ERROR, TAG, "Bad conversion from ASCII To Hex.");
                 return TW_RESULT_ERROR;
             }
             *value |= (uint64_t)retVal;
index 57330cb..0bfa9a8 100644 (file)
@@ -80,7 +80,7 @@ TWResultCode TWAddTWSock(TWSock * sock, PIPlugin_Zigbee * plugin, const char * f
     sock->fd = open(fileLoc, O_RDWR | O_NOCTTY | O_SYNC);
     if(sock->fd <= 0)
     {
-        OC_LOG_V(INFO, TAG, "Could not open port. Errno is: %d\n", errno);
+        OIC_LOG_V(INFO, TAG, "Could not open port. Errno is: %d\n", errno);
         return TW_RESULT_ERROR;
     }
 
@@ -137,7 +137,7 @@ TWResultCode TWCloseTWSock(TWSock * sock)
     int ret = close(sock->fd);
     if(ret != 0)
     {
-        OC_LOG_V(ERROR, TAG, "Could not close port. Errno is: %d", errno);
+        OIC_LOG_V(ERROR, TAG, "Could not close port. Errno is: %d", errno);
         return TW_RESULT_ERROR;
     }
     return TW_RESULT_OK;
@@ -166,7 +166,7 @@ TWResultCode TWDeleteTWSock(TWSock * sock)
     int mutexRet = pthread_mutex_destroy(&(sock->mutex));
     if(mutexRet != 0)
     {
-        OC_LOG_V(ERROR, TAG, "Failed to destroy mutex. Error: %d", mutexRet);
+        OIC_LOG_V(ERROR, TAG, "Failed to destroy mutex. Error: %d", mutexRet);
         return TW_RESULT_ERROR;
     }
     TWResultCode result = TWCloseTWSock(sock);
@@ -192,7 +192,7 @@ TWResultCode TWDeleteAllTWSock()
  */
 int SetTerminalInfo(int fd, int speed, int parity, int shouldBlock)
 {
-    OC_LOG(INFO, TAG, "Enter SetTerminalInfo()");
+    OIC_LOG(INFO, TAG, "Enter SetTerminalInfo()");
 
     int ret = 0;
     struct termios terminalInfo = {
@@ -203,7 +203,7 @@ int SetTerminalInfo(int fd, int speed, int parity, int shouldBlock)
     ret = tcgetattr(fd, &terminalInfo);
     if (ret != 0)
     {
-        OC_LOG_V(ERROR, TAG, "tcgetattr() - ret=%d errno=%d", ret, errno);
+        OIC_LOG_V(ERROR, TAG, "tcgetattr() - ret=%d errno=%d", ret, errno);
         ret = -1;
         goto exit;
     }
@@ -212,7 +212,7 @@ int SetTerminalInfo(int fd, int speed, int parity, int shouldBlock)
     ret = cfsetispeed (&terminalInfo, speed);
     if (ret != 0)
     {
-        OC_LOG_V(ERROR, TAG, "cfsetispeed() - ret=%d errno=%d", ret, errno);
+        OIC_LOG_V(ERROR, TAG, "cfsetispeed() - ret=%d errno=%d", ret, errno);
         ret = -1;
         goto exit;
     }
@@ -221,7 +221,7 @@ int SetTerminalInfo(int fd, int speed, int parity, int shouldBlock)
     ret = cfsetospeed (&terminalInfo, speed);
     if (ret != 0)
     {
-        OC_LOG_V(ERROR, TAG, "cfsetospeed() - ret=%d errno=%d", ret, errno);
+        OIC_LOG_V(ERROR, TAG, "cfsetospeed() - ret=%d errno=%d", ret, errno);
         ret = -1;
         goto exit;
     }
@@ -253,11 +253,11 @@ int SetTerminalInfo(int fd, int speed, int parity, int shouldBlock)
     ret = tcsetattr (fd, TCSANOW, &terminalInfo);
     if (ret != 0)
     {
-        OC_LOG_V(ERROR, TAG, "tcsetattr - ret=%d errno=%d", ret, errno);
+        OIC_LOG_V(ERROR, TAG, "tcsetattr - ret=%d errno=%d", ret, errno);
         ret = -1;
     }
 
 exit:
-    OC_LOG_V(INFO, TAG, "Leave SetTerminalInfo() with ret=%d", ret);
+    OIC_LOG_V(INFO, TAG, "Leave SetTerminalInfo() with ret=%d", ret);
     return ret;
 }
index ac2f115..ec591d1 100644 (file)
@@ -183,24 +183,15 @@ typedef enum {
 #define OIC_LOG_V(level,tag,fmt,args...) LOG_(LOG_ID_MAIN, level, tag, fmt, ##args)
 #define OIC_LOG_BUFFER(level, tag, buffer, bufferSize)
 
-#define OC_LOG(level,tag,mes) LOG_(LOG_ID_MAIN, (level), (tag), mes)
-#define OC_LOG_V(level,tag,fmt,args...) LOG_(LOG_ID_MAIN, (level), (tag), fmt, ##args)
-#define OC_LOG_BUFFER(level, tag, buffer, bufferSize)
-
 #else // These macros are defined for Linux, Android, and Arduino
 
-#define OC_LOG_INIT()    OCLogInit()
 #define OIC_LOG_INIT()    OCLogInit()
 
 #ifdef ARDUINO
 
-#define OC_LOG_BUFFER(level, tag, buffer, bufferSize)  OCLogBuffer((level), PCF(tag), (buffer), (bufferSize))
 #define OIC_LOG_BUFFER(level, tag, buffer, bufferSize)  OCLogBuffer((level), PCF(tag), (buffer), (bufferSize))
-#define OC_LOG_CONFIG(ctx)
-#define OC_LOG_SHUTDOWN()
-#define OC_LOG(level, tag, logStr)  OCLog((level), PCF(tag), __LINE__, PCF(logStr))
 // Don't define variable argument log function for Arduino
-#define OC_LOG_V(level, tag, format, ...) OCLogv((level), PCF(tag), __LINE__, PCF(format),__VA_ARGS__)
+#define OIC_LOG_V(level, tag, format, ...) OCLogv((level), PCF(tag), __LINE__, PCF(format),__VA_ARGS__)
 
 #define OIC_LOG_CONFIG(ctx)
 #define OIC_LOG_SHUTDOWN()
@@ -209,14 +200,7 @@ typedef enum {
 
 #else
 
-#define OC_LOG_BUFFER(level, tag, buffer, bufferSize)  OCLogBuffer((level), (tag), (buffer), (bufferSize))
 #define OIC_LOG_BUFFER(level, tag, buffer, bufferSize)  OCLogBuffer((level), (tag), (buffer), (bufferSize))
-#define OC_LOG_CONFIG(ctx)    OCLogConfig((ctx))
-#define OC_LOG_SHUTDOWN()     OCLogShutdown()
-#define OC_LOG(level, tag, logStr)  OCLog((level), (tag), (logStr))
-// Define variable argument log function for Linux and Android
-#define OC_LOG_V(level, tag, ...) OCLogv((level), (tag), __VA_ARGS__)
-
 #define OIC_LOG_CONFIG(ctx)    OCLogConfig((ctx))
 #define OIC_LOG_SHUTDOWN()     OCLogShutdown()
 #define OIC_LOG(level, tag, logStr)  OCLog((level), (tag), (logStr))
@@ -228,13 +212,6 @@ typedef enum {
 
 #else //TB_LOG
 
-#define OC_LOG_CONFIG(ctx)
-#define OC_LOG_SHUTDOWN()
-#define OC_LOG(level, tag, logStr)
-#define OC_LOG_V(level, tag, ...)
-#define OC_LOG_BUFFER(level, tag, buffer, bufferSize)
-#define OC_LOG_INIT()
-
 #define OIC_LOG_CONFIG(ctx)
 #define OIC_LOG_SHUTDOWN()
 #define OIC_LOG(level, tag, logStr)
index e9d264a..52120c1 100644 (file)
@@ -39,31 +39,31 @@ static const char multiLineMsg[] = "this is a DEBUG message\non multiple\nlines"
 //  Tests
 //-----------------------------------------------------------------------------
 static void test0() {
-  OC_LOG(INFO, tag, msg);
+  OIC_LOG(INFO, tag, msg);
 }
 
 static void test1() {
-  OC_LOG(INFO, 0, msg);
+  OIC_LOG(INFO, 0, msg);
 }
 
 static void test2() {
-  OC_LOG(INFO, tag, 0);
+  OIC_LOG(INFO, tag, 0);
 }
 
 static void test3() {
-  OC_LOG(INFO, 0, 0);
+  OIC_LOG(INFO, 0, 0);
 }
 
 static 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);
 }
 
 static void test5() {
-  OC_LOG(DEBUG, tag, multiLineMsg);
+  OIC_LOG(DEBUG, tag, multiLineMsg);
 }
 
 
@@ -73,42 +73,42 @@ static 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);
 }
 
 static void test7() {
-  OC_LOG_V(DEBUG, tag, "this is a char: %c", 'A');
-  OC_LOG_V(DEBUG, tag, "this is an integer: %d", 123);
-  OC_LOG_V(DEBUG, tag, "this is a string: %s", "hello");
-  OC_LOG_V(DEBUG, tag, "this is a float: %5.2f", 123.45);
+  OIC_LOG_V(DEBUG, tag, "this is a char: %c", 'A');
+  OIC_LOG_V(DEBUG, tag, "this is an integer: %d", 123);
+  OIC_LOG_V(DEBUG, tag, "this is a string: %s", "hello");
+  OIC_LOG_V(DEBUG, tag, "this is a float: %5.2f", 123.45);
 }
 
 //-----------------------------------------------------------------------------
 //  loggertests
 //-----------------------------------------------------------------------------
 void loggertests() {
-  OC_LOG(INFO, tag, "Starting logger test");
+  OIC_LOG(INFO, tag, "Starting logger test");
 
   test0();
   test1();
index a1a6987..450e544 100644 (file)
 //  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);
 }
 
 
@@ -73,35 +73,35 @@ 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);
 }
 
 //The setup function is called once at startup of the sketch
 void setup()
 {
     // Add your initialization code here
-    OC_LOG_INIT();
+    OIC_LOG_INIT();
 
     test0();
     delay(2000);
index 27971ba..9e7b59a 100644 (file)
@@ -136,7 +136,7 @@ TEST(LoggerTest, StringArg) {
 
     directStdOutToFile(testFile);
     const char *tag = "StringArg";
-       OC_LOG(INFO, tag, "This is a fixed string call");
+       OIC_LOG(INFO, tag, "This is a fixed string call");
     directStdOutToConsole();
 
     bool testFileExists = file_exist(testFile);
@@ -160,7 +160,7 @@ TEST(LoggerTest, StringArgNoTag) {
     char stdFile[]  = "std_stringargnotag.txt";
 
     directStdOutToFile(testFile);
-    OC_LOG(INFO, 0, "This is a fixed string call");
+    OIC_LOG(INFO, 0, "This is a fixed string call");
     directStdOutToConsole();
 
     bool testFileExists = file_exist(testFile);
@@ -185,7 +185,7 @@ TEST(LoggerTest, StringArgNoLogStr) {
 
     directStdOutToFile(testFile);
     const char *tag = "StringArgNoLogStr";
-    OC_LOG(INFO, tag, 0);
+    OIC_LOG(INFO, tag, 0);
     directStdOutToConsole();
 
     bool testFileExists = file_exist(testFile);
@@ -209,7 +209,7 @@ TEST(LoggerTest, StringArgNoTagNoLogStr) {
     char stdFile[]  = "std_stringargnotagnologstr.txt";
 
     directStdOutToFile(testFile);
-    OC_LOG(INFO, 0, 0);
+    OIC_LOG(INFO, 0, 0);
     directStdOutToConsole();
 
     bool testFileExists = file_exist(testFile);
@@ -235,11 +235,11 @@ TEST(LoggerTest, StringArgLevels) {
     directStdOutToFile(testFile);
     const char *tag = "StringArgLevels";
     // DEBUG, INFO, WARNING, ERROR, FATAL
-    OC_LOG(DEBUG, tag, "this is a DEBUG message");
-    OC_LOG(INFO, tag, "this is a INFO message");
-    OC_LOG(WARNING, tag, "this is a WARNING message");
-    OC_LOG(ERROR, tag, "this is a ERROR message");
-    OC_LOG(FATAL, tag, "this is a FATAL message");
+    OIC_LOG(DEBUG, tag, "this is a DEBUG message");
+    OIC_LOG(INFO, tag, "this is a INFO message");
+    OIC_LOG(WARNING, tag, "this is a WARNING message");
+    OIC_LOG(ERROR, tag, "this is a ERROR message");
+    OIC_LOG(FATAL, tag, "this is a FATAL message");
     directStdOutToConsole();
 
     bool testFileExists = file_exist(testFile);
@@ -264,7 +264,7 @@ TEST(LoggerTest, StringArgMultiline) {
 
     directStdOutToFile(testFile);
     const char *tag = "StringArgMultiline";
-    OC_LOG(DEBUG, tag, "this is a DEBUG message\non multiple\nlines");
+    OIC_LOG(DEBUG, tag, "this is a DEBUG message\non multiple\nlines");
     directStdOutToConsole();
 
     bool testFileExists = file_exist(testFile);
@@ -290,10 +290,10 @@ TEST(LoggerTest, VariableArg) {
     directStdOutToFile(testFile);
     const char *tag = "VariableArg";
     // DEBUG, INFO, WARNING, ERROR, FATAL
-    OC_LOG_V(DEBUG, tag, "this is a char: %c", 'A');
-    OC_LOG_V(DEBUG, tag, "this is an integer: %d", 123);
-    OC_LOG_V(DEBUG, tag, "this is a string: %s", "hello");
-    OC_LOG_V(DEBUG, tag, "this is a float: %5.2f", 123.45);
+    OIC_LOG_V(DEBUG, tag, "this is a char: %c", 'A');
+    OIC_LOG_V(DEBUG, tag, "this is an integer: %d", 123);
+    OIC_LOG_V(DEBUG, tag, "this is a string: %s", "hello");
+    OIC_LOG_V(DEBUG, tag, "this is a float: %5.2f", 123.45);
     directStdOutToConsole();
 
     bool testFileExists = file_exist(testFile);
@@ -324,28 +324,28 @@ TEST(LoggerTest, LogBuffer) {
     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);
 
     directStdOutToConsole();
 
index 69b9258..07a5dc5 100644 (file)
@@ -65,7 +65,7 @@ extern "C"
  */
 #define RM_NULL_CHECK_WITH_RET(arg, log_tag, log_message) \
     if (NULL == arg ){ \
-        OC_LOG_V(ERROR, log_tag, "Invalid input:%s", log_message); \
+        OIC_LOG_V(ERROR, log_tag, "Invalid input:%s", log_message); \
         return OC_STACK_INVALID_PARAM; \
     } \
 
@@ -74,7 +74,7 @@ extern "C"
  */
 #define RM_NULL_CHECK_VOID(arg, log_tag, log_message) \
     if (NULL == arg ){ \
-        OC_LOG_V(ERROR, log_tag, "Invalid input:%s", log_message); \
+        OIC_LOG_V(ERROR, log_tag, "Invalid input:%s", log_message); \
         return; \
     } \
 
@@ -82,7 +82,7 @@ extern "C"
  * Macro to verify the return of an API.
  */
 #define RM_VERIFY_SUCCESS(op, successCode) { if (op != successCode) \
-            {OC_LOG_V(ERROR, TAG, "%s failed!!", #op); goto exit;} }
+            {OIC_LOG_V(ERROR, TAG, "%s failed!!", #op); goto exit;} }
 
 /**
  * Message types in RouteOption to differentiate a normal response and Empty response.
index 90c3192..b87e2c1 100644 (file)
@@ -40,7 +40,6 @@ extern "C"
 #define PL_TAG "PayloadLog"
 
 #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);
index 1601a9c..8263100 100644 (file)
@@ -487,7 +487,7 @@ OCStackResult HandleSingleResponse(OCEntityHandlerResponse * ehResponse)
 
     if(!ehResponse || !ehResponse->requestHandle)
     {
-        OC_LOG(ERROR, TAG, "ehResponse/requestHandle is NULL");
+        OIC_LOG(ERROR, TAG, "ehResponse/requestHandle is NULL");
         return OC_STACK_ERROR;
     }
 
index 6c5b07a..21090ac 100644 (file)
@@ -44,15 +44,15 @@ static const uint64_t USECS_PER_SEC = 1000000;
 // Macros
 //-----------------------------------------------------------------------------
 #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); } }
 
-#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_V(FATAL, TAG, "%s is NULL", #arg);\
+#define VERIFY_NON_NULL_V(arg) { if (!arg) {OIC_LOG_V(FATAL, TAG, "%s is NULL", #arg);\
     goto exit;} }
 
 /**
@@ -188,10 +188,10 @@ static OCStackResult RemoveKeepAliveEntry(const CAEndpoint_t *endpoint);
 
 OCStackResult InitializeKeepAlive()
 {
-    OC_LOG(DEBUG, TAG, "InitializeKeepAlive IN");
+    OIC_LOG(DEBUG, TAG, "InitializeKeepAlive IN");
     if (g_isKeepAliveInitialized)
     {
-        OC_LOG(DEBUG, TAG, "KeepAlive already initialized");
+        OIC_LOG(DEBUG, TAG, "KeepAlive already initialized");
         return OC_STACK_OK;
     }
 
@@ -199,7 +199,7 @@ OCStackResult InitializeKeepAlive()
     OCStackResult result = CreateKeepAliveResource();
     if (OC_STACK_OK != result)
     {
-        OC_LOG_V(ERROR, TAG, "CreateKeepAliveResource failed[%d]", result);
+        OIC_LOG_V(ERROR, TAG, "CreateKeepAliveResource failed[%d]", result);
         return result;
     }
 
@@ -208,7 +208,7 @@ OCStackResult InitializeKeepAlive()
         g_keepAliveConnectionTable = u_arraylist_create();
         if (NULL == g_keepAliveConnectionTable)
         {
-            OC_LOG(ERROR, TAG, "Creating KeepAlive Table failed");
+            OIC_LOG(ERROR, TAG, "Creating KeepAlive Table failed");
             TerminateKeepAlive();
             return OC_STACK_ERROR;
         }
@@ -216,16 +216,16 @@ OCStackResult InitializeKeepAlive()
 
     g_isKeepAliveInitialized = true;
 
-    OC_LOG(DEBUG, TAG, "InitializeKeepAlive OUT");
+    OIC_LOG(DEBUG, TAG, "InitializeKeepAlive OUT");
     return OC_STACK_OK;
 }
 
 OCStackResult TerminateKeepAlive()
 {
-    OC_LOG(DEBUG, TAG, "TerminateKeepAlive IN");
+    OIC_LOG(DEBUG, TAG, "TerminateKeepAlive IN");
     if (!g_isKeepAliveInitialized)
     {
-        OC_LOG(ERROR, TAG, "KeepAlive not initialized");
+        OIC_LOG(ERROR, TAG, "KeepAlive not initialized");
         return OC_STACK_ERROR;
     }
 
@@ -233,7 +233,7 @@ OCStackResult TerminateKeepAlive()
     OCStackResult result = DeleteKeepAliveResource();
     if (OC_STACK_OK != result)
     {
-        OC_LOG_V(ERROR, TAG, "DeleteKeepAliveResource failed[%d]", result);
+        OIC_LOG_V(ERROR, TAG, "DeleteKeepAliveResource failed[%d]", result);
         return result;
     }
 
@@ -245,13 +245,13 @@ OCStackResult TerminateKeepAlive()
 
     g_isKeepAliveInitialized = false;
 
-    OC_LOG(DEBUG, TAG, "TerminateKeepAlive OUT");
+    OIC_LOG(DEBUG, TAG, "TerminateKeepAlive OUT");
     return OC_STACK_OK;
 }
 
 OCStackResult CreateKeepAliveResource()
 {
-    OC_LOG(DEBUG, TAG, "InitKeepAliveResource IN");
+    OIC_LOG(DEBUG, TAG, "InitKeepAliveResource IN");
 
     // Create a KeepAlive resource
     OCStackResult result = OCCreateResource(&g_keepAliveHandle,
@@ -264,26 +264,26 @@ OCStackResult CreateKeepAliveResource()
 
     if (OC_STACK_OK != result)
     {
-        OC_LOG_V(ERROR, TAG, "Create resource for KeepAlive failed[%d]", result);
+        OIC_LOG_V(ERROR, TAG, "Create resource for KeepAlive failed[%d]", result);
     }
 
-    OC_LOG(DEBUG, TAG, "InitKeepAliveResource OUT");
+    OIC_LOG(DEBUG, TAG, "InitKeepAliveResource OUT");
     return result;
 }
 
 OCStackResult DeleteKeepAliveResource()
 {
-    OC_LOG(DEBUG, TAG, "DeleteKeepAliveResource IN");
+    OIC_LOG(DEBUG, TAG, "DeleteKeepAliveResource IN");
 
     // Create a KeepAlive resource
     OCStackResult result = OCDeleteResource(g_keepAliveHandle);
 
     if (OC_STACK_OK != result)
     {
-        OC_LOG_V(ERROR, TAG, "Delete resource for KeepAlive failed[%d]", result);
+        OIC_LOG_V(ERROR, TAG, "Delete resource for KeepAlive failed[%d]", result);
     }
 
-    OC_LOG(DEBUG, TAG, "DeleteKeepAliveResource OUT");
+    OIC_LOG(DEBUG, TAG, "DeleteKeepAliveResource OUT");
     return result;
 }
 
@@ -293,7 +293,7 @@ OCStackResult HandleKeepAliveRequest(const CAEndpoint_t* endPoint,
     VERIFY_NON_NULL(endPoint, FATAL, OC_STACK_INVALID_PARAM);
     VERIFY_NON_NULL(requestInfo, FATAL, OC_STACK_INVALID_PARAM);
 
-    OC_LOG(DEBUG, TAG, "HandleKeepAliveRequest IN");
+    OIC_LOG(DEBUG, TAG, "HandleKeepAliveRequest IN");
 
     OCStackResult result = OC_STACK_OK;
     if (CA_PUT == requestInfo->method)
@@ -305,7 +305,7 @@ OCStackResult HandleKeepAliveRequest(const CAEndpoint_t* endPoint,
         result = HandleKeepAliveGETRequest(endPoint, requestInfo);
     }
 
-    OC_LOG(DEBUG, TAG, "HandleKeepAliveRequest OUT");
+    OIC_LOG(DEBUG, TAG, "HandleKeepAliveRequest OUT");
     return result;
 }
 
@@ -315,14 +315,14 @@ OCStackResult HandleKeepAliveGETRequest(const CAEndpoint_t* endPoint,
     VERIFY_NON_NULL(endPoint, FATAL, OC_STACK_INVALID_PARAM);
     VERIFY_NON_NULL(requestInfo, FATAL, OC_STACK_INVALID_PARAM);
 
-    OC_LOG_V(DEBUG, TAG, "Find Ping resource [%s]", requestInfo->info.resourceUri);
+    OIC_LOG_V(DEBUG, TAG, "Find Ping resource [%s]", requestInfo->info.resourceUri);
 
     CAResponseResult_t result = CA_VALID;
     OCResource *resourcePtr = FindResourceByUri(requestInfo->info.resourceUri);
     if (!resourcePtr)
     {
         // Resource URL not specified
-        OC_LOG_V(DEBUG, TAG, "There is no Ping resource [%s]", requestInfo->info.resourceUri);
+        OIC_LOG_V(DEBUG, TAG, "There is no Ping resource [%s]", requestInfo->info.resourceUri);
         result = CA_NOT_FOUND;
     }
 
@@ -345,11 +345,11 @@ OCStackResult HandleKeepAlivePUTRequest(const CAEndpoint_t* endPoint,
     KeepAliveEntry_t *entry = GetEntryFromEndpoint(endPoint, &index);
     if (!entry)
     {
-        OC_LOG(ERROR, TAG, "Received the first keepalive message from client");
+        OIC_LOG(ERROR, TAG, "Received the first keepalive message from client");
         entry = AddKeepAliveEntry(endPoint, OC_SERVER);
         if (!entry)
         {
-            OC_LOG(ERROR, TAG, "Failed to add new keepalive entry");
+            OIC_LOG(ERROR, TAG, "Failed to add new keepalive entry");
             return OC_STACK_ERROR;
         }
     }
@@ -362,7 +362,7 @@ OCStackResult HandleKeepAlivePUTRequest(const CAEndpoint_t* endPoint,
     uint32_t interval = 0;
     OCRepPayloadGetPropInt(repPayload, INTERVAL, &interval);
     entry->interval = interval;
-    OC_LOG_V(DEBUG, TAG, "Received interval is [%d]", entry->interval);
+    OIC_LOG_V(DEBUG, TAG, "Received interval is [%d]", entry->interval);
     entry->timeStamp = OICGetCurrentTime(TIME_IN_US);
 
     // Send response message.
@@ -379,18 +379,18 @@ OCStackResult HandleKeepAliveResponse(const CAEndpoint_t *endPoint,
 {
     VERIFY_NON_NULL(endPoint, FATAL, OC_STACK_INVALID_PARAM);
 
-    OC_LOG(DEBUG, TAG, "HandleKeepAliveResponse IN");
+    OIC_LOG(DEBUG, TAG, "HandleKeepAliveResponse IN");
 
     // Get entry from KeepAlive table.
     uint32_t index = 0;
     KeepAliveEntry_t *entry = GetEntryFromEndpoint(endPoint, &index);
     if (!entry)
     {
-        OC_LOG(ERROR, TAG, "There is no connection info in KeepAlive table");
+        OIC_LOG(ERROR, TAG, "There is no connection info in KeepAlive table");
 
         if (OC_STACK_NO_RESOURCE == responseCode)
         {
-            OC_LOG(ERROR, TAG, "Server doesn't have a ping resource");
+            OIC_LOG(ERROR, TAG, "Server doesn't have a ping resource");
             return OC_STACK_ERROR;
         }
         else if (OC_STACK_OK == responseCode)
@@ -398,7 +398,7 @@ OCStackResult HandleKeepAliveResponse(const CAEndpoint_t *endPoint,
             entry = AddKeepAliveEntry(endPoint, OC_CLIENT);
             if (!entry)
             {
-                OC_LOG(ERROR, TAG, "Failed to add new KeepAlive entry");
+                OIC_LOG(ERROR, TAG, "Failed to add new KeepAlive entry");
                 return OC_STACK_ERROR;
             }
 
@@ -410,7 +410,7 @@ OCStackResult HandleKeepAliveResponse(const CAEndpoint_t *endPoint,
     // Set sentPingMsg values with false.
     entry->sentPingMsg = false;
 
-    OC_LOG(DEBUG, TAG, "HandleKeepAliveResponse OUT");
+    OIC_LOG(DEBUG, TAG, "HandleKeepAliveResponse OUT");
     return OC_STACK_OK;
 }
 
@@ -418,7 +418,7 @@ void ProcessKeepAlive()
 {
     if (!g_isKeepAliveInitialized)
     {
-        OC_LOG(ERROR, TAG, "KeepAlive not initialized");
+        OIC_LOG(ERROR, TAG, "KeepAlive not initialized");
         return;
     }
 
@@ -444,7 +444,7 @@ void ProcessKeepAlive()
                  */
                 if ((KEEPALIVE_RESPONSE_TIMEOUT_SEC * USECS_PER_SEC) <= currentTime - entry->timeStamp)
                 {
-                    OC_LOG(DEBUG, TAG, "Client does not receive the response within 1 minutes.");
+                    OIC_LOG(DEBUG, TAG, "Client does not receive the response within 1 minutes.");
 
                     // Send message to disconnect session.
                     SendDisconnectMessage(entry);
@@ -464,7 +464,7 @@ void ProcessKeepAlive()
                     OCStackResult result = SendPingMessage(entry);
                     if (OC_STACK_OK != result)
                     {
-                        OC_LOG(ERROR, TAG, "Failed to send ping request");
+                        OIC_LOG(ERROR, TAG, "Failed to send ping request");
                         continue;
                     }
                 }
@@ -480,7 +480,7 @@ void ProcessKeepAlive()
             if ((entry->interval * KEEPALIVE_RESPONSE_TIMEOUT_SEC * USECS_PER_SEC)
                     <= currentTime - entry->timeStamp)
             {
-                OC_LOG(DEBUG, TAG, "Server does not receive a PUT request.");
+                OIC_LOG(DEBUG, TAG, "Server does not receive a PUT request.");
                 SendDisconnectMessage(entry);
             }
         }
@@ -511,7 +511,7 @@ OCStackResult SendPingMessage(KeepAliveEntry_t *entry)
     OCRepPayload *payload = OCRepPayloadCreate();
     if (!payload)
     {
-        OC_LOG(ERROR, TAG, "Failed to allocate Payload");
+        OIC_LOG(ERROR, TAG, "Failed to allocate Payload");
         return OC_STACK_ERROR;
     }
     payload->base.type = PAYLOAD_TYPE_REPRESENTATION;
@@ -524,7 +524,7 @@ OCStackResult SendPingMessage(KeepAliveEntry_t *entry)
     entry->timeStamp = OICGetCurrentTime(TIME_IN_US);
     entry->sentPingMsg = true;
 
-    OC_LOG_V(DEBUG, TAG, "Client sent ping message, interval [%d]", entry->interval);
+    OIC_LOG_V(DEBUG, TAG, "Client sent ping message, interval [%d]", entry->interval);
 
     return OC_STACK_OK;
 }
@@ -532,12 +532,12 @@ OCStackResult SendPingMessage(KeepAliveEntry_t *entry)
 OCStackApplicationResult PingRequestCallback(void* ctx, OCDoHandle handle,
                                              OCClientResponse *clientResponse)
 {
-    OC_LOG(DEBUG, TAG, "PingRequestCallback IN");
+    OIC_LOG(DEBUG, TAG, "PingRequestCallback IN");
     (void) ctx;
     (void) handle;
     if (NULL == clientResponse)
     {
-        OC_LOG(ERROR, TAG, "clientResponse is NULL");
+        OIC_LOG(ERROR, TAG, "clientResponse is NULL");
         return OC_STACK_KEEP_TRANSACTION;
     }
 
@@ -546,7 +546,7 @@ OCStackApplicationResult PingRequestCallback(void* ctx, OCDoHandle handle,
 
     HandleKeepAliveResponse(&endpoint, clientResponse->result);
 
-    OC_LOG(DEBUG, TAG, "PingRequestCallback OUT");
+    OIC_LOG(DEBUG, TAG, "PingRequestCallback OUT");
     return OC_STACK_KEEP_TRANSACTION;
 }
 
@@ -554,7 +554,7 @@ KeepAliveEntry_t *GetEntryFromEndpoint(const CAEndpoint_t *endpoint, uint32_t *i
 {
     if (!g_keepAliveConnectionTable)
     {
-        OC_LOG(ERROR, TAG, "KeepAlive Table was not Created.");
+        OIC_LOG(ERROR, TAG, "KeepAlive Table was not Created.");
         return NULL;
     }
 
@@ -571,7 +571,7 @@ KeepAliveEntry_t *GetEntryFromEndpoint(const CAEndpoint_t *endpoint, uint32_t *i
         if (!strncmp(entry->remoteAddr.addr, endpoint->addr, sizeof(entry->remoteAddr.addr))
                 && (entry->remoteAddr.port == endpoint->port))
         {
-            OC_LOG(DEBUG, TAG, "Connection Info found in KeepAlive table");
+            OIC_LOG(DEBUG, TAG, "Connection Info found in KeepAlive table");
             *index = i;
             return entry;
         }
@@ -584,20 +584,20 @@ KeepAliveEntry_t *AddKeepAliveEntry(const CAEndpoint_t *endpoint, OCMode mode)
 {
     if (!endpoint)
     {
-        OC_LOG(ERROR, TAG, "endpoint is NULL");
+        OIC_LOG(ERROR, TAG, "endpoint is NULL");
         return NULL;
     }
 
     if (!g_keepAliveConnectionTable)
     {
-        OC_LOG(ERROR, TAG, "KeepAlive Table was not Created.");
+        OIC_LOG(ERROR, TAG, "KeepAlive Table was not Created.");
         return NULL;
     }
 
     KeepAliveEntry_t *entry = (KeepAliveEntry_t *) OICCalloc(1, sizeof(KeepAliveEntry_t));
     if (NULL == entry)
     {
-        OC_LOG(ERROR, TAG, "Failed to Calloc KeepAlive Entry");
+        OIC_LOG(ERROR, TAG, "Failed to Calloc KeepAlive Entry");
         return NULL;
     }
 
@@ -613,7 +613,7 @@ KeepAliveEntry_t *AddKeepAliveEntry(const CAEndpoint_t *endpoint, OCMode mode)
     bool result = u_arraylist_add(g_keepAliveConnectionTable, (void *)entry);
     if (!result)
     {
-        OC_LOG(ERROR, TAG, "Adding node to head failed");
+        OIC_LOG(ERROR, TAG, "Adding node to head failed");
         OICFree(entry);
         return NULL;
     }
@@ -629,18 +629,18 @@ OCStackResult RemoveKeepAliveEntry(const CAEndpoint_t *endpoint)
     KeepAliveEntry_t *entry = GetEntryFromEndpoint(endpoint, &index);
     if (!entry)
     {
-        OC_LOG(ERROR, TAG, "There is no entry in keepalive table.");
+        OIC_LOG(ERROR, TAG, "There is no entry in keepalive table.");
         return OC_STACK_ERROR;
     }
 
     KeepAliveEntry_t *removedEntry = u_arraylist_remove(g_keepAliveConnectionTable, index);
     if (NULL == removedEntry)
     {
-        OC_LOG(ERROR, TAG, "Removed Entry is NULL");
+        OIC_LOG(ERROR, TAG, "Removed Entry is NULL");
         return OC_STACK_ERROR;
     }
 
-    OC_LOG_V(DEBUG, TAG, "Remove Connection Info from KeepAlive table, "
+    OIC_LOG_V(DEBUG, TAG, "Remove Connection Info from KeepAlive table, "
              "remote addr=%s port:%d", removedEntry->remoteAddr.addr,
              removedEntry->remoteAddr.port);
 
@@ -653,7 +653,7 @@ void HandleKeepAliveConnCB(const CAEndpoint_t *endpoint)
 {
     VERIFY_NON_NULL_NR(endpoint, FATAL);
 
-    OC_LOG(DEBUG, TAG, "Received the connected device information from CA");
+    OIC_LOG(DEBUG, TAG, "Received the connected device information from CA");
 
     // Send discover message to find ping resource
     OCCallbackData pingData = { .cb = PingRequestCallback };
@@ -667,12 +667,12 @@ void HandleKeepAliveDisconnCB(const CAEndpoint_t *endpoint)
 {
     VERIFY_NON_NULL_NR(endpoint, FATAL);
 
-    OC_LOG(DEBUG, TAG, "Received the disconnected device information from CA");
+    OIC_LOG(DEBUG, TAG, "Received the disconnected device information from CA");
 
     OCStackResult result = RemoveKeepAliveEntry(endpoint);
     if(result != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "Failed to remove entry");
+        OIC_LOG(ERROR, TAG, "Failed to remove entry");
         return;
     }
 }
index 5ed14fa..e3b8185 100644 (file)
@@ -387,7 +387,7 @@ static int InputACL(OicSecAcl_t *acl)
     acl->resources = (char **)OICCalloc(acl->resourcesLen, sizeof(char *));
     if (NULL == acl->resources)
     {
-        OC_LOG(ERROR, TAG, "Error while memory allocation");
+        OIC_LOG(ERROR, TAG, "Error while memory allocation");
         return -1;
     }
     for (size_t i = 0; i < acl->resourcesLen; i++)
@@ -404,7 +404,7 @@ static int InputACL(OicSecAcl_t *acl)
         OICFree(temp_rsc);
         if (NULL == acl->resources[i])
         {
-            OC_LOG(ERROR, TAG, "Error while memory allocation");
+            OIC_LOG(ERROR, TAG, "Error while memory allocation");
             return -1;
         }
     }
@@ -432,7 +432,7 @@ static int InputACL(OicSecAcl_t *acl)
     acl->owners = (OicUuid_t *)OICCalloc(acl->ownersLen, sizeof(OicUuid_t));
     if (NULL == acl->owners)
     {
-        OC_LOG(ERROR, TAG, "Error while memory allocation");
+        OIC_LOG(ERROR, TAG, "Error while memory allocation");
         return -1;
     }
     for (size_t i = 0; i < acl->ownersLen; i++)
@@ -681,7 +681,7 @@ int main(void)
                         acl1 = (OicSecAcl_t *)OICCalloc(1,sizeof(OicSecAcl_t));
                         if (NULL == acl1)
                         {
-                            OC_LOG(ERROR, TAG, "Error while memory allocation");
+                            OIC_LOG(ERROR, TAG, "Error while memory allocation");
                             break;
                         }
 
@@ -749,7 +749,7 @@ int main(void)
                         acl1 = (OicSecAcl_t *)OICCalloc(1,sizeof(OicSecAcl_t));
                         if (NULL == acl1)
                         {
-                            OC_LOG(ERROR, TAG, "Error while memory allocation");
+                            OIC_LOG(ERROR, TAG, "Error while memory allocation");
                             break;
                         }
 
@@ -762,7 +762,7 @@ int main(void)
                         acl2 = (OicSecAcl_t *)OICCalloc(1,sizeof(OicSecAcl_t));
                         if (NULL == acl2)
                         {
-                            OC_LOG(ERROR, TAG, "Error while memory allocation");
+                            OIC_LOG(ERROR, TAG, "Error while memory allocation");
                             break;
                         }
 
index 3dab0d7..a50bf2c 100644 (file)
@@ -86,7 +86,7 @@ static void retreiveRDDetails(OCClientResponse *clientResponse, OCRDBiasFactorCB
     OIC_LOG_V(DEBUG, TAG, "\tAddress of the RD: %s:%d", clientResponse->devAddr.addr,
             clientResponse->devAddr.port);
 
-    OC_LOG_PAYLOAD(DEBUG, clientResponse->payload);
+    OIC_LOG_PAYLOAD(DEBUG, clientResponse->payload);
 
     // TODO: Multiple Resource Directory will have different biasFactor,
     // needs to cache here detail
@@ -338,7 +338,7 @@ OCStackResult OCRDPublish(char *addr, uint16_t port, int numArg, ... )
     OICStrcpy(rdAddr.addr, MAX_ADDR_STR_SIZE, addr);
     rdAddr.port = port;
 
-    OC_LOG_PAYLOAD(DEBUG, (OCPayload *) rdPayload);
+    OIC_LOG_PAYLOAD(DEBUG, (OCPayload *) rdPayload);
 
     return sendRequest(OC_REST_POST, targetUri, &rdAddr, (OCPayload *)rdPayload, cbData);
 
index 56b6a86..e97fedf 100644 (file)
@@ -67,7 +67,7 @@ static OCEntityHandlerResult handleGetRequest(const OCEntityHandlerRequest *ehRe
         return OC_STACK_NO_MEMORY;
     }
 
-    OC_LOG_PAYLOAD(DEBUG, (OCPayload *) rdPayload);
+    OIC_LOG_PAYLOAD(DEBUG, (OCPayload *) rdPayload);
 
     if (sendResponse(ehRequest, rdPayload) != OC_STACK_OK)
     {
@@ -107,7 +107,7 @@ static OCEntityHandlerResult handlePublishRequest(const OCEntityHandlerRequest *
         return OC_STACK_NO_MEMORY;
     }
 
-    OC_LOG_PAYLOAD(DEBUG, (OCPayload *) rdPayload);
+    OIC_LOG_PAYLOAD(DEBUG, (OCPayload *) rdPayload);
 
     if (sendResponse(ehRequest, rdPayload) != OC_STACK_OK)
     {