Function anjay_send
Defined in File lwm2m_send.h
Function Documentation
-
anjay_send_result_t anjay_send(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 without explicit request by that Server.
During the next call to anjay_sched_run
datawill be sent asynchronously to the Server with specifiedssidbut only if Mute Send resource of the server instance associated withssidis set to false. Otherwise nothing is sent and ANJAY_SEND_ERR_MUTED is returned.datamust not be NULL but it can be everything successfully returned from anjay_send_batch_builder_compile . Even empty batch is acceptable:Before sending content ofanjay_send_batch_builder_t *builder = anjay_send_batch_builder_new(); anjay_send_batch_t *empty_batch = anjay_send_batch_builder_compile(&builder); anjay_send(anjay, ssid, empty_batch, NULL, NULL);
datais filtered according to Access Control permissions of a particular server. The server will get only those entries ofdatawhich paths were configured by anjay_access_control_set_acl with enabledANJAY_ACCESS_MASK_READ.If
finished_handleris not NULL it will always be called at some point - after receiving acknowledgement from the Server or if no response was received in expected time.Success of this function means only that the data has been sent, not necessarily delivered. Data is delivered if and only if
finished_handlerwith statusANJAY_SEND_SUCCESSis called.- 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.