Go to the documentation of this file.
22 #ifndef NIMBLE_NETIF_CONN_H
23 #define NIMBLE_NETIF_CONN_H
36 #define NIMBLE_NETIF_CONN_INVALID (-1)
42 struct ble_l2cap_chan *
coc;
60 int handle,
void *arg);
229 return (conn->
coc != NULL);
static int nimble_netif_conn_is_open(const nimble_netif_conn_t *conn)
Test if the given connection is (still) open.
static int nimble_netif_conn_is_adv(void)
Convenience function to check if any context is currently in the advertising state (NIMBLE_NETIF_ADV)
struct ble_l2cap_chan * coc
l2cap context as exposed by NimBLE
int nimble_netif_conn_get_by_gaphandle(uint16_t gaphandle)
Find the connection using the given NimBLE GAP handle.
int nimble_netif_conn_start_adv(void)
Reserve a unused context for the purpose of accepting a new connection.
static int nimble_netif_conn_connected(const uint8_t *addr)
Convenience function to check if we are currently connected to a peer with the given address.
unsigned nimble_netif_conn_count(uint16_t filter)
Count the number of connections contexts for which the given filter applies.
void nimble_netif_conn_free(int handle, uint8_t *addr)
Free the connection context with the given handle.
static int nimble_netif_conn_connecting(void)
Convenience function to check if any context is currently in the connecting state (NIMBLE_NETIF_CONNE...
static nimble_netif_conn_t * nimble_netif_conn_from_gaphandle(uint16_t gh)
Find the connection context with a given GAP handle and return a pointer to it.
GNRC netif implementation for NimBLE.
void nimble_netif_conn_init(void)
Initialize the connection state manager.
uint16_t state
the current state of the context
nimble_netif_conn_t * nimble_netif_conn_get(int handle)
Get the connection context corresponding to the given handle.
int(* nimble_netif_conn_iter_t)(nimble_netif_conn_t *conn, int handle, void *arg)
Iterator function signature used by nimble_netif_conn_foreach()
int nimble_netif_conn_get_next(int handle, uint16_t filter)
Find the next context that matches the filter condition.
int nimble_netif_conn_get_adv(void)
Get the handle to the context that is currently advertising.
uint16_t gaphandle
GAP handle exposed by NimBLE.
#define NIMBLE_NETIF_CONN_INVALID
Value for marking a handle invalid.
int nimble_netif_conn_get_connecting(void)
Get the handle to the context that is busy connecting.
int nimble_netif_conn_get_by_addr(const uint8_t *addr)
Find the connection to the peer with the given BLE address.
#define BLE_ADDR_LEN
link layer address length
int nimble_netif_conn_start_connection(const uint8_t *addr)
Allocate an unused context for starting a connection.
void nimble_netif_conn_foreach(uint16_t filter, nimble_netif_conn_iter_t cb, void *arg)
Iterate over all connection contexts that match the filter condition.
Memory layout for holding the relevant connection information.