Commit 79cd1c07 authored by Chul Lee's avatar Chul Lee Committed by Randeep

Fixed bug for device status management in OTM.

[Bug]
  1. Perform the OTM.
  2. Remove the device using OCRemoveDevice or OCRemoveDeviceWithUuid
  3. Initialize the server to unowned status.
  3. Perform the OTM again w/ same server.
     [Actual Result] Device UUID removed from PDM DB.
     [Expected result] Device UUID should be set to initial status.

Change-Id: Ie662ca6eeedfb5a98db4d97e020b61fbf331cb0e
Signed-off-by: default avatarChul Lee <chuls.lee@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/14643Reviewed-by: default avatarUze Choi <uzchoi@samsung.com>
Tested-by: default avatarjenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: default avatarJihun Ha <jihun.ha@samsung.com>
Reviewed-by: Randeep's avatarRandeep Singh <randeep.s@samsung.com>
(cherry picked from commit 531eb849)
Reviewed-on: https://gerrit.iotivity.org/gerrit/14665
parent efc8b9ab
......@@ -1736,12 +1736,11 @@ static OCStackResult StartOwnershipTransfer(void* ctx, OCProvisionDev_t* selecte
if(PDM_DEVICE_STALE == state)
{
OIC_LOG(INFO, TAG, "Detected duplicated UUID in stale status, "
"this UUID will be removed from PDM");
res = PDMDeleteDevice(&selectedDevice->doxm->deviceID);
"device status will revert back to initial status.");
res = PDMSetDeviceState(&selectedDevice->doxm->deviceID, PDM_DEVICE_INIT);
if(OC_STACK_OK != res)
{
OIC_LOG(ERROR, TAG, "Internal error in PDMDeleteDevice");
OIC_LOG(ERROR, TAG, "Internal error in PDMSetDeviceState");
OICFree(strUuid);
SetResult(otmCtx, res);
return res;
......
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