@@ -410,6 +410,95 @@ value of 1 is ok here).
410410
411411 For a more detailed LwM2M client sample see: :ref: `lwm2m-client-sample `.
412412
413+ LwM2M engine and application events
414+ ***********************************
415+
416+ The Zephyr LwM2M engine defines events that can be sent back to the application through callback
417+ functions.
418+ The engine state machine shows when the events are spawned.
419+ Events depicted in the diagram are listed in the table.
420+ The events are prefixed with ``LWM2M_RD_CLIENT_EVENT_ ``.
421+
422+ .. figure :: images/lwm2m_engine_state_machine.png
423+ :alt: LwM2M engine state machine
424+
425+ State machine for the LwM2M engine
426+
427+ .. list-table :: LwM2M RD Client events
428+ :widths: auto
429+ :header-rows: 1
430+
431+ * - Event ID
432+ - Event Name
433+ - Description
434+ - Actions
435+ * - 0
436+ - NONE
437+ - No event
438+ - Do nothing
439+ * - 1
440+ - BOOTSTRAP_REG_FAILURE
441+ - Bootstrap registration failed.
442+ Occurs if there is a timeout or failure in bootstrap registration.
443+ - Retry bootstrap
444+ * - 2
445+ - BOOTSTRAP_REG_COMPLETE
446+ - Bootstrap registration complete.
447+ Occurs after successful bootstrap registration.
448+ - No actions needed
449+ * - 3
450+ - BOOTSTRAP_TRANSFER_COMPLETE
451+ - Bootstrap finish command received from the server.
452+ - No actions needed, client proceeds to registration.
453+ * - 4
454+ - REGISTRATION_FAILURE
455+ - Registration to LwM2M server failed.
456+ Occurs if there is a timeout or failure in the registration.
457+ - Retry registration
458+ * - 5
459+ - REGISTRATION_COMPLETE
460+ - Registration to LwM2M server successful.
461+ Occurs after a successful registration reply from the LwM2M server
462+ or when session resumption is used.
463+ - No actions needed
464+ * - 6
465+ - REG_UPDATE_FAILURE
466+ - Registration update failed.
467+ Occurs if there is a timeout during registration update.
468+ NOTE: If registration update fails without a timeout,
469+ a full registration is triggered automatically and
470+ no registration update failure event is generated.
471+ - No actions needed, client proceeds to re-registration automatically.
472+ * - 7
473+ - REG_UPDATE_COMPLETE
474+ - Registration update completed.
475+ Occurs after successful registration update reply from the LwM2M server.
476+ - No actions needed
477+ * - 8
478+ - DEREGISTER_FAILURE
479+ - Deregistration to LwM2M server failed.
480+ Occurs if there is a timeout or failure in the deregistration.
481+ - No actions needed, client proceeds to idle state automatically.
482+ * - 9
483+ - DISCONNECT
484+ - Disconnected from LwM2M server.
485+ Occurs if there is a timeout during communication with server.
486+ Also triggered after deregistration has been done.
487+ - If connection is required, the application should restart the client.
488+ * - 10
489+ - QUEUE_MODE_RX_OFF
490+ - Used only in queue mode, not actively listening for incoming packets.
491+ In queue mode the client is not required to actively listen for the incoming packets
492+ after a configured time period.
493+ - No actions needed
494+ * - 11
495+ - NETWORK_ERROR
496+ - Sending messages to the network failed too many times.
497+ If sending a message fails, it will be retried.
498+ If the retry counter reaches its limits, this event will be triggered.
499+ - No actions needed, client will do a re-registrate automatically.
500+
501+
413502.. _lwm2m_api_reference :
414503
415504API Reference
0 commit comments