Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Connection Manager Connectivity Implementation API

Connection Manager Connectivity Implementation API . More...

Data Structures

struct  conn_mgr_conn_api
 Connectivity Manager Connectivity API structure. More...
 
struct  conn_mgr_conn_impl
 Connectivity Implementation struct. 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.
 
#define CONN_MGR_CONN_DECLARE_PUBLIC(conn_id)
 Helper macro to make a conn_mgr connectivity implementation publicly available.
 
#define CONN_MGR_BIND_CONN_INST(dev_id, inst, conn_id)
 Associate a connectivity implementation with an existing network device instance.
 
#define CONN_MGR_BIND_CONN(dev_id, conn_id)
 Associate a connectivity implementation with an existing network device.
 

Functions

static struct conn_mgr_conn_bindingconn_mgr_if_get_binding (struct net_if *iface)
 Retrieves the conn_mgr binding struct for a provided iface if it exists.
 
static void conn_mgr_binding_lock (struct conn_mgr_conn_binding *binding)
 Lock the passed-in binding, making it safe to access.
 
static void conn_mgr_binding_unlock (struct conn_mgr_conn_binding *binding)
 Unlocks the passed-in binding.
 
static void conn_mgr_binding_set_flag (struct conn_mgr_conn_binding *binding, enum conn_mgr_if_flag flag, bool value)
 Set the value of the specified connectivity flag for the provided binding.
 
static bool conn_mgr_binding_get_flag (struct conn_mgr_conn_binding *binding, enum conn_mgr_if_flag flag)
 Check the value of the specified connectivity flag for the provided binding.
 

Detailed Description

Connection Manager Connectivity Implementation API .

Since
3.4
Version
0.1.0

Macro Definition Documentation

◆ CONN_MGR_BIND_CONN

#define CONN_MGR_BIND_CONN ( dev_id,
conn_id )

#include <zephyr/net/conn_mgr_connectivity_impl.h>

Value:
CONN_MGR_BIND_CONN_INST(dev_id, 0, conn_id)
#define CONN_MGR_BIND_CONN_INST(dev_id, inst, conn_id)
Associate a connectivity implementation with an existing network device instance.
Definition conn_mgr_connectivity_impl.h:213

Associate a connectivity implementation with an existing network device.

Parameters
dev_idNetwork device id.
conn_idName of the connectivity implementation to associate.

◆ CONN_MGR_BIND_CONN_INST

#define CONN_MGR_BIND_CONN_INST ( dev_id,
inst,
conn_id )

#include <zephyr/net/conn_mgr_connectivity_impl.h>

Value:
K_MUTEX_DEFINE(CONN_MGR_CONN_BINDING_GET_MUTEX(dev_id, inst)); \
static CONN_MGR_CONN_IMPL_GET_CTX_TYPE(conn_id) \
CONN_MGR_CONN_BINDING_GET_DATA(dev_id, inst); \
CONN_MGR_CONN_BINDING_GET_NAME(dev_id, inst)) = { \
.iface = NET_IF_GET(dev_id, inst), \
.impl = &(CONN_MGR_CONN_IMPL_GET_NAME(conn_id)), \
.ctx = &(CONN_MGR_CONN_BINDING_GET_DATA(dev_id, inst)), \
.mutex = &(CONN_MGR_CONN_BINDING_GET_MUTEX(dev_id, inst)) \
};
#define STRUCT_SECTION_ITERABLE(struct_type, varname)
Defines a new element for an iterable section.
Definition iterable_sections.h:216
#define K_MUTEX_DEFINE(name)
Statically define and initialize a mutex.
Definition kernel.h:3047
Connectivity Manager network interface binding structure.
Definition conn_mgr_connectivity_impl.h:162

Associate a connectivity implementation with an existing network device instance.

Parameters
dev_idNetwork device id.
instNetwork device instance.
conn_idName of the connectivity implementation to associate.

◆ CONN_MGR_CONN_DECLARE_PUBLIC

#define CONN_MGR_CONN_DECLARE_PUBLIC ( conn_id)

#include <zephyr/net/conn_mgr_connectivity_impl.h>

Value:
extern const struct conn_mgr_conn_impl CONN_MGR_CONN_IMPL_GET_NAME(conn_id)
Connectivity Implementation struct.
Definition conn_mgr_connectivity_impl.h:128

Helper macro to make a conn_mgr connectivity implementation publicly available.

◆ CONN_MGR_CONN_DEFINE

#define CONN_MGR_CONN_DEFINE ( conn_id,
conn_api )

#include <zephyr/net/conn_mgr_connectivity_impl.h>

Value:
const struct conn_mgr_conn_impl CONN_MGR_CONN_IMPL_GET_NAME(conn_id) = { \
.api = conn_api, \
};

Define a conn_mgr connectivity implementation that can be bound to network devices.

Parameters
conn_idThe name of the new connectivity implementation
conn_apiA pointer to a conn_mgr_conn_api struct

Function Documentation

◆ conn_mgr_binding_get_flag()

static bool conn_mgr_binding_get_flag ( struct conn_mgr_conn_binding * binding,
enum conn_mgr_if_flag flag )
inlinestatic

#include <zephyr/net/conn_mgr_connectivity_impl.h>

Check the value of the specified connectivity flag for the provided binding.

Can be used from any thread or callback without calling conn_mgr_binding_lock.

For use only by connectivity implementations

Parameters
bindingThe binding to check
flagThe flag to check
Returns
bool The value of the specified flag

◆ conn_mgr_binding_lock()

static void conn_mgr_binding_lock ( struct conn_mgr_conn_binding * binding)
inlinestatic

#include <zephyr/net/conn_mgr_connectivity_impl.h>

Lock the passed-in binding, making it safe to access.

Call this whenever accessing binding data, unless inside a conn_mgr_conn_api callback, where it is called automatically by conn_mgr.

Reentrant.

For use only by connectivity implementations.

Parameters
binding- Binding to lock

◆ conn_mgr_binding_set_flag()

static void conn_mgr_binding_set_flag ( struct conn_mgr_conn_binding * binding,
enum conn_mgr_if_flag flag,
bool value )
inlinestatic

#include <zephyr/net/conn_mgr_connectivity_impl.h>

Set the value of the specified connectivity flag for the provided binding.

Can be used from any thread or callback without calling conn_mgr_binding_lock.

For use only by connectivity implementations

Parameters
bindingThe binding to check
flagThe flag to check
valueNew value for the specified flag

◆ conn_mgr_binding_unlock()

static void conn_mgr_binding_unlock ( struct conn_mgr_conn_binding * binding)
inlinestatic

#include <zephyr/net/conn_mgr_connectivity_impl.h>

Unlocks the passed-in binding.

Call this after any call to conn_mgr_binding_lock once done accessing binding data.

Reentrant.

For use only by connectivity implementations.

Parameters
binding- Binding to unlock

◆ conn_mgr_if_get_binding()

static struct conn_mgr_conn_binding * conn_mgr_if_get_binding ( struct net_if * iface)
inlinestatic

#include <zephyr/net/conn_mgr_connectivity_impl.h>

Retrieves the conn_mgr binding struct for a provided iface if it exists.

Bindings for connectivity implementations with missing API structs are ignored.

For use only by connectivity implementations.

Parameters
iface- bound network interface to obtain the binding struct for.
Returns
struct conn_mgr_conn_binding* Pointer to the retrieved binding struct if it exists, NULL otherwise.