Typedef anjay_dm_transaction_commit_t

Typedef Documentation

typedef int anjay_dm_transaction_commit_t(anjay_t *anjay, const anjay_dm_object_def_t *const *obj_ptr)

A handler that is called after transaction is finished. If it fails then anjay_dm_transaction_rollback_t handler must be called by the user code if it is necessary.

NOTE: If this function fails, the data model will be left in an inconsistent state. For this reason, it may return an error value if and only if a fatal, unpredictable and irrecoverable error (e.g. physical write error) occurs. All other errors (such as invalid object state) shall be reported via anjay_dm_transaction_validate_t .

Param anjay:

Anjay Object to operate on.

Param obj_ptr:

Object definition pointer, as passed to anjay_register_object .

Return:

  • 0 on success

  • a negative value in case of error. If it returns one of ANJAY_ERR_ constants, the response message will have an appropriate CoAP response code. Otherwise, the device will respond with an unspecified (but valid) error code.