[IOT-1480] Remove the internal API from subownerclient sample.
authorChul Lee <chuls.lee@samsung.com>
Thu, 27 Oct 2016 13:11:37 +0000 (22:11 +0900)
committerRandeep Singh <randeep.s@samsung.com>
Fri, 28 Oct 2016 05:52:30 +0000 (05:52 +0000)
Change-Id: Ied92b38aa451d3ae0c9eb406b759b282f098204a
Signed-off-by: Chul Lee <chuls.lee@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/13785
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
resource/csdk/security/provisioning/sample/subownerclient.c

index c5664a9..15e183a 100644 (file)
@@ -557,14 +557,7 @@ static OicSecAcl_t* createAclForLEDAccess(const OicUuid_t* subject)
         goto CRACL_ERROR;
     }
 
-    //fill the eowner id as my deviceID.
-    OicUuid_t myUuid = {.id={0}};
-    if(OC_STACK_OK != GetDoxmDeviceID(&myUuid))
-    {
-        OIC_LOG(ERROR, TAG, "createAcl: GetDoxmDeviceID error return");
-        goto CRACL_ERROR;
-    }
-    memcpy(ace->eownerID->id, myUuid.id, sizeof(myUuid.id));
+    memcpy(ace->eownerID->id, subject->id, sizeof(subject->id));
 
     return acl;
 
@@ -616,22 +609,14 @@ static int provisionAclForLed()
         goto PVACL_ERROR;
     }
 
-    OicUuid_t subjectUuid;
-    OCStackResult rst = GetDoxmDeviceID(&subjectUuid);
-    if(OC_STACK_OK != rst)
-    {
-        OIC_LOG_V(ERROR, TAG, "GetDoxmDeviceID API error: %d", rst);
-        goto PVACL_ERROR;
-    }
-
-    acl = createAclForLEDAccess(&subjectUuid);
+    acl = createAclForLEDAccess(&dev->doxm->subOwners->uuid);
     if(NULL == acl)
     {
         OIC_LOG(ERROR, TAG, "provisionAcl: Failed to create ACL for LED");
         return -1;
     }
 
-    rst = OCProvisionACL((void*) g_ctx, dev, acl, provisionAclCB);
+    OCStackResult rst = OCProvisionACL((void*) g_ctx, dev, acl, provisionAclCB);
     if(OC_STACK_OK != rst)
     {
         OIC_LOG_V(ERROR, TAG, "OCProvisionACL API error: %d", rst);