Fix OTM 15/22715/5
authorOleksii Beketov <ol.beketov@samsung.com>
Fri, 6 Oct 2017 13:13:58 +0000 (16:13 +0300)
committerNathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
Wed, 11 Oct 2017 02:26:21 +0000 (02:26 +0000)
Set DOS state RF_OTM before OTM start and RF_NOP after finish.

Change-Id: Iafa4315f034cf9e0e09b7d2663131fd26c06ff54
Signed-off-by: Oleksii Beketov <ol.beketov@samsung.com>
resource/csdk/security/provisioning/src/ownershiptransfermanager.c

index 914e7e9..7f2c557 100644 (file)
@@ -75,6 +75,7 @@
 #include "oxmverifycommon.h"
 #include "psinterface.h"
 #include "ocstackinternal.h"
+#include "deviceonboardingstate.h"
 
 #define TAG "OIC_OTM"
 
@@ -559,6 +560,7 @@ static void SetResult(OTMContext_t* otmCtx, const OCStackResult res)
     //If all OTM process is complete, invoke the user callback.
     if(IsComplete(otmCtx))
     {
+        SetDosState(DOS_RFNOP);
         otmCtx->ctxResultCallback(otmCtx->userCtx, otmCtx->ctxResultArraySize,
                                    otmCtx->ctxResultArray, otmCtx->ctxHasError);
         OICFree(otmCtx->ctxResultArray);
@@ -2368,6 +2370,7 @@ OCStackResult OTMDoOwnershipTransfer(void* ctx,
         OIC_LOG(ERROR, TAG, "Failed to create OTM Context");
         return OC_STACK_NO_MEMORY;
     }
+
     otmCtx->ctxResultCallback = resultCallback;
     otmCtx->ctxHasError = false;
     otmCtx->userCtx = ctx;
@@ -2401,6 +2404,7 @@ OCStackResult OTMDoOwnershipTransfer(void* ctx,
         pCurDev = pCurDev->next;
     }
 
+    SetDosState(DOS_RFPRO);
     OCStackResult res = StartOwnershipTransfer(otmCtx, selectedDevicelist);
 
     OIC_LOG(DEBUG, TAG, "OUT OTMDoOwnershipTransfer");