Function anjay_unregister_object

Function Documentation

int anjay_unregister_object(anjay_t *anjay, const anjay_dm_object_def_t *const *def_ptr)

Unregisters an Object in the data model, so that it is no longer available for access by the LwM2M Servers.

def_ptr MUST be a pointer previously passed to anjay_register_object for the same anjay object.

After a successful unregister, any resources used by the actual object may be safely freed up.

NOTE: This function MUST NOT be called from within any data model handler callback function (i.e. any of the anjay_dm_handlers_t members). Doing so is undefined behavior.

Parameters:
  • anjay – Anjay object to operate on.

  • def_ptr – Pointer to the Object definition struct.

Returns:

0 on success, a negative value if def_ptr does not correspond to any known registered object.