VERIFY_SUCCESS(TAG, OC_STACK_OK == SetPstatRownerId(&THE_NIL_UUID), ERROR);
// Set pstat.isop = FALSE
- // Set pstat.cm RESET and unset TAKE_OWNER
- // Unset pstat.tm and set TAKE_OWNER
+ // Set pstat.cm RESET, and unset TAKE_OWNER
+ // Unset pstat.tm RESET, and set TAKE_OWNER
// Set pstat.dos.s to RESET
VERIFY_SUCCESS(TAG,
EnterStateGeneric(false, true, false, false, true, DOS_RESET),
bool ret = false;
// Set pstat.isop = FALSE
- // Set pstat.cm RESET and unset TAKE_OWNER
- // Unset pstat.tm and unset TAKE_OWNER
+ // Set pstat.cm RESET, and unset TAKE_OWNER
+ // Unset pstat.tm RESET, and unset TAKE_OWNER
// Set pstat.dos.s to RESET
VERIFY_SUCCESS(TAG,
EnterStateGeneric(false, true, false, false, false, DOS_SRESET),
pstatMapSize++;
}
}
- OIC_LOG_V(INFO, TAG, "%s: creating pstat CBOR payload with %d Properties.",
+ OIC_LOG_V(INFO, TAG, "%s: creating pstat CBOR payload with %zu Properties.",
__func__, pstatMapSize - PSTAT_EMPTY_MAP_SIZE);
// Top Level Pstat Map
// dos Property
if (propertiesToInclude[PSTAT_DOS])
{
- OIC_LOG_V(DEBUG, TAG, "%s: including dos Property.", __func__);
+ OIC_LOG_V(DEBUG, TAG, "%s: including dos Property (s = %d).", __func__, pstat->dos.state);
// Device Onboarding State Property tag
cborEncoderResult = cbor_encode_text_string(&pstatMap, OIC_JSON_DOS_NAME,
strlen(OIC_JSON_DOS_NAME));
// isop Property
if (propertiesToInclude[PSTAT_ISOP])
{
- OIC_LOG_V(DEBUG, TAG, "%s: including isop Property.", __func__);
+ OIC_LOG_V(DEBUG, TAG, "%s: including isop Property (isop = %s).", __func__, (pstat->isOp ? "true" : "false"));
cborEncoderResult = cbor_encode_text_string(&pstatMap, OIC_JSON_ISOP_NAME,
strlen(OIC_JSON_ISOP_NAME));
VERIFY_CBOR_SUCCESS_OR_OUT_OF_MEMORY(TAG, cborEncoderResult, "Failed Adding ISOP Name Tag.");
// cm Property
if (propertiesToInclude[PSTAT_CM])
{
- OIC_LOG_V(DEBUG, TAG, "%s: including cm Property.", __func__);
+ OIC_LOG_V(DEBUG, TAG, "%s: including cm Property (cm = %d).", __func__, pstat->cm);
cborEncoderResult = cbor_encode_text_string(&pstatMap, OIC_JSON_CM_NAME,
strlen(OIC_JSON_CM_NAME));
VERIFY_CBOR_SUCCESS_OR_OUT_OF_MEMORY(TAG, cborEncoderResult, "Failed Adding CM Name Tag.");
// tm Property
if (propertiesToInclude[PSTAT_TM])
{
- OIC_LOG_V(DEBUG, TAG, "%s: including tm Property.", __func__);
+ OIC_LOG_V(DEBUG, TAG, "%s: including tm Property (tm = %d).", __func__, pstat->tm);
cborEncoderResult = cbor_encode_text_string(&pstatMap, OIC_JSON_TM_NAME,
strlen(OIC_JSON_TM_NAME));
VERIFY_CBOR_SUCCESS_OR_OUT_OF_MEMORY(TAG, cborEncoderResult, "Failed Adding TM Name Tag.");
// om Property
if (propertiesToInclude[PSTAT_OM])
{
- OIC_LOG_V(DEBUG, TAG, "%s: including om Property.", __func__);
+ OIC_LOG_V(DEBUG, TAG, "%s: including om Property (om = %d).", __func__, pstat->om);
cborEncoderResult = cbor_encode_text_string(&pstatMap, OIC_JSON_OM_NAME,
strlen(OIC_JSON_OM_NAME));
VERIFY_CBOR_SUCCESS_OR_OUT_OF_MEMORY(TAG, cborEncoderResult, "Failed Adding OM Name Tag.");
// sm Property
if (propertiesToInclude[PSTAT_SM])
{
- OIC_LOG_V(DEBUG, TAG, "%s: including sm Property.", __func__);
+ OIC_LOG_V(DEBUG, TAG, "%s: including sm Property (sm = %d).", __func__, pstat->sm[0]);
cborEncoderResult = cbor_encode_text_string(&pstatMap, OIC_JSON_SM_NAME,
strlen(OIC_JSON_SM_NAME));
VERIFY_CBOR_SUCCESS_OR_OUT_OF_MEMORY(TAG, cborEncoderResult, "Failed Adding SM Name Tag.");
strlen(OIC_JSON_ROWNERID_NAME));
VERIFY_CBOR_SUCCESS_OR_OUT_OF_MEMORY(TAG, cborEncoderResult, "Failed Adding ROwner Id Tag.");
ret = ConvertUuidToStr(&pstat->rownerID, &strUuid);
+ OIC_LOG_V(DEBUG, TAG, "%s: rowneruuid = %s.", __func__, strUuid);
VERIFY_SUCCESS(TAG, OC_STACK_OK == ret , ERROR);
cborEncoderResult = cbor_encode_text_string(&pstatMap, strUuid, strlen(strUuid));
VERIFY_CBOR_SUCCESS_OR_OUT_OF_MEMORY(TAG, cborEncoderResult, "Failed Adding ROwner Id Value.");