Function anjay_sw_mgmt_remove_instance

Function Documentation

int anjay_sw_mgmt_remove_instance(anjay_t *anjay, anjay_iid_t iid)

Remove an instance of Software Management object.

This method will not cause anjay_sw_mgmt_remove_handler_t to be called, as this method deletes a instance of the object on application’s request.

CAUTION: Calling this function inside any Software Management module handler with the same iid as passed to the handler, will result in an error code with value 1. This function shouldn’t be called from any module handler. In multi-threaded scenarios, it should be expected that this function can also return an error code with value 1, in case one thread calls this function when another thread is executing one of the module’s handler associated with the instance with the same iid as the one passed to this function. In this case, the user should wait a while and call this function again.

Parameters:
  • anjay – Anjay object for which the Software Management Object is installed.

  • iid – ID of Software Management object instance.

Returns:

0 on success; 1 if a handler associated with an instance with the same iid as the one passed to this function is currently being executed; a negative value in case of error