Function anjay_send_deferrable
Defined in File lwm2m_send.h
Function Documentation
-
anjay_send_result_t anjay_send_deferrable(anjay_t *anjay, anjay_ssid_t ssid, const anjay_send_batch_t *data, anjay_send_finished_handler_t *finished_handler, void *finished_handler_data)
Sends data to the LwM2M server, either immediately, or deferring it until such operation will be possible.
This function is equivalent to anjay_send, but in cases when the former would return ANJAY_SEND_ERR_OFFLINE or ANJAY_SEND_ERR_BOOTSTRAP, this variant returns success and postpones the actual Send operation until the server connection identified by
ssidis online.If at that time, the server in question will be removed from the data model, registered using a LwM2M version that does not support the Send operation (i.e., LwM2M 1.0), or the Mute Send resource changes while the Send is deferred, the operation is cancelled and
finished_handleris called with theresultargument set to ANJAY_SEND_DEFERRED_ERROR.- Parameters:
anjay – Anjay object to operate on.
ssid – Short Server ID of target LwM2M Server. Cannot be ANJAY_SSID_ANY or ANJAY_SSID_BOOTSTRAP.
data – Content of the message compiled previously with anjay_send_batch_builder_compile .
finished_handler – Handler called if the server confirmed message delivery or if no response was received in expected time (handler can be NULL).
finished_handler_data – Data for the handler.
- Returns:
one of the anjay_send_result_t enum values.