Modify generating notification consumer id. 49/12549/2
authorKIM JungYong <jyong2.kim@samsung.com>
Thu, 29 Sep 2016 05:33:09 +0000 (14:33 +0900)
committerUze Choi <uzchoi@samsung.com>
Thu, 29 Sep 2016 07:59:18 +0000 (07:59 +0000)
generating consumer id is replaced with device id generated by base layer.

Change-Id: I4e8157b938c0e9ea524c838d7d355443f9bb0c41
Signed-off-by: KIM JungYong <jyong2.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/12549
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
service/notification/src/consumer/NSConsumerScheduler.c

index f5b440f..13a33bb 100644 (file)
@@ -74,14 +74,10 @@ NSResult NSConsumerMessageHandlerInit()
     NSConsumerThread * handle = NULL;
     NSConsumerQueue * queue = NULL;
 
-    uint8_t uuid[UUID_SIZE] = {0,};
-    char uuidString[UUID_STRING_SIZE] = {0,};
-    OCRandomUuidResult randomRet = OCGenerateUuid(uuid);
-    NS_VERIFY_NOT_NULL(randomRet == RAND_UUID_OK ? (void *) 1 : NULL, NS_ERROR);
-    randomRet = OCConvertUuidToString(uuid, uuidString);
-    NS_VERIFY_NOT_NULL(randomRet == RAND_UUID_OK ? (void *) 1 : NULL, NS_ERROR);
-
-    NSSetConsumerId(uuidString);
+    char * consumerUuid = (char *)OCGetServerInstanceIDString();
+    NS_VERIFY_NOT_NULL(consumerUuid, NS_ERROR);
+
+    NSSetConsumerId(consumerUuid);
     NS_LOG_V(DEBUG, "Consumer ID : %s", *NSGetConsumerId());
 
     NS_LOG(DEBUG, "listener init");