GNRC netif implementation for NimBLE. More...

Detailed Description

GNRC netif implementation for NimBLE.

Author
Hauke Petersen hauke.nosp@m..pet.nosp@m.ersen.nosp@m.@fu-.nosp@m.berli.nosp@m.n.de

Definition in file nimble_netif.h.

#include <stdint.h>
#include "net/ble.h"
#include "host/ble_hs.h"
+ Include dependency graph for nimble_netif.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define NIMBLE_NETIF_MAX_CONN   (MYNEWT_VAL_BLE_MAX_CONNECTIONS)
 The maximum number of BLE connections that can be open concurrently. More...
 
#define NIMBLE_NETIF_CID   (BLE_L2CAP_CID_IPSP)
 Default L2CAP channel ID to use.
 
#define NIMBLE_NETIF_MTU   (1280U)
 Default MTU size supported by the NimBLE netif wrapper.
 

Typedefs

typedef void(* nimble_netif_eventcb_t) (int handle, nimble_netif_event_t event, const uint8_t *addr)
 Event callback signature used for asynchronous event signaling. More...
 

Enumerations

enum  {
  NIMBLE_NETIF_OK = 0, NIMBLE_NETIF_NOTCONN = -1, NIMBLE_NETIF_DEVERR = -2, NIMBLE_NETIF_BUSY = -3,
  NIMBLE_NETIF_NOMEM = -4, NIMBLE_NETIF_NOTADV = -5, NIMBLE_NETIF_NOTFOUND = -6
}
 Return codes used by the NimBLE netif module. More...
 
enum  nimble_netif_event_t {
  NIMBLE_NETIF_ACCEPTING, NIMBLE_NETIF_ACCEPT_STOP, NIMBLE_NETIF_INIT_MASTER, NIMBLE_NETIF_INIT_SLAVE,
  NIMBLE_NETIF_CONNECTED_MASTER, NIMBLE_NETIF_CONNECTED_SLAVE, NIMBLE_NETIF_CLOSED_MASTER, NIMBLE_NETIF_CLOSED_SLAVE,
  NIMBLE_NETIF_ABORT_MASTER, NIMBLE_NETIF_ABORT_SLAVE, NIMBLE_NETIF_CONN_UPDATED
}
 Event types triggered by the NimBLE netif module. More...
 
enum  {
  NIMBLE_NETIF_L2CAP_CLIENT = 0x0001, NIMBLE_NETIF_L2CAP_SERVER = 0x0002, NIMBLE_NETIF_L2CAP_CONNECTED = 0x0003, NIMBLE_NETIF_GAP_MASTER = 0x0010,
  NIMBLE_NETIF_GAP_SLAVE = 0x0020, NIMBLE_NETIF_GAP_CONNECTED = 0x0030, NIMBLE_NETIF_ADV = 0x0100, NIMBLE_NETIF_CONNECTING = 0x4000,
  NIMBLE_NETIF_UNUSED = 0x8000, NIMBLE_NETIF_ANY = 0xffff
}
 Flags describing the state of a single connection context. More...
 

Functions

void nimble_netif_init (void)
 Initialize the netif implementation, spawns the netif thread. More...
 
void nimble_netif_eventcb (nimble_netif_eventcb_t cb)
 Register a global event callback, servicing all NimBLE connections. More...
 
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. More...
 
int nimble_netif_close (int handle)
 Close the connection with the given handle. More...
 
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. More...
 
int nimble_netif_accept_stop (void)
 Stop accepting incoming connections (stop advertising) *. More...
 
int nimble_netif_update (int handle, const struct ble_gap_upd_params *conn_params)
 Update the connection parameters for the given connection. More...