Function anjay_server_object_add_instance

Function Documentation

int anjay_server_object_add_instance(anjay_t *anjay, const anjay_server_instance_t *instance, anjay_iid_t *inout_iid)

Adds new Instance of Server Object and returns newly created Instance id via inout_iid .

Note: if *inout_iid is set to ANJAY_ID_INVALID then the Instance id is generated automatically, otherwise value of *inout_iid is used as a new Server Instance Id.

Note: instance may be safely freed by the user code after this function finishes (internally a deep copy of anjay_server_instance_t is performed).

Parameters:
  • anjay – Anjay instance with Server Object installed to operate on.

  • instance – Server Instance to insert.

  • inout_iid – Server Instance id to use or ANJAY_ID_INVALID .

Returns:

0 on success, negative value in case of an error or if the instance of specified id already exists.