#include "cainterface.h"
/// Module Name
-#define TAG PCF("occlientcb")
+#define TAG "occlientcb"
struct ClientCB *cbList = NULL;
static OCMulticastNode * mcPresenceNodes = NULL;
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.
{
}
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;
*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.
{
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)
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);
cbNode->deleteCallback(cbNode->context);
}
- #ifdef WITH_PRESENCE
+#ifdef WITH_PRESENCE
if(cbNode->presence)
{
OICFree(cbNode->presence->timeOut);
pointer = next;
}
}
- #endif // WITH_PRESENCE
+#endif // WITH_PRESENCE
OICFree(cbNode);
cbNode = NULL;
}
if (cbNode->TTL < now)
{
- OC_LOG(INFO, TAG, PCF("Deleting timed-out callback"));
+ OC_LOG(INFO, TAG, "Deleting timed-out callback");
DeleteClientCB(cbNode);
}
}
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);
CheckAndDeleteTimedOutCB(out);
}
}
- OC_LOG(INFO, TAG, PCF("Callback Not found !!"));
+ OC_LOG(INFO, TAG, "Callback Not found !!");
return NULL;
}
}
}
}
- OC_LOG(INFO, TAG, PCF("MulticastNode Not found !!"));
+ OC_LOG(INFO, TAG, "MulticastNode Not found !!");
return NULL;
}