Commit graph

14 commits

Author SHA1 Message Date
Jukka Rissanen 931dffd755 net: doc: conn_mgr_connectivity.h: @endcond was incorrectly placed
The net_event_conn_cmd is internal so no need to generate public
documentation for it.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-05-21 15:41:19 -07:00
Ederson de Souza 28d08ada28 include/zephyr: Add 'version' and 'since' tag to groups
Based on information from doc/develop/api/overview.rst, add current
version for some groups representing APIs, following the following
table:

  - Experimental:   0.1.0
  - Unstable:       0.8.0
  - Stable:         1.0.0

Also based on doc/develop/api/overview.rst, add 'since' tag to the
groups.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-03-19 13:13:45 +01:00
Georges Oates_Larsen 98a506f341 net: conn_mgr: Write documentation
Write documentation for conn_mgr and its subsystems, especially
guidelines for writing connectivity implementations

Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
2023-09-28 15:11:14 +02:00
Georges Oates_Larsen fe61d65b2e net: conn_mgr: Fix connectivity event enum type
Connectivity event enum type was erroneously named
net_event_ethernet_cmd.

This PR corrects the name to net_event_conn_cmd.

Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
2023-09-28 15:11:14 +02:00
Georges Oates_Larsen 6d2ce0b30b net: conn_mgr: Create separate connectivity implementation API.
Splits many definitions from conn_mgr_connectivity.h off into their own
header, conn_mgr_connectivity_impl.h

conn_mgr_connectivity.h now focuses solely on user/application-facing
APIs, and conn_mgr_connectivity_impl now contains all functions, utils,
definitions intended for use by connectivity implementations, including
conn_mgr_if_get_binding, which is now available for use by connectivity
implementations.

This lays the foundation for allowing connectivity implementations
easier and safer access to their internal state through internal APIs.

Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
2023-08-29 16:13:37 +02:00
Benjamin Cabé 38775fa6db doc: net: conn_mgr: Doxygen cleanup
Added some missing doxygen comments (missing javadoc style syntax)
Fixed some brief descriptions
Added named heading in conn_mgr_conn_binding

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-08-11 12:01:41 +00:00
Georges Oates_Larsen ad6fdaf2c2 net: conn_mgr: Bulk convenience functions
To further reduce the need for networking boilerplate in applications,
provide bulk versions of net_if_up, net_if_down, conn_mgr_if_connect,
and conn_mgr_if_disconnect that affect all available / eligible ifaces
at once.

Since it is not intuitive whether these functions should affect ifaces
which conn_mgr is ignoring, these functions take an argument that allows
this to be specified by the application.

Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
2023-06-30 16:10:23 +02:00
Georges Oates_Larsen b65613e79c net: conn_mgr: Support Auto-Down
To reduce the amount of boiler-plate needed in applications, this commit
grants conn_mgr the ability to automatically take ifaces that have given
up on connecting into the admin-down state.

Tests adjusted as appropriate.

This behavior can be disabled globally by disabling
NET_CONNECTION_MANAGER_AUTO_IF_DOWN, or disabled per-iface using the
CONN_MGR_IF_NO_AUTO_DOWN flag.

Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
2023-06-30 16:10:23 +02:00
Georges Oates_Larsen f3d75c4c65 net: conn_mgr: Support Auto-Connect
To reduce the need for boilerplate in application code, conn_mgr now
supports an auto-connect feature on all ifaces with connectivity
bindings.

conn_mgr will automatically call conn_mgr_if_connect on any iface with a
connectivity binding that enters the admin-up state, unless the newly
added CONN_MGR_IF_NO_AUTO_CONNECT flag has been set for that iface.

Also adjust automated tests to account for and take advantage of this
behavior.

Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
2023-06-30 16:10:23 +02:00
Georges Oates_Larsen 8785a9f424 net: conn_mgr: Minor fixes
- Add missing event sleep after taking all ifaces up in
  test_connect_disconnect.
- Add missing event sleep after resetting ifaces in conn_mgr_conn_before
- Fix typo in comment for internal state flags.
- Add missing NET_MGMT_EVENT_BIT to conn_mgr_connectivity event
  definitions.
- Missing net_mgmt.h include in conn_mgr_connectivity.h
- Split conn_mgr_conn iface reset into network and state resets, before
  and after event sleep, so that triggered events do not corrupt the
  state reset.
- Reduce SIMULATED_EVENT_DELAY to 100ms to avoid timeouts on real-time
  targets.
- Use macro for simulated event wait times.

Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
2023-06-30 16:10:23 +02:00
Gerard Marull-Paretas dacb3dbfeb iterable_sections: move to specific header
Until now iterable sections APIs have been part of the toolchain
(common) headers. They are not strictly related to a toolchain, they
just rely on linker providing support for sections. Most files relied on
indirect includes to access the API, now, it is included as needed.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-22 10:42:30 +02:00
Georges Oates_Larsen 62168b659e net: conn_mgr: connect/disconnect adjustments
Rather than raise error on connect if iface is down, just take the iface
up.

Rather than raise error on disconnect if iface is down, just ignore the
disconnection request.

Adjust tests and documentation accordingly.

This should make the API easier to use for applications and is more in
line with the original L2 agnostic connectivity RFC.

Also replace some instances of net_if_flag_is_set with
net_if_is_admin_up, which is cleaner and identical in function.

Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
2023-05-11 12:15:44 +02:00
Georges Oates_Larsen fdaeabfdb6 net: conn_mgr: Fix event definitions
conn_mgr events cannot be used due to mistake in event definitions.

Fix these definitions so that events can be used.

Also patch hole in test coverage that allowed this in the first
place.

Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
2023-04-24 16:29:01 +02:00
Georges Oates_Larsen 7c4397ae79 net: conn_mgr: connectivity API
Allows L2s to declare generic association/connection routines
that can be bound by name to ifaces.

Allows L2-agnostic control over connectivity/association for
iface that support it.

Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
2023-04-18 09:31:53 +02:00