[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: Chul Lee <chuls.lee@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/14643
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jihun Ha <jihun.ha@samsung.com>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
(cherry picked from commit
531eb849bb6cd36510ecd83194268a1f304e85a9)
Reviewed-on: https://gerrit.iotivity.org/gerrit/14665
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;