Commit 868ce231 authored by Mushfiqul Islam Antu's avatar Mushfiqul Islam Antu Committed by Mushfiqul Islam

[IOT-2913] Mirror d.di to match doxm.deviceuuid

OCGetServerInstanceID() & OCGetServerInstanceID() these 2
APIs were keeping a local copy of doxm.deviceuuid, while
there is no way to keep track whether doxm.deviceuuid was
updated by the provisioning manager. So local copies are
removed, each time d.di is required, it will be fetched
doxm.deviceuuid

Change-Id: I017bed18d3e0ad568b662a03d9bd80134538a8c2
Signed-off-by: default avatarMushfiqul Islam Antu <i.mushfiq@samsung.com>
parent d698f81a
......@@ -5735,32 +5735,21 @@ OCStackResult getQueryFromUri(const char * uri, char** query, char ** uriWithout
static const OicUuid_t* OC_CALL OCGetServerInstanceID(void)
{
static bool generated = false;
static OicUuid_t sid;
if (generated)
{
return &sid;
}
if (OC_STACK_OK != GetDoxmDeviceID(&sid))
{
OIC_LOG(FATAL, TAG, "Generate UUID for Server Instance failed!");
return NULL;
}
generated = true;
return &sid;
}
const char* OC_CALL OCGetServerInstanceIDString(void)
{
static bool generated = false;
static char sidStr[UUID_STRING_SIZE];
if (generated)
{
return sidStr;
}
const OicUuid_t *sid = OCGetServerInstanceID();
if(sid && !OCConvertUuidToString(sid->id, sidStr))
{
......@@ -5768,7 +5757,6 @@ const char* OC_CALL OCGetServerInstanceIDString(void)
return NULL;
}
generated = true;
return sidStr;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment