static int ConvertUuidToStr(const OicUuid_t* uuid, char** strUuid)
{
- if(NULL == uuid || NULL == strUuid || NULL != *strUuid)
- {
+ if (NULL == uuid || NULL == strUuid || NULL != *strUuid) {
LOG_ERR("ConvertUuidToStr : Invalid param");
return OC_STACK_INVALID_PARAM;
}
goto exit;
}
- for(uuidIdx=0, urnIdx=0; uuidIdx < UUID_LENGTH && urnIdx < urnBufSize; uuidIdx++, urnIdx+=2)
- {
+ for (uuidIdx = 0, urnIdx = 0; uuidIdx < UUID_LENGTH && urnIdx < urnBufSize;
+ uuidIdx++, urnIdx += 2) {
// canonical format for UUID has '8-4-4-4-12'
- if(uuidIdx==4 || uuidIdx==6 || uuidIdx==8 || uuidIdx==10)
- {
+ if (uuidIdx == 4 || uuidIdx == 6 || uuidIdx == 8 || uuidIdx == 10) {
snprintf(convertedUrn + urnIdx, 2, "%c", '-');
urnIdx++;
}
platform_info->dateOfManufacture = g_strdup("NONE");
struct utsname uts;
- if(!uname(&uts)) {
+
+ if (!uname(&uts))
platform_info->operatingSystemVersion = g_strdup(uts.sysname);
- } else {
+ else
platform_info->operatingSystemVersion = g_strdup("NONE");
- }
+
platform_info->hardwareVersion = g_strdup("0-0");
platform_info->supportUrl = g_strdup("NONE");
platform_info->systemTime = g_strdup("NONE");
return OC_EH_OK;
}
- if(requestFlag & RequestHandlerFlag::RequestFlag) {
+ if (requestFlag & RequestHandlerFlag::RequestFlag) {
LOG_DEBUG("requestFlag : Request");
auto pResponse = std::make_shared<OC::OCResourceResponse>();
char *arg = NULL;
}
uint32_t len = 0;
- if(B64_OK == b64Decode(data.c_str(), payload_len, out,
+ if (B64_OK == b64Decode(data.c_str(), payload_len, out,
outSize, &len)) {
LOG_ERR("Base64 decoding failed.");
return;
LOG_DEBUG("Found Resource");
try {
- if(resource) {
+ if (resource) {
resource_host = g_strdup(resource->host().c_str());
resource_uri_path = g_strdup(resource->uri().c_str());
int ConvertUuidToStr(const OicUuid_t* uuid, char** strUuid)
{
- if(NULL == uuid || NULL == strUuid || NULL != *strUuid)
- {
+ if (NULL == uuid || NULL == strUuid || NULL != *strUuid) {
MA_LOGE("ConvertUuidToStr : Invalid param");
return OC_STACK_INVALID_PARAM;
}
goto exit;
}
- for(uuidIdx=0, urnIdx=0; uuidIdx < UUID_LENGTH && urnIdx < urnBufSize; uuidIdx++, urnIdx+=2)
- {
+ for (uuidIdx = 0, urnIdx = 0; uuidIdx < UUID_LENGTH && urnIdx < urnBufSize;
+ uuidIdx++, urnIdx += 2) {
// canonical format for UUID has '8-4-4-4-12'
- if(uuidIdx==4 || uuidIdx==6 || uuidIdx==8 || uuidIdx==10)
- {
+ if (uuidIdx == 4 || uuidIdx == 6 || uuidIdx == 8 || uuidIdx == 10) {
snprintf(convertedUrn + urnIdx, 2, "%c", '-');
urnIdx++;
}
exit:
return OC_STACK_NO_MEMORY;
-}
\ No newline at end of file
+}