[IOT-914] Device ID to be based on DOXM GetDeviceID
authorHabib Virji <habib.virji@samsung.com>
Thu, 24 Mar 2016 14:01:26 +0000 (14:01 +0000)
committerHabib Virji <habib.virji@samsung.com>
Tue, 19 Apr 2016 14:41:04 +0000 (14:41 +0000)
Instead of ocstack generating random device id. DOXM id is going to be used.

Change-Id: I1a780f07388ee1fe09e315c2d645f1c8ee5142de
Signed-off-by: Habib Virji <habib.virji@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/6299
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
(cherry picked from commit eb927a675208f8c2d416f874ed02ed01b8007d2b)
Reviewed-on: https://gerrit.iotivity.org/gerrit/7827

resource/csdk/stack/src/ocstack.c
resource/unittests/OCRepresentationEncodingTest.cpp

index 738826134841540cca0013cf0a4e0e638de6bf28..328c188d83f83464e0cb0876ba6c52cdcec9cde1 100644 (file)
@@ -4430,7 +4430,7 @@ static const OicUuid_t* OCGetServerInstanceID(void)
         return &sid;
     }
 
-    if (RAND_UUID_OK != OCGenerateUuid(sid.id))
+    if (OC_STACK_OK != GetDoxmDeviceID(&sid))
     {
         OIC_LOG(FATAL, TAG, "Generate UUID for Server Instance failed!");
         return NULL;
index 397f5e0611a0bb966980f9f452d687aa48d90570..08d8858eabb73ac8fdc820e0a2f0438077bbf734 100644 (file)
@@ -49,7 +49,7 @@ namespace OC
 // CBOR->OCPayload and OCPayload->OCRepresentation conversions
 namespace OCRepresentationEncodingTest
 {
-    static const char *sid1 = OCGetServerInstanceIDString();
+    static const char sid1[] = "646F6F72-4465-7669-6365-555549443030";
     static const char devicename1[] = "device name";
     static const char specver1[] = "spec version";
     static const char dmver1[] = "data model version";