Loading...
Searching...
No Matches

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 <errno.h>
#include "net/ble.h"
#include "nimble_riot.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.

Data Structures

struct  nimble_netif_accept_cfg_t
 Parameter set used to configure accepting connections (advertising) More...
 
struct  nimble_netif_connect_cfg_t
 Parameter set used to configure connection initiation. More...
 

Macros

#define NIMBLE_NETIF_MAX_CONN   (MYNEWT_VAL_BLE_MAX_CONNECTIONS)
 The maximum number of BLE connections that can be open concurrently.
 
#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.
 
#define NIMBLE_NETIF_CONN_ITVL_SPACING   0
 Set to > 0 to enforce different connection intervals for each of the nodes BLE connections.
 

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.
 

Enumerations

enum  { NIMBLE_NETIF_FLAG_LEGACY = 0x01 , NIMBLE_NETIF_FLAG_HD_MODE = 0x02 }
 Flags for enabling legacy advertisement and high-duty cycle mode when accepting incoming connections. 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.
 
void nimble_netif_eventcb (nimble_netif_eventcb_t cb)
 Register a global event callback, servicing all NimBLE connections.
 
int nimble_netif_connect (const ble_addr_t *addr, const nimble_netif_connect_cfg_t *cfg)
 Open a BLE connection as BLE master.
 
int nimble_netif_close (int handle)
 Close the connection with the given handle.
 
int nimble_netif_accept (const uint8_t *ad, size_t ad_len, const nimble_netif_accept_cfg_t *cfg)
 Accept incoming connections by starting to advertise this node.
 
int nimble_netif_accept_direct (const ble_addr_t *addr, const nimble_netif_accept_cfg_t *cfg)
 Wait for an incoming connection from a specific peer, sending directed advertisements.
 
int nimble_netif_accept_stop (void)
 Stop accepting incoming connections (stop advertising) *.
 
int nimble_netif_update (int handle, const struct ble_gap_upd_params *conn_params)
 Update the connection parameters for the given connection.
 
int nimble_netif_used_chanmap (int handle, uint8_t map[5])
 Get the currently used channel map for the given connection as bitmap.