Function anj_core_restart

Function Documentation

void anj_core_restart(anj_t *anj)

Restarts the Anjay Lite client by resetting its internal state to ANJ_CONN_STATUS_INITIAL.

This fully reinitializes the LwM2M connection cycle and can be used after configuration changes, error recovery, or a user-triggered reset.

Actions performed:

  • If the client is registered, a De-Register message is sent before the connection is closed.

  • If Bootstrap or Registration is in progress, it is aborted immediately.

Warning

If the client is in the ANJ_CONN_STATUS_SUSPENDED state due to a server-triggered Disable operation (see anj_core_server_obj_disable_executed), it is expected to remain disconnected until the disable timeout expires. Reconnecting earlier is technically possible, but it will cause the client to ignore the server’s request to stay offline for the specified duration.

Parameters:

anj – Anjay object.