Function anjay_next_planned_lifecycle_operation

Function Documentation

avs_time_real_t anjay_next_planned_lifecycle_operation(anjay_t *anjay, anjay_ssid_t ssid)

Returns the time at which next outgoing lifecycle message is planned to be sent if no outside intervention that might reschedule it (e.g. change of Lifetime - either by user code or from a server) happens until that time.

Lifecycle operations may include:

  • DTLS handshake

  • for non-bootstrap LwM2M Server:

    • Register

    • Registration Update

  • for the Bootstrap Server:

    • Request Bootstrap

    • EST Simple Re-enroll

NOTE: This function may internally perform conversion between time values attached to different clocks (real-time clock vs. monotonic clock), which depends on immediate readings of those clocks. For this reason, the calculated value may slightly change from call to call, even if no action was performed in between. This accuracy depends on the accuracy of the underlying clocks as well as CPU performance. It is generally expected to be accurate within single-digit milliseconds, but it is recommended to avoid code that would perform direct comparisons on those values.

Parameters:
  • anjay – Anjay object to operate on.

  • ssid – Either one of:

    • Short Server ID of a single regular LwM2M Server for which to get the information

    • ANJAY_SSID_BOOTSTRAP if information about the Bootstrap Server is requested

    • ANJAY_SSID_ANY to get time of the nearest operation scheduled for any known server connection

Returns:

Point in time according to the real-time clock at which some of the operations mentioned above is scheduled, or AVS_TIME_REAL_INVALID if there are none.