From ea76c1a95cf80f1a3186d28359c27ddd005910cb Mon Sep 17 00:00:00 2001 From: Nathan Heldt-Sheller Date: Wed, 12 Jul 2017 17:40:15 -0700 Subject: [PATCH] [IOT-2478] pstat.cm default in SRESET is incorrect Per spec, the /pstat.cm value should be 0x0000 0001 and .tm should be 0x0000 0000. Also fixed a similar error in RESET state values. Change-Id: I9fae4d2e5fb8845bd51c26555dcb8c774885d6f3 Signed-off-by: Nathan Heldt-Sheller Reviewed-on: https://gerrit.iotivity.org/gerrit/21413 Tested-by: jenkins-iotivity Reviewed-by: Dan Mihai --- resource/csdk/security/src/deviceonboardingstate.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/resource/csdk/security/src/deviceonboardingstate.c b/resource/csdk/security/src/deviceonboardingstate.c index 625d1b3..d896aa0 100644 --- a/resource/csdk/security/src/deviceonboardingstate.c +++ b/resource/csdk/security/src/deviceonboardingstate.c @@ -412,7 +412,7 @@ static bool EnterRESET() // Unset pstat.tm and set TAKE_OWNER // Set pstat.dos.s to RESET VERIFY_SUCCESS(TAG, - EnterStateGeneric(false, true, false, false, false, DOS_RESET), + EnterStateGeneric(false, true, false, false, true, DOS_RESET), ERROR); exit: @@ -428,10 +428,12 @@ static bool EnterSRESET() bool ret = false; // Set pstat.isop = FALSE - VERIFY_SUCCESS(TAG, OC_STACK_OK == SetPstatIsop(false), ERROR); - - // Set pstat.dos to SRESET - VERIFY_SUCCESS(TAG, OC_STACK_OK == SetPstatDosS(DOS_SRESET), ERROR); + // Set pstat.cm RESET and unset TAKE_OWNER + // Unset pstat.tm and unset TAKE_OWNER + // Set pstat.dos.s to RESET + VERIFY_SUCCESS(TAG, + EnterStateGeneric(false, true, false, false, false, DOS_SRESET), + ERROR); ret = true; -- 2.7.4