cbData.context = NULL;
cbData.cd = NULL;
- ret = OCDoResource(NULL, method, query.str().c_str(), dest,
- (method == OC_REST_PUT || method == OC_REST_POST) ? putPayload() : NULL,
- ocConnType, qos, &cbData, options, numOptions);
+ OCPayload* payload = (method == OC_REST_PUT || method == OC_REST_POST) ? putPayload() : NULL;
+
+ ret = OCDoRequest(NULL, method, query.str().c_str(), dest,
+ payload, ocConnType, qos, &cbData, options, numOptions);
+
+ OCPayloadDestroy(payload);
if (ret != OC_STACK_OK)
{
{
OIC_LOG_V(INFO, TAG, "StackResult: %s", getResult(clientResponse->result));
OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
- OIC_LOG(INFO, TAG, ("=============> Put Response"));
+ OIC_LOG(INFO, TAG, "=============> Put Response");
}
return OC_STACK_DELETE_TRANSACTION;
}
{
OIC_LOG_V(INFO, TAG, "StackResult: %s", getResult(clientResponse->result));
OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
- OIC_LOG(INFO, TAG, ("=============> Post Response"));
+ OIC_LOG(INFO, TAG, "=============> Post Response");
}
return OC_STACK_DELETE_TRANSACTION;
}
OIC_LOG_V(INFO, TAG, "StackResult: %s", getResult(clientResponse->result));
OIC_LOG_V(INFO, TAG, "SEQUENCE NUMBER: %d", clientResponse->sequenceNumber);
OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
- OIC_LOG(INFO, TAG, ("=============> Get Response"));
+ OIC_LOG(INFO, TAG, "=============> Get Response");
}
return OC_STACK_DELETE_TRANSACTION;
}
(UnicastDiscovery) ? "Unicast" : "Multicast",
queryUri);
- ret = OCDoResource(NULL, OC_REST_DISCOVER, queryUri, 0, 0, CT_DEFAULT,
- OC_LOW_QOS, &cbData, NULL, 0);
+ ret = OCDoRequest(NULL, OC_REST_DISCOVER, queryUri, 0, 0, CT_DEFAULT,
+ OC_LOW_QOS, &cbData, NULL, 0);
if (ret != OC_STACK_OK)
{
OIC_LOG(ERROR, TAG, "OCStack resource error");