#include "iotivity_config.h"
#include "occlientcb.h"
-#include <coap/coap.h>
#include "logger.h"
+#include "trace.h"
#include "oic_malloc.h"
#include <string.h>
#include "cacommon.h"
#include "cainterface.h"
+#include <coap/coap.h>
/// Module Name
#define TAG "OIC_RI_CLIENTCB"
return OC_STACK_INVALID_PARAM;
}
+ OIC_TRACE_BEGIN(%s:AddClientCB, TAG);
+
ClientCB *cbNode = NULL;
#ifdef WITH_PRESENCE
{
OIC_LOG(INFO, TAG, "Adding client callback with token");
OIC_LOG_BUFFER(INFO, TAG, (const uint8_t *)token, tokenLength);
+ OIC_TRACE_BUFFER("OIC_RI_CLIENTCB:AddClientCB:token",
+ (const uint8_t *) token, tokenLength);
cbNode->callBack = cbData->cb;
cbNode->context = cbData->context;
cbNode->deleteCallback = cbData->cd;
cbNode->filterResourceType = NULL;
#endif // WITH_PRESENCE
- if (method == OC_REST_PRESENCE ||
+ if (
+#ifdef WITH_PRESENCE
+ method == OC_REST_PRESENCE ||
+#endif
method == OC_REST_OBSERVE ||
method == OC_REST_OBSERVE_ALL)
{
cbNode->requestUri = requestUri; // I own it now
cbNode->devAddr = devAddr; // I own it now
OIC_LOG_V(INFO, TAG, "Added Callback for uri : %s", requestUri);
+ OIC_TRACE_MARK(%s:AddClientCB:uri:%s, TAG, requestUri);
LL_APPEND(cbList, cbNode);
*clientCB = cbNode;
}
if (method == OC_REST_PRESENCE && resourceTypeName)
{
+ OIC_TRACE_END();
// Amend the found or created node by adding a new resourceType to it.
return InsertResourceTypeFilter(cbNode,(char *)resourceTypeName);
// I own resourceTypName now.
OICFree(resourceTypeName);
#endif
+ OIC_TRACE_END();
return OC_STACK_OK;
exit:
+ OIC_TRACE_END();
return OC_STACK_NO_MEMORY;
}
void DeleteClientCB(ClientCB * cbNode)
{
+ OIC_TRACE_BEGIN(%s:DeleteClientCB, TAG);
if (cbNode)
{
LL_DELETE(cbList, cbNode);
OIC_LOG (INFO, TAG, "Deleting token");
OIC_LOG_BUFFER(INFO, TAG, (const uint8_t *)cbNode->token, cbNode->tokenLength);
+ OIC_TRACE_BUFFER("OIC_RI_CLIENTCB:DeleteClientCB:token",
+ (const uint8_t *)cbNode->token, cbNode->tokenLength);
CADestroyToken (cbNode->token);
OICFree(cbNode->devAddr);
OICFree(cbNode->handle);
if (cbNode->requestUri)
{
OIC_LOG_V (INFO, TAG, "Deleting callback with uri %s", cbNode->requestUri);
+ OIC_TRACE_MARK(%s:DeleteClientCB:uri:%s, TAG, cbNode->requestUri);
OICFree(cbNode->requestUri);
}
if (cbNode->deleteCallback)
OICFree(cbNode);
cbNode = NULL;
}
+ OIC_TRACE_END();
}
/*