net: lwm2m: Prevent notifications on non-readable resources
In case a non-readable resource gets updated (either by the server or with an API), it makes no sense to send a notification in such case, as no such resources are not included in notifications anyway. Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
parent
abcbfed6c3
commit
0722e1d896
1 changed files with 4 additions and 2 deletions
|
@ -1675,7 +1675,7 @@ static int lwm2m_engine_set(char *pathstr, void *value, uint16_t len)
|
||||||
data_ptr, len, false, 0);
|
data_ptr, len, false, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (changed) {
|
if (changed && LWM2M_HAS_PERM(obj_field, LWM2M_PERM_R)) {
|
||||||
NOTIFY_OBSERVER_PATH(&path);
|
NOTIFY_OBSERVER_PATH(&path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2748,7 +2748,9 @@ int lwm2m_write_handler(struct lwm2m_engine_obj_inst *obj_inst,
|
||||||
|
|
||||||
res_inst->data_len = len;
|
res_inst->data_len = len;
|
||||||
|
|
||||||
|
if (LWM2M_HAS_PERM(obj_field, LWM2M_PERM_R)) {
|
||||||
NOTIFY_OBSERVER_PATH(&msg->path);
|
NOTIFY_OBSERVER_PATH(&msg->path);
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue