Imported Upstream version 1.0.0
[platform/upstream/iotivity.git] / resource / csdk / stack / src / occlientcb.c
index 9ea19ee..4329c39 100644 (file)
@@ -36,7 +36,7 @@
 #include "cainterface.h"
 
 /// Module Name
-#define TAG PCF("occlientcb")
+#define TAG "occlientcb"
 
 struct ClientCB *cbList = NULL;
 static OCMulticastNode * mcPresenceNodes = NULL;
@@ -55,12 +55,12 @@ AddClientCB (ClientCB** clientCB, OCCallbackData* cbData,
 
     ClientCB *cbNode = NULL;
 
-    #ifdef WITH_PRESENCE
+#ifdef WITH_PRESENCE
     if(method == OC_REST_PRESENCE)
     {   // Retrieve the presence callback structure for this specific requestUri.
         cbNode = GetClientCB(NULL, 0, NULL, requestUri);
     }
-    #endif // WITH_PRESENCE
+#endif // WITH_PRESENCE
 
     if(!cbNode)// If it does not already exist, create new node.
     {
@@ -72,7 +72,7 @@ AddClientCB (ClientCB** clientCB, OCCallbackData* cbData,
         }
         else
         {
-            OC_LOG(INFO, TAG, PCF("Adding client callback with token"));
+            OC_LOG(INFO, TAG, "Adding client callback with token");
             OC_LOG_BUFFER(INFO, TAG, (const uint8_t *)token, tokenLength);
             cbNode->callBack = cbData->cb;
             cbNode->context = cbData->context;
@@ -124,7 +124,7 @@ AddClientCB (ClientCB** clientCB, OCCallbackData* cbData,
         *handle = cbNode->handle;
     }
 
-    #ifdef WITH_PRESENCE
+#ifdef WITH_PRESENCE
     if(method == OC_REST_PRESENCE && resourceTypeName)
     {
         // Amend the found or created node by adding a new resourceType to it.
@@ -135,14 +135,14 @@ AddClientCB (ClientCB** clientCB, OCCallbackData* cbData,
     {
         OICFree(resourceTypeName);
     }
-    #else
+#else
     OICFree(resourceTypeName);
-    #endif
+#endif
 
     return OC_STACK_OK;
 
-    exit:
-        return OC_STACK_NO_MEMORY;
+exit:
+     return OC_STACK_NO_MEMORY;
 }
 
 void DeleteClientCB(ClientCB * cbNode)
@@ -150,7 +150,7 @@ void DeleteClientCB(ClientCB * cbNode)
     if(cbNode)
     {
         LL_DELETE(cbList, cbNode);
-        OC_LOG (INFO, TAG, PCF("Deleting token"));
+        OC_LOG (INFO, TAG, "Deleting token");
         OC_LOG_BUFFER(INFO, TAG, (const uint8_t *)cbNode->token, cbNode->tokenLength);
         CADestroyToken (cbNode->token);
         OICFree(cbNode->devAddr);
@@ -162,7 +162,7 @@ void DeleteClientCB(ClientCB * cbNode)
             cbNode->deleteCallback(cbNode->context);
         }
 
-        #ifdef WITH_PRESENCE
+#ifdef WITH_PRESENCE
         if(cbNode->presence)
         {
             OICFree(cbNode->presence->timeOut);
@@ -180,7 +180,7 @@ void DeleteClientCB(ClientCB * cbNode)
                 pointer = next;
             }
         }
-        #endif // WITH_PRESENCE
+#endif // WITH_PRESENCE
         OICFree(cbNode);
         cbNode = NULL;
     }
@@ -208,7 +208,7 @@ static void CheckAndDeleteTimedOutCB(ClientCB* cbNode)
 
     if (cbNode->TTL < now)
     {
-        OC_LOG(INFO, TAG, PCF("Deleting timed-out callback"));
+        OC_LOG(INFO, TAG, "Deleting timed-out callback");
         DeleteClientCB(cbNode);
     }
 }
@@ -221,9 +221,9 @@ ClientCB* GetClientCB(const CAToken_t token, uint8_t tokenLength,
 
     if(token && *token && tokenLength <= CA_MAX_TOKEN_LEN && tokenLength > 0)
     {
-        OC_LOG (INFO, TAG, PCF ("Looking for token"));
+        OC_LOG (INFO, TAG,  "Looking for token");
         OC_LOG_BUFFER(INFO, TAG, (const uint8_t *)token, tokenLength);
-        OC_LOG(INFO, TAG, PCF("\tFound in callback list"));
+        OC_LOG(INFO, TAG, "\tFound in callback list");
         LL_FOREACH(cbList, out)
         {
             OC_LOG_BUFFER(INFO, TAG, (const uint8_t *)out->token, tokenLength);
@@ -259,7 +259,7 @@ ClientCB* GetClientCB(const CAToken_t token, uint8_t tokenLength,
             CheckAndDeleteTimedOutCB(out);
         }
     }
-    OC_LOG(INFO, TAG, PCF("Callback Not found !!"));
+    OC_LOG(INFO, TAG, "Callback Not found !!");
     return NULL;
 }
 
@@ -350,7 +350,7 @@ OCMulticastNode* GetMCPresenceNode(const char * uri)
             }
         }
     }
-    OC_LOG(INFO, TAG, PCF("MulticastNode Not found !!"));
+    OC_LOG(INFO, TAG, "MulticastNode Not found !!");
     return NULL;
 }