Skip to content

Commit 7c82c06

Browse files
JordanYatesjhedberg
authored andcommitted
doc: networking: conn_mgr: document idle timeouts
Add documentation for the new idle timeout feature of the connection manager. Signed-off-by: Jordan Yates <[email protected]>
1 parent b4025e8 commit 7c82c06

File tree

1 file changed

+27
-0
lines changed
  • doc/connectivity/networking/conn_mgr

1 file changed

+27
-0
lines changed

doc/connectivity/networking/conn_mgr/main.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,14 @@ You can individually set them for each iface.
294294
It is left to connectivity implementations to successfully and accurately implement these two features as described below.
295295
See :ref:`conn_mgr_impl_timeout_persistence` for more details from the connectivity implementation perspective.
296296

297+
The Connection Manager also implements the following optional feature:
298+
299+
* :ref:`Interface idle timeouts <conn_mgr_control_idle_timeout>`
300+
301+
.. note::
302+
The only requirement on the connectivity implementation to implement idle timeouts is to call :c:func:`conn_mgr_if_used` each
303+
time the interface is used.
304+
297305
.. _conn_mgr_control_timeouts:
298306

299307
Connection Timeouts
@@ -306,6 +314,16 @@ The connection attempt continues indefinitely until it succeeds, unless a timeou
306314
In that case, the connection attempt will be abandoned if the timeout elapses before it succeeds.
307315
If this happens, the :ref:`timeout event<conn_mgr_control_events_timeout>` is raised.
308316

317+
.. _conn_mgr_control_idle_timeout:
318+
319+
Interface Idle Timeout
320+
----------------------
321+
322+
The connection manager enables users to apply an inactivity timeout on an interface (:c:func:`conn_mgr_if_set_idle_timeout`).
323+
Once connected, if the interface goes for the configured number of seconds without any activity, the interface is automatically disconnected.
324+
If this happens, the :ref:`idle timeout event<conn_mgr_control_events_idle_timeout>` is raised.
325+
An idle timeout is considered an unintentional connection loss for the purposes of :ref:`Connection persistence <conn_mgr_control_persistence>`.
326+
309327
.. _conn_mgr_control_persistence:
310328

311329
Connection Persistence
@@ -357,6 +375,15 @@ The :c:macro:`NET_EVENT_CONN_IF_TIMEOUT` event is raised when an :ref:`iface ass
357375

358376
Handlers of this event will be passed a pointer to the iface that timed out attempting to associate.
359377

378+
.. _conn_mgr_control_events_idle_timeout:
379+
380+
Idle Timeout
381+
------------
382+
383+
The :c:macro:`NET_EVENT_CONN_IF_IDLE_TIMEOUT` event is raised when an interface is considered :ref:`inactive <conn_mgr_control_idle_timeout>`.
384+
385+
Handlers of this event will be passed a pointer to the iface that timed out attempting to associate.
386+
360387
.. _conn_mgr_control_events_listening:
361388

362389
Listening for control events

0 commit comments

Comments
 (0)