Typedef anjay_dm_resource_write_t
Defined in File dm.h
Typedef Documentation
-
typedef int anjay_dm_resource_write_t(anjay_t *anjay, const anjay_dm_object_def_t *const *obj_ptr, anjay_iid_t iid, anjay_rid_t rid, anjay_riid_t riid, anjay_input_ctx_t *ctx)
A handler that writes the Resource value, called only if the Resource is SUPPORTED and not of the ANJAY_DM_RES_E kind (as returned by anjay_dm_list_resources_t). Note that it may be called on nominally read-only Resources if the write is performed by the Bootstrap Server.
NOTE: This handler will only be called with
riidset to a valid value if the Resource has been verified to be a Multiple Resource (as returned by anjay_dm_list_resources_t).- Param anjay:
Anjay object to operate on.
- Param obj_ptr:
Object definition pointer, as passed to anjay_register_object .
- Param iid:
Object Instance ID.
- Param rid:
Resource ID.
- Param riid:
Resource Instance ID, or ANJAY_ID_INVALID in case of a Single Resource.
- Param ctx:
Input context to read the resource value from using the anjay_get_* function family.
- Return:
This handler should 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.