Typedef anjay_dm_transaction_validate_t
Defined in File dm.h
Typedef Documentation
-
typedef int anjay_dm_transaction_validate_t(anjay_t *anjay, const anjay_dm_object_def_t *const *obj_ptr)
A handler that is called after transaction is finished, but before anjay_dm_transaction_commit_t is called. It is used to check whether the commit operation may be successfully performed.
Any validation of the object’s state shall be performed in this function, rather than in the commit handler. If there is a need to commit changes to multiple objects at once, this handler is called on all modified objects first, to avoid potential inconsistencies that may arise from a failing commit operation.
Returning success from this handler means that the corresponding commit function shall subsequently execute successfully. The commit handler may nevertheless fail, but if and only if a fatal, unpredictable and irrecoverable error (e.g. physical write error) occurs.
- 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.