Function anjay_notify_changed

Function Documentation

int anjay_notify_changed(anjay_t *anjay, anjay_oid_t oid, anjay_iid_t iid, anjay_rid_t rid)

Notifies the library that the value of given Resource changed. Calling this function does not send the notification immediately, but schedules a job to be run on the next event loop iteration. This job may trigger a LwM2M Notify message, update server connections and perform other tasks, as required for the specified Resource.

This function may be called before or after the value of a given Resource changed in the DM, as long as the Resource is updated before the scheduled notification job is executed. This ensures that the notification reflects the correct value. Please see documentation of AVS_SCHED_AT and anjay_sched_run for more information.

Note that it should not be called after a Write performed by the LwM2M server.

Parameters:
  • anjay – Anjay object to operate on.

  • oid – Object ID of the changed Resource.

  • iid – Object Instance ID of the changed Resource.

  • rid – Resource ID of the changed Resource.

Returns:

0 on success, a negative value in case of error.