Commit 531eb849 authored by Chul Lee's avatar Chul Lee Committed by Randeep

Fixed bug for device status management in OTM.

  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 <>
Reviewed-on: default avatarUze Choi <>
Tested-by: default avatarjenkins-iotivity <>
Reviewed-by: default avatarJihun Ha <>
Reviewed-by: Randeep's avatarRandeep Singh <>
parent 7704a4d2
......@@ -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");
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