Loading...
Searching...
No Matches
nimble_statconn.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2020 Freie Universität Berlin
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
7 */
8
9#pragma once
10
51
52#include <errno.h>
53#include <stdint.h>
54
55#include "nimble_netif.h"
56
57#ifdef __cplusplus
58extern "C" {
59#endif
60
64#ifndef NIMBLE_STATCONN_ADV_ITVL_MS
65#define NIMBLE_STATCONN_ADV_ITVL_MS (90U)
66#endif
67
71#ifndef NIMBLE_STATCONN_CONN_WIN_MS
72#define NIMBLE_STATCONN_CONN_WIN_MS (100U)
73#endif
74
78#ifndef NIMBLE_STATCONN_CONN_TIMEOUT_MS
79#define NIMBLE_STATCONN_CONN_TIMEOUT_MS (600U)
80#endif
81
89#ifndef NIMBLE_STATCONN_CONN_ITVL_MIN_MS
90#define NIMBLE_STATCONN_CONN_ITVL_MIN_MS (75U)
91#endif
92
97#ifndef NIMBLE_STATCONN_CONN_ITVL_MAX_MS
98#define NIMBLE_STATCONN_CONN_ITVL_MAX_MS (75U)
99#endif
100
104#ifndef NIMBLE_STATCONN_CONN_LATENCY
105#define NIMBLE_STATCONN_CONN_LATENCY (0)
106#endif
107
111#ifndef NIMBLE_STATCONN_CONN_SUPERTO_MS
112#define NIMBLE_STATCONN_CONN_SUPERTO_MS (2500U)
113#endif
114
119#ifndef NIMBLE_STATCONN_PHY_MODE
120#define NIMBLE_STATCONN_PHY_MODE NIMBLE_PHY_1M
121#endif
122
129
137
147
163int nimble_statconn_add_master(const uint8_t *addr,
164 const nimble_statconn_cfg_t *cfg);
165
178int nimble_statconn_add_slave(const uint8_t *addr,
179 const nimble_statconn_cfg_t *cfg);
180
189int nimble_statconn_rm(const uint8_t *addr);
190
191#ifdef __cplusplus
192}
193#endif
194
nimble_phy_t
BLE PHY modes.
Definition nimble_riot.h:73
void(* nimble_netif_eventcb_t)(int handle, nimble_netif_event_t event, const uint8_t *addr)
Event callback signature used for asynchronous event signaling.
int nimble_statconn_add_master(const uint8_t *addr, const nimble_statconn_cfg_t *cfg)
Connect to peer (master) with a given address as slave.
int nimble_statconn_add_slave(const uint8_t *addr, const nimble_statconn_cfg_t *cfg)
Connect to a peer (slave) with a given address as master.
int nimble_statconn_rm(const uint8_t *addr)
Remove the connection to the given peer.
void nimble_statconn_init(void)
Initialize the statconn module.
void nimble_statconn_eventcb(nimble_netif_eventcb_t cb)
Register a callback that is called on netif events.
GNRC netif implementation for NimBLE.
Statconn connection parameters.
nimble_phy_t phy_mode
BLE PHY mode used for the connection.