Zephyr Project API
3.4.0
A Scalable Open Source RTOS
|
Connection Manager Connectivity API. More...
Data Structures | |
struct | conn_mgr_conn_api |
struct | conn_mgr_conn_impl |
conn_mgr Connectivity Implementation struct Declares a conn_mgr connectivity layer implementation with the provided API More... | |
struct | conn_mgr_conn_binding |
Connectivity Manager network interface binding structure. More... | |
Macros | |
#define | CONN_MGR_CONN_DEFINE(conn_id, conn_api) |
Define a conn_mgr connectivity implementation that can be bound to network devices. More... | |
#define | CONN_MGR_CONN_DECLARE_PUBLIC(conn_id) extern const struct conn_mgr_conn_impl CONN_MGR_CONN_IMPL_GET_NAME(conn_id) |
Helper macro to make a conn_mgr connectivity implementation publicly available. More... | |
#define | CONN_MGR_IF_NO_TIMEOUT 0 |
#define | CONN_MGR_BIND_CONN_INST(dev_id, inst, conn_id) |
Associate a connectivity implementation with an existing network device instance. More... | |
#define | CONN_MGR_BIND_CONN(dev_id, conn_id) CONN_MGR_BIND_CONN_INST(dev_id, 0, conn_id) |
Associate a connectivity implementation with an existing network device. More... | |
Enumerations | |
enum | conn_mgr_if_flag { CONN_MGR_IF_PERSISTENT } |
Per-iface connectivity flags. More... | |
Functions | |
int | conn_mgr_if_connect (struct net_if *iface) |
Connect interface. More... | |
int | conn_mgr_if_disconnect (struct net_if *iface) |
Disconnect interface. More... | |
bool | conn_mgr_if_is_bound (struct net_if *iface) |
Check whether the provided network interface supports connectivity / has been bound to a connectivity implementation. More... | |
int | conn_mgr_if_set_opt (struct net_if *iface, int optname, const void *optval, size_t optlen) |
Set implementation-specific connectivity options. More... | |
int | conn_mgr_if_get_opt (struct net_if *iface, int optname, void *optval, size_t *optlen) |
Get implementation-specific connectivity options. More... | |
bool | conn_mgr_if_get_flag (struct net_if *iface, enum conn_mgr_if_flag flag) |
Check the value of connectivity flags. More... | |
int | conn_mgr_if_set_flag (struct net_if *iface, enum conn_mgr_if_flag flag, bool value) |
Set the value of a connectivity flags. More... | |
int | conn_mgr_if_get_timeout (struct net_if *iface) |
Get the connectivity timeout for an iface. More... | |
int | conn_mgr_if_set_timeout (struct net_if *iface, int timeout) |
Set the connectivity timeout for an iface. More... | |
void | conn_mgr_conn_init (void) |
Initialize all connectivity implementation bindings. More... | |
Connection Manager Connectivity API.
#define CONN_MGR_BIND_CONN | ( | dev_id, | |
conn_id | |||
) | CONN_MGR_BIND_CONN_INST(dev_id, 0, conn_id) |
#include <include/zephyr/net/conn_mgr_connectivity.h>
Associate a connectivity implementation with an existing network device.
dev_id | Network device id. |
conn_id | Name of the connectivity implementation to associate. |
#define CONN_MGR_BIND_CONN_INST | ( | dev_id, | |
inst, | |||
conn_id | |||
) |
#include <include/zephyr/net/conn_mgr_connectivity.h>
Associate a connectivity implementation with an existing network device instance.
dev_id | Network device id. |
inst | Network device instance. |
conn_id | Name of the connectivity implementation to associate. |
#define CONN_MGR_CONN_DECLARE_PUBLIC | ( | conn_id | ) | extern const struct conn_mgr_conn_impl CONN_MGR_CONN_IMPL_GET_NAME(conn_id) |
#include <include/zephyr/net/conn_mgr_connectivity.h>
Helper macro to make a conn_mgr connectivity implementation publicly available.
#define CONN_MGR_CONN_DEFINE | ( | conn_id, | |
conn_api | |||
) |
#include <include/zephyr/net/conn_mgr_connectivity.h>
Define a conn_mgr connectivity implementation that can be bound to network devices.
conn_id | The name of the new connectivity implementation |
conn_api | A pointer to a conn_mgr_conn_api struct |
#define CONN_MGR_IF_NO_TIMEOUT 0 |
#include <include/zephyr/net/conn_mgr_connectivity.h>
enum conn_mgr_if_flag |
#include <include/zephyr/net/conn_mgr_connectivity.h>
Per-iface connectivity flags.
Enumerator | |
---|---|
CONN_MGR_IF_PERSISTENT |
void conn_mgr_conn_init | ( | void | ) |
#include <include/zephyr/net/conn_mgr_connectivity.h>
Initialize all connectivity implementation bindings.
int conn_mgr_if_connect | ( | struct net_if * | iface | ) |
#include <include/zephyr/net/conn_mgr_connectivity.h>
Connect interface.
If the provided iface has been bound to a connectivity implementation, initiate network connect/association.
Automatically takes the iface admin-up (by calling net_if_up) if it isn't already.
Non-Blocking.
iface | Pointer to network interface |
0 | on success. |
-ESHUTDOWN | if the iface is not admin-up. |
-ENOTSUP | if the iface does not have a connectivity implementation. |
implementation-specific | status code otherwise. |
int conn_mgr_if_disconnect | ( | struct net_if * | iface | ) |
#include <include/zephyr/net/conn_mgr_connectivity.h>
Disconnect interface.
If the provided iface has been bound to a connectivity implementation, disconnect/dissassociate it from the network, and cancel any pending attempts to connect/associate.
Does nothing if the iface is currently admin-down.
iface | Pointer to network interface |
0 | on success. |
-ENOTSUP | if the iface does not have a connectivity implementation. |
implementation-specific | status code otherwise. |
bool conn_mgr_if_get_flag | ( | struct net_if * | iface, |
enum conn_mgr_if_flag | flag | ||
) |
#include <include/zephyr/net/conn_mgr_connectivity.h>
Check the value of connectivity flags.
If the provided iface is bound to a connectivity implementation, retrieves the value of the specified connectivity flag associated with that iface.
iface | - Pointer to the network interface to check. |
flag | - The flag to check. |
#include <include/zephyr/net/conn_mgr_connectivity.h>
Get implementation-specific connectivity options.
If the provided iface has been bound to a connectivity implementation that supports it, retrieves implementation-specific connectivity options related to the iface.
iface | Pointer to the network interface. |
optname | Integer value representing the option to set. The meaning of values is up to the conn_mgr_conn_api implementation. Some settings may be shared by multiple ifaces. |
optval | Pointer to where the retrieved value should be stored. |
optlen | Pointer to length (in bytes) of the destination buffer available for storing the retrieved value. If the available space is less than what is needed, -ENOBUFS is returned. If the available space is invalid, -EINVAL is returned. |
optlen will always be set to the total number of bytes written, regardless of whether an error is returned, even if zero bytes were written.
0 | if successful. |
-ENOTSUP | if conn_mgr_if_get_opt is not implemented by the iface. |
-ENOBUFS | if retrieval buffer is too small. |
-EINVAL | if invalid retrieval buffer length is provided, or if NULL optval or optlen pointer provided. |
-ENOPROTOOPT | if the optname is not recognized. |
implementation-specific | error code otherwise. |
int conn_mgr_if_get_timeout | ( | struct net_if * | iface | ) |
#include <include/zephyr/net/conn_mgr_connectivity.h>
Get the connectivity timeout for an iface.
If the provided iface is bound to a connectivity implementation, retrieves the timeout setting in seconds for it.
iface | - Pointer to the iface to check. |
#include <include/zephyr/net/conn_mgr_connectivity.h>
Check whether the provided network interface supports connectivity / has been bound to a connectivity implementation.
iface | Pointer to the iface to check. |
true | if connectivity is supported (a connectivity implementation has been bound). |
false | otherwise. |
int conn_mgr_if_set_flag | ( | struct net_if * | iface, |
enum conn_mgr_if_flag | flag, | ||
bool | value | ||
) |
#include <include/zephyr/net/conn_mgr_connectivity.h>
Set the value of a connectivity flags.
If the provided iface is bound to a connectivity implementation, sets the value of the specified connectivity flag associated with that iface.
iface | - Pointer to the network interface to modify. |
flag | - The flag to set. |
value | - Whether the flag should be enabled or disabled. |
0 | on success. |
-EINVAL | if the flag does not exist. |
-ENOTSUP | if the provided iface is not bound to a connectivity implementation. |
#include <include/zephyr/net/conn_mgr_connectivity.h>
Set implementation-specific connectivity options.
If the provided iface has been bound to a connectivity implementation that supports it, implementation-specific connectivity options related to the iface.
iface | Pointer to the network interface. |
optname | Integer value representing the option to set. The meaning of values is up to the conn_mgr_conn_api implementation. Some settings may affect multiple ifaces. |
optval | Pointer to the value to be assigned to the option. |
optlen | Length (in bytes) of the value to be assigned to the option. |
0 | if successful. |
-ENOTSUP | if conn_mgr_if_set_opt not implemented by the iface. |
-ENOBUFS | if optlen is too long. |
-EINVAL | if NULL optval pointer provided. |
-ENOPROTOOPT | if the optname is not recognized. |
implementation-specific | error code otherwise. |
int conn_mgr_if_set_timeout | ( | struct net_if * | iface, |
int | timeout | ||
) |
#include <include/zephyr/net/conn_mgr_connectivity.h>
Set the connectivity timeout for an iface.
If the provided iface is bound to a connectivity implementation, sets the timeout setting in seconds for it.
iface | - Pointer to the network interface to modify. |
timeout | - The timeout value to set (in seconds). Pass CONN_MGR_IF_NO_TIMEOUT to disable the timeout. |
0 | on success. |
-ENOTSUP | if the provided iface is not bound to a connectivity implementation. |