net: lwm2m: Add API function to delete object instance

Since the API already has a function to create an LwM2M object instance,
it makes sense to add a corresponding delete funtion, allowing the
application to delete created objects.

Additionally, for the remote delete set the Registration Update trigger
only when not in bootstrap mode.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
Robert Lubos 2021-04-15 12:43:40 +02:00 committed by Anas Nashif
commit 0d1577f7fe
3 changed files with 50 additions and 2 deletions

View file

@ -441,6 +441,17 @@ int lwm2m_engine_update_observer_max_period(char *pathstr, uint32_t period_s);
*/
int lwm2m_engine_create_obj_inst(char *pathstr);
/**
* @brief Delete an LwM2M object instance.
*
* LwM2M clients use this function to delete LwM2M objects.
*
* @param[in] pathstr LwM2M path string "obj/obj-inst"
*
* @return 0 for success or negative in case of error.
*/
int lwm2m_engine_delete_obj_inst(char *pathstr);
/**
* @brief Set resource (instance) value (opaque buffer)
*