This was creating mess with arduino macros (using VA lists).
An other patch to come later
Change-Id: I9657e11c96e84f375408e732917a275c7c3c1fb0
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17439
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
CAResult_t CAEnableAnonECDHCipherSuite(const bool enable)
{
- OIC_LOG_V(DEBUG, TAG, "CAEnableAnonECDHCipherSuite");
+ OIC_LOG(DEBUG, TAG, "CAEnableAnonECDHCipherSuite");
CAResult_t res = CA_STATUS_FAILED;
#if defined(__WITH_DTLS__) || defined(__WITH_TLS__)
// TLS_ECDH_ANON_WITH_AES_128_CBC_SHA256 0xFF00 replaces 0xC018
const uint8_t* provServerDeviceID, const size_t provServerDeviceIDLen,
uint8_t* ownerPSK, const size_t ownerPskSize)
{
- OIC_LOG_V(DEBUG, TAG, "IN : CAGenerateOwnerPSK");
+ OIC_LOG(DEBUG, TAG, "IN : CAGenerateOwnerPSK");
CAResult_t res = CA_STATUS_FAILED;
#if defined (__WITH_DTLS__) || defined(__WITH_TLS__)
//newOwnerLabel and prevOwnerLabe can be NULL
(void)(ownerPskSize);
OIC_LOG(ERROR, TAG, "Method not supported");
#endif
- OIC_LOG_V(DEBUG, TAG, "OUT : CAGenerateOwnerPSK");
+ OIC_LOG(DEBUG, TAG, "OUT : CAGenerateOwnerPSK");
return res;
}
CAResult_t CAInitiateHandshake(const CAEndpoint_t *endpoint)
{
- OIC_LOG_V(DEBUG, TAG, "IN : CAInitiateHandshake");
+ OIC_LOG(DEBUG, TAG, "IN : CAInitiateHandshake");
CAResult_t res = CA_STATUS_FAILED;
#if defined (__WITH_DTLS__) || defined(__WITH_TLS__)
if (!endpoint)
(void)(endpoint); // prevent unused-parameter compiler warning
OIC_LOG(ERROR, TAG, "Method not supported");
#endif
- OIC_LOG_V(DEBUG, TAG, "OUT : CAInitiateHandshake");
+ OIC_LOG(DEBUG, TAG, "OUT : CAInitiateHandshake");
return res;
}
CAResult_t CAcloseSslSession(const CAEndpoint_t *endpoint)
{
- OIC_LOG_V(DEBUG, TAG, "IN : CAcloseSslSession");
+ OIC_LOG(DEBUG, TAG, "IN : CAcloseSslSession");
CAResult_t res = CA_STATUS_FAILED;
#if defined (__WITH_DTLS__) || defined(__WITH_TLS__)
if (!endpoint)
(void)(endpoint); // prevent unused-parameter compiler warning
OIC_LOG(ERROR, TAG, "Method not supported");
#endif
- OIC_LOG_V(DEBUG, TAG, "OUT : CAcloseSslSession");
+ OIC_LOG(DEBUG, TAG, "OUT : CAcloseSslSession");
return res;
}
else
{
outInfo->payloadFormat = CA_FORMAT_UNSUPPORTED;
- OIC_LOG_V(DEBUG, TAG, "option has an unsupported format");
+ OIC_LOG(DEBUG, TAG, "option has an unsupported format");
}
}
else if (COAP_OPTION_CONTENT_VERSION == opt_iter.type)
}
else
{
- OIC_LOG_V(DEBUG, TAG, "unsupported content version");
+ OIC_LOG(DEBUG, TAG, "unsupported content version");
outInfo->payloadVersion = DEFAULT_CONTENT_VERSION_VALUE;
}
}
else
{
- OIC_LOG_V(DEBUG, TAG, "unsupported accept version");
+ OIC_LOG(DEBUG, TAG, "unsupported accept version");
outInfo->acceptVersion = DEFAULT_ACCEPT_VERSION_VALUE;
}
}
else
{
outInfo->acceptFormat = CA_FORMAT_UNSUPPORTED;
- OIC_LOG_V(DEBUG, TAG, "option has an unsupported accept format");
+ OIC_LOG(DEBUG, TAG, "option has an unsupported accept format");
}
}
else if (COAP_OPTION_URI_PORT == opt_iter.type ||
CAResult_t CAUtilSetBTConfigure(CAUtilConfig_t config)
{
- OIC_LOG_V(DEBUG, TAG, "CAUtilSetConfigure");
+ OIC_LOG(DEBUG, TAG, "CAUtilSetConfigure");
#if (defined(__ANDROID__) && defined(LE_ADAPTER))
OIC_LOG_V(DEBUG, TAG, "bleFlag [%d]", config.bleFlags);
CAManagerSetConfigure(config);
OCRepPayload *rdPayload = (OCRepPayload *) clientResponse->payload;
if (!OCRepPayloadGetPropObjectArray(rdPayload, OC_RSRVD_LINKS, &links, dimensions))
{
- OIC_LOG_V(DEBUG, TAG, "No links in publish response");
+ OIC_LOG(DEBUG, TAG, "No links in publish response");
goto exit;
}
for(size_t i = 0; i < dimensions[0]; i++)
char *uri = NULL;
if (!OCRepPayloadGetPropString(links[i], OC_RSRVD_HREF, &uri))
{
- OIC_LOG_V(ERROR, TAG, "Missing 'href' in publish response");
+ OIC_LOG(ERROR, TAG, "Missing 'href' in publish response");
goto next;
}
OCResourceHandle handle = OCGetResourceHandleAtUri(uri);
int64_t ins = 0;
if (!OCRepPayloadGetPropInt(links[i], OC_RSRVD_INS, &ins))
{
- OIC_LOG_V(ERROR, TAG, "Missing 'ins' in publish response");
+ OIC_LOG(ERROR, TAG, "Missing 'ins' in publish response");
goto next;
}
OCBindResourceInsToResource(handle, ins);
static OCStackApplicationResult DirectPairingFinalizeHandler(void *ctx, OCDoHandle UNUSED,
OCClientResponse *clientResponse)
{
- OIC_LOG_V(INFO, TAG, "IN DirectPairingFinalizeHandler()");
+ OIC_LOG(INFO, TAG, "IN DirectPairingFinalizeHandler()");
(void)UNUSED;
if(NULL == ctx)
{
*/
void DirectPairingDTLSHandshakeCB(const CAEndpoint_t *endpoint, const CAErrorInfo_t *info)
{
- OIC_LOG_V(INFO, TAG, "IN DirectPairingDTLSHandshakeCB");
+ OIC_LOG(INFO, TAG, "IN DirectPairingDTLSHandshakeCB");
if(g_dp_proceed_ctx && g_dp_proceed_ctx->peer && endpoint && info)
}
else
{
- OIC_LOG_V(INFO, TAG, "DirectPairingDTLSHandshakeCB - Not matched to peer address");
+ OIC_LOG(INFO, TAG, "DirectPairingDTLSHandshakeCB - Not matched to peer address");
}
}
- OIC_LOG_V(INFO, TAG, "OUT DirectPairingDTLSHandshakeCB");
+ OIC_LOG(INFO, TAG, "OUT DirectPairingDTLSHandshakeCB");
}
/**
static OCStackApplicationResult DirectPairingHandler(void *ctx, OCDoHandle UNUSED,
OCClientResponse *clientResponse)
{
- OIC_LOG_V(INFO, TAG, "IN DirectPairingHandler.");
+ OIC_LOG(INFO, TAG, "IN DirectPairingHandler.");
(void)UNUSED;
if(NULL == ctx)
{
resultCallback(dpairData->userCtx, dpairData->peer, res);
}
- OIC_LOG_V(INFO, TAG, "OUT DirectPairingHandler.");
+ OIC_LOG(INFO, TAG, "OUT DirectPairingHandler.");
return OC_STACK_DELETE_TRANSACTION;
}
*/
void DPairingDTLSHandshakeCB(const CAEndpoint_t *endpoint, const CAErrorInfo_t *info)
{
- OIC_LOG_V(INFO, TAG, "IN DPairingDTLSHandshakeCB");
+ OIC_LOG(INFO, TAG, "IN DPairingDTLSHandshakeCB");
if(gDpair && endpoint && info)
{
RemoveCredential(&gDpair->pdeviceID);
}
- OIC_LOG_V(INFO, TAG, "OUT DPairingDTLSHandshakeCB");
+ OIC_LOG(INFO, TAG, "OUT DPairingDTLSHandshakeCB");
}
static OCEntityHandlerResult HandleDpairingPostRequest (const OCEntityHandlerRequest * ehRequest)
bool isDeviceOwned = true; // default to value that will NOT grant access
if (OC_STACK_OK != GetDoxmIsOwned(&isDeviceOwned)) // if runtime error, don't grant
{
- OIC_LOG_V(ERROR, TAG, "GetDoxmIsOwned() call failed.");
+ OIC_LOG(ERROR, TAG, "GetDoxmIsOwned() call failed.");
context->responseVal = ACCESS_DENIED_POLICY_ENGINE_ERROR;
}
// If we were able to get the value of doxm->isOwned, proceed with
if (CA_STATUS_OK == CASendResponse(context->endPoint,
&(context->responseInfo)))
{
- OIC_LOG_V(DEBUG, TAG, "SRM response sent.");
+ OIC_LOG(DEBUG, TAG, "SRM response sent.");
context->responseSent = true;
}
else
{
- OIC_LOG_V(ERROR, TAG, "SRM response failed.");
+ OIC_LOG(ERROR, TAG, "SRM response failed.");
}
}
else
}
if (MAX_URI_LENGTH < position || 0 > position)
{
- OIC_LOG_V(ERROR, TAG, "Incorrect URI length.");
+ OIC_LOG(ERROR, TAG, "Incorrect URI length.");
return;
}
OICStrcpyPartial(context->resourceUri, MAX_URI_LENGTH + 1,
{
if (!OCGetRandomBytes((uint8_t*)observationId, sizeof(OCObservationId)))
{
- OIC_LOG_V(ERROR, TAG, "Failed to generate random observationId");
+ OIC_LOG(ERROR, TAG, "Failed to generate random observationId");
goto exit;
}
{
if (!query)
{
- OIC_LOG_V(ERROR, TAG, "Query is empty!");
+ OIC_LOG(ERROR, TAG, "Query is empty!");
return OC_STACK_INVALID_QUERY;
}
char *key = NULL;
queryDup = OICStrdup(query);
if (NULL == queryDup)
{
- OIC_LOG_V(ERROR, TAG, "Creating duplicate string failed!");
+ OIC_LOG(ERROR, TAG, "Creating duplicate string failed!");
return OC_STACK_NO_MEMORY;
}
*filterOne = OICStrdup(*filterOne);
if (NULL == *filterOne)
{
- OIC_LOG_V(ERROR, TAG, "Creating duplicate string failed!");
+ OIC_LOG(ERROR, TAG, "Creating duplicate string failed!");
eCode = OC_STACK_NO_MEMORY;
goto exit;
}
*filterTwo = OICStrdup(*filterTwo);
if (NULL == *filterTwo)
{
- OIC_LOG_V(ERROR, TAG, "Creating duplicate string failed!");
+ OIC_LOG(ERROR, TAG, "Creating duplicate string failed!");
OICFree(*filterOne);
eCode = OC_STACK_NO_MEMORY;
goto exit;
OCRepPayload *urlInfoPayload = OCRepPayloadCreate();
if (!urlInfoPayload)
{
- OIC_LOG_V(ERROR, TAG, "Failed to create a new RepPayload");
+ OIC_LOG(ERROR, TAG, "Failed to create a new RepPayload");
result = OC_STACK_NO_MEMORY;
goto exit;
}
if (!OCRepPayloadSetPropString(urlInfoPayload, OC_RSRVD_INTROSPECTION_URL, OC_RSRVD_INTROSPECTION_PAYLOAD_URI))
{
- OIC_LOG_V(ERROR, TAG, "Failed to add url");
+ OIC_LOG(ERROR, TAG, "Failed to add url");
result = OC_STACK_ERROR;
goto exit;
}
if (!OCRepPayloadSetPropString(urlInfoPayload, OC_RSRVD_INTROSPECTION_PROTOCOL, protocol))
{
- OIC_LOG_V(ERROR, TAG, "Failed to add protocol");
+ OIC_LOG(ERROR, TAG, "Failed to add protocol");
result = OC_STACK_ERROR;
goto exit;
}
if (!OCRepPayloadSetPropString(urlInfoPayload, OC_RSRVD_INTROSPECTION_CONTENT_TYPE, OC_RSRVD_INTROSPECTION_CONTENT_TYPE_VALUE))
{
- OIC_LOG_V(ERROR, TAG, "Failed to add content type");
+ OIC_LOG(ERROR, TAG, "Failed to add content type");
result = OC_STACK_ERROR;
goto exit;
}
if (!OCRepPayloadSetPropInt(urlInfoPayload, OC_RSRVD_INTROSPECTION_VERSION, OC_RSRVD_INTROSPECTION_VERSION_VALUE))
{
- OIC_LOG_V(ERROR, TAG, "Failed to add version");
+ OIC_LOG(ERROR, TAG, "Failed to add version");
result = OC_STACK_ERROR;
goto exit;
}
if (!OCRepPayloadSetUri(tempPayload, resourcePtr->uri))
{
- OIC_LOG_V(ERROR, TAG, "Failed to set payload URI");
+ OIC_LOG(ERROR, TAG, "Failed to set payload URI");
ret = OC_STACK_ERROR;
goto exit;
}
{
if (!OCRepPayloadAddResourceType(tempPayload, resType->resourcetypename))
{
- OIC_LOG_V(ERROR, TAG, "Failed at add resource type");
+ OIC_LOG(ERROR, TAG, "Failed at add resource type");
ret = OC_STACK_ERROR;
goto exit;
}
{
if (!OCRepPayloadAddInterface(tempPayload, resInterface->name))
{
- OIC_LOG_V(ERROR, TAG, "Failed to add interface");
+ OIC_LOG(ERROR, TAG, "Failed to add interface");
ret = OC_STACK_ERROR;
goto exit;
}
}
if (!OCRepPayloadSetPropString(tempPayload, OC_RSRVD_INTROSPECTION_NAME, OC_RSRVD_INTROSPECTION_NAME_VALUE))
{
- OIC_LOG_V(ERROR, TAG, "Failed to set Name property.");
+ OIC_LOG(ERROR, TAG, "Failed to set Name property.");
ret = OC_STACK_ERROR;
goto exit;
}
urlInfoPayload[i] = BuildUrlInfoWithProtocol(proto->value);
if (!urlInfoPayload[i])
{
- OIC_LOG_V(ERROR, TAG, "Unable to build urlInfo object for protocol");
+ OIC_LOG(ERROR, TAG, "Unable to build urlInfo object for protocol");
ret = OC_STACK_ERROR;
goto exit;
}
urlInfoPayload,
dimensions))
{
- OIC_LOG_V(ERROR, TAG, "Unable to add urlInfo object to introspection payload ");
+ OIC_LOG(ERROR, TAG, "Unable to add urlInfo object to introspection payload ");
ret = OC_STACK_ERROR;
goto exit;
}
}
else
{
- OIC_LOG_V(ERROR, TAG, "Unable to allocate memory for urlInfo ");
+ OIC_LOG(ERROR, TAG, "Unable to allocate memory for urlInfo ");
ret = OC_STACK_NO_MEMORY;
goto exit;
}
if (requestResult == OC_STACK_RESOURCE_ERROR
&& serverRequest.observationOption == OC_OBSERVE_REGISTER)
{
- OIC_LOG_V(ERROR, TAG, "Observe Registration failed due to resource error");
+ OIC_LOG(ERROR, TAG, "Observe Registration failed due to resource error");
}
else if (!OCResultToSuccess(requestResult))
{