Commit 2165e2a6 authored by Kishen Maloor's avatar Kishen Maloor

oc_pstat: fix logic for removing observers

Signed-off-by: Kishen Maloor's avatarKishen Maloor <kishen.maloor@intel.com>
parent 67df64e4
......@@ -258,9 +258,6 @@ oc_pstat_handle_state(oc_sec_pstat_t *ps, size_t device, bool from_storage,
ps->p = false;
} break;
case OC_DOS_RFNOP: {
#ifdef OC_SERVER
coap_remove_observers_on_dos_change(device, false);
#endif /* OC_SERVER */
ps->p = true;
ps->cm = 0;
ps->tm = 0;
......@@ -313,6 +310,9 @@ oc_pstat_handle_state(oc_sec_pstat_t *ps, size_t device, bool from_storage,
goto pstat_state_error;
}
ps->p = false;
#ifdef OC_SERVER
coap_remove_observers_on_dos_change(device, false);
#endif /* OC_SERVER */
} break;
case OC_DOS_SRESET: {
ps->p = true;
......
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