Go to the documentation of this file.
66 #ifndef NIMBLE_NETIF_H
67 #define NIMBLE_NETIF_H
73 #include "host/ble_hs.h"
84 #ifndef NIMBLE_NETIF_MAX_CONN
85 #define NIMBLE_NETIF_MAX_CONN (MYNEWT_VAL_BLE_MAX_CONNECTIONS)
91 #ifndef NIMBLE_NETIF_CID
92 #define NIMBLE_NETIF_CID (BLE_L2CAP_CID_IPSP)
101 #ifndef NIMBLE_NETIF_MTU
102 #define NIMBLE_NETIF_MTU (1280U)
162 const uint8_t *addr);
195 const struct ble_gap_conn_params *conn_params,
221 const struct ble_gap_adv_params *adv_params);
242 const struct ble_gap_upd_params *conn_params);
@ NIMBLE_NETIF_ACCEPTING
accepting incoming connections
void nimble_netif_eventcb(nimble_netif_eventcb_t cb)
Register a global event callback, servicing all NimBLE connections.
int nimble_netif_accept_stop(void)
Stop accepting incoming connections (stop advertising) *.
int nimble_netif_close(int handle)
Close the connection with the given handle.
@ NIMBLE_NETIF_ABORT_SLAVE
connection est.
@ NIMBLE_NETIF_NOTFOUND
no fitting entry found
@ NIMBLE_NETIF_NOTCONN
not connected
@ NIMBLE_NETIF_ABORT_MASTER
connection est.
@ NIMBLE_NETIF_OK
everything went fine
@ NIMBLE_NETIF_CLOSED_SLAVE
connection closed (we were slave)
int nimble_netif_update(int handle, const struct ble_gap_upd_params *conn_params)
Update the connection parameters for the given connection.
@ NIMBLE_NETIF_ANY
match any state
@ NIMBLE_NETIF_INIT_MASTER
conn.
nimble_netif_event_t
Event types triggered by the NimBLE netif module.
General BLE values as defined by the BT standard.
@ NIMBLE_NETIF_ADV
currently advertising
@ NIMBLE_NETIF_BUSY
network device is busy
@ NIMBLE_NETIF_L2CAP_SERVER
L2CAP server.
@ NIMBLE_NETIF_CONNECTED_MASTER
connection established as master
@ NIMBLE_NETIF_ACCEPT_STOP
stop accepting incoming connections
@ NIMBLE_NETIF_UNUSED
context unused
@ NIMBLE_NETIF_INIT_SLAVE
conn.
void(* nimble_netif_eventcb_t)(int handle, nimble_netif_event_t event, const uint8_t *addr)
Event callback signature used for asynchronous event signaling.
@ NIMBLE_NETIF_GAP_CONNECTED
GAP is connected.
@ NIMBLE_NETIF_NOTADV
not advertising
@ NIMBLE_NETIF_L2CAP_CONNECTED
L2CAP is connected.
@ NIMBLE_NETIF_DEVERR
internal BLE stack error
@ NIMBLE_NETIF_CLOSED_MASTER
connection closed (we were master)
@ NIMBLE_NETIF_GAP_SLAVE
GAP slave.
@ NIMBLE_NETIF_CONNECTING
connection in progress
@ NIMBLE_NETIF_GAP_MASTER
GAP master.
int nimble_netif_accept(const uint8_t *ad, size_t ad_len, const struct ble_gap_adv_params *adv_params)
Accept incoming connections by starting to advertise this node.
@ NIMBLE_NETIF_L2CAP_CLIENT
L2CAP client.
@ NIMBLE_NETIF_CONN_UPDATED
connection parameter update done
int nimble_netif_connect(const ble_addr_t *addr, const struct ble_gap_conn_params *conn_params, uint32_t timeout)
Open a BLE connection as BLE master.
@ NIMBLE_NETIF_NOMEM
insufficient memory
@ NIMBLE_NETIF_CONNECTED_SLAVE
connection established as slave
void nimble_netif_init(void)
Initialize the netif implementation, spawns the netif thread.