Commit e0d2b88e authored by Nathan Heldt-Sheller's avatar Nathan Heldt-Sheller Committed by Aleksey

Revert "Merge branch 'feat-owned-readonly'"

This reverts commit eea3fc82.

We decided to keep IoTivity compatible with v2.0.1.  This
change is for v2.0.2 and the feature can be 3-pillar aligned using the branch.

Change-Id: Ifcd62c91fc28730bfd5011992782352d7636a641
Signed-off-by: Nathan Heldt-Sheller's avatarNathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
parent 70e5da93
......@@ -725,13 +725,6 @@ struct OicSecPdAcl
OIC_SEC_ACL_V2 : OIC_SEC_ACL_V1)
#define IS_OIC(specVer) ((specVer)[0] == 'c' && (specVer)[1] == 'o' && (specVer)[2] == 'r' && (specVer)[3] == 'e')
#define IS_OCF(specVer) ((specVer)[0] == 'o' && (specVer)[1] == 'c' && (specVer)[2] == 'f')
#define GET_OCF_MAJOR_VER(specVer) ((int)((specVer)[4] - '0'))
#define GET_OCF_MINOR_VER(specVer) ((int)((specVer)[6] - '0'))
#ifdef __cplusplus
}
#endif
......
......@@ -2289,15 +2289,7 @@ static OCStackResult PostOwnershipInformation(OTMContext_t* otmCtx)
uint8_t numOptions = 0;
bool propertiesToInclude[DOXM_PROPERTY_COUNT];
memset(propertiesToInclude, 0, sizeof(propertiesToInclude));
if ( ! ( IS_OCF(otmCtx->selectedDeviceInfo->specVer)
&& ( GET_OCF_MAJOR_VER(otmCtx->selectedDeviceInfo->specVer) > 2
|| ( GET_OCF_MAJOR_VER(otmCtx->selectedDeviceInfo->specVer) == 2
&& GET_OCF_MINOR_VER(otmCtx->selectedDeviceInfo->specVer) >= 1) ) )
)
{
OIC_LOG_V(DEBUG, TAG, "%s: Pre ocf.2.1.x version detected", __func__);
propertiesToInclude[DOXM_OWNED] = true;
}
propertiesToInclude[DOXM_OWNED] = true;
//include rowner uuid
propertiesToInclude[DOXM_ROWNERUUID] = true;
//doxm.rowneruuid set to the provisioningclient's /doxm.deviceuuid.
......
......@@ -101,6 +101,9 @@ static bool IsReadyToEnterRFNOP(void)
// Note: pstat.dos.p asserted by DoStateChange(), so not checked here.
// Verify doxm.owned == TRUE.
VERIFY_TRUE_OR_EXIT(TAG, IsDoxmOwned(), WARNING);
// Verify doxm.devowneruuid != nil UUID.
VERIFY_TRUE_OR_EXIT(TAG, !IsDoxmDevowneruuidTheNilUuid(), WARNING);
......@@ -170,6 +173,9 @@ static bool IsReadyToEnterRFPRO(void)
// Note: pstat.dos.p asserted by DoStateChange(), so not checked here.
// Verify doxm.owned == TRUE.
VERIFY_TRUE_OR_EXIT(TAG, IsDoxmOwned(), WARNING);
// Verify doxm.devowneruuid != nil UUID.
VERIFY_TRUE_OR_EXIT(TAG, !IsDoxmDevowneruuidTheNilUuid(), WARNING);
......@@ -305,16 +311,8 @@ static bool EnterRFNOP(void)
// Unset pstat.cm RESET and TAKE_OWNER bits
// Unset pstat.tm RESET and TAKE_OWNER bits
// Set pstat.dos to RFNOP
VERIFY_SUCCESS(TAG,
EnterStateGeneric(true, false, false, false, false, DOS_RFNOP),
ERROR);
// Set doxm.owned = TRUE
VERIFY_SUCCESS(TAG, OC_STACK_OK == SetDoxmIsOwned(true), ERROR);
ret = EnterStateGeneric(true, false, false, false, false, DOS_RFNOP);
ret = true;
exit:
OIC_LOG_V(DEBUG, TAG, "%s: returning %s.", __func__, ret?"true":"false");
return ret;
}
......@@ -330,15 +328,8 @@ static bool EnterRFOTM(void)
// Unset pstat.cm RESET bit, and set TAKE_OWNER bit
// Unset pstat.tm RESET and TAKE_OWNER bits
// Set pstat.dos to RFOTM
VERIFY_SUCCESS(TAG,
EnterStateGeneric(false, false, true, false, false, DOS_RFOTM),
ERROR);
// Set doxm.owned = FALSE
VERIFY_SUCCESS(TAG, OC_STACK_OK == SetDoxmIsOwned(false), ERROR);
ret = EnterStateGeneric(false, false, true, false, false, DOS_RFOTM);
ret = true;
exit:
OIC_LOG_V(DEBUG, TAG, "%s: returning %s.", __func__, ret?"true":"false");
return ret;
}
......@@ -354,15 +345,8 @@ static bool EnterRFPRO(void)
// Unset pstat.cm RESET and TAKE_OWNER bits
// Unset pstat.tm RESET and TAKE_OWNER bits
// Set pstat.dos to RFPRO
VERIFY_SUCCESS(TAG,
EnterStateGeneric(false, false, false, false, false, DOS_RFPRO),
ERROR);
ret = EnterStateGeneric(false, false, false, false, false, DOS_RFPRO);
// Set doxm.owned = TRUE
VERIFY_SUCCESS(TAG, OC_STACK_OK == SetDoxmIsOwned(true), ERROR);
ret = true;
exit:
OIC_LOG_V(DEBUG, TAG, "%s: returning %s.", __func__, ret?"true":"false");
return ret;
}
......
......@@ -111,7 +111,7 @@ static const uint8_t gDoxmPropertyAccessModes[DOXM_PROPERTY_COUNT][DOS_STATE_COU
{ R, RW, R, R, R }, // .oxmsel
#endif // MULTIPLE_OWNER
{ R, R, R, R, R }, // .sct
{ R, R, R, R, R }, // .owned
{ R, RW, R, R, R }, // .owned
#ifdef MULTIPLE_OWNER
{ RW, RW, RW, RW, RW }, // .subowner
{ RW, RW, RW, RW, RW }, // .mom
......@@ -2112,10 +2112,8 @@ OCStackResult SetDoxmIsOwned(const bool isowned)
if (gDoxm)
{
gDoxm->owned = isowned;
VERIFY_SUCCESS(TAG, UpdatePersistentStorage(gDoxm), ERROR);
return OC_STACK_OK;
}
exit:
return OC_STACK_ERROR;
}
......
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