net: lwm2m: Fix Registration Update send on object creation

The Registration Update message should be sent whenever an object
instance is created or deleted. Currently this was only the case when an
object instance was created by the server and not by the application.
Fix this by triggerng the Registration Update from the API function
as well.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
Robert Lubos 2021-04-15 12:46:15 +02:00 committed by Anas Nashif
commit 66c5fdc984

View file

@ -1444,7 +1444,16 @@ int lwm2m_engine_create_obj_inst(char *pathstr)
return -EINVAL;
}
return lwm2m_create_obj_inst(path.obj_id, path.obj_inst_id, &obj_inst);
ret = lwm2m_create_obj_inst(path.obj_id, path.obj_inst_id, &obj_inst);
if (ret < 0) {
return ret;
}
#if defined(CONFIG_LWM2M_RD_CLIENT_SUPPORT)
engine_trigger_update(true);
#endif
return 0;
}
int lwm2m_engine_set_res_data(char *pathstr, void *data_ptr, uint16_t data_len,