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 
50 #ifndef NIMBLE_STATCONN_H
51 #define NIMBLE_STATCONN_H
52 
53 #include <stdint.h>
54 
55 #include "nimble_netif.h"
56 
57 #ifdef __cplusplus
58 extern "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 
85 #ifndef NIMBLE_STATCONN_CONN_ITVL_MS
86 #define NIMBLE_STATCONN_CONN_ITVL_MS (75U)
87 #endif
88 
92 #ifndef NIMBLE_STATCONN_CONN_LATENCY
93 #define NIMBLE_STATCONN_CONN_LATENCY (0)
94 #endif
95 
99 #ifndef NIMBLE_STATCONN_CONN_SUPERTO_MS
100 #define NIMBLE_STATCONN_CONN_SUPERTO_MS (2500U)
101 #endif
102 
106 enum {
111 };
112 
119 void nimble_statconn_init(void);
120 
130 
143 int nimble_statconn_add_master(const uint8_t *addr);
144 
154 int nimble_statconn_add_slave(const uint8_t *addr);
155 
164 int nimble_statconn_rm(const uint8_t *addr);
165 
166 #ifdef __cplusplus
167 }
168 #endif
169 
170 #endif /* NIMBLE_STATCONN_H */
171 
NIMBLE_STATCONN_INUSE
@ NIMBLE_STATCONN_INUSE
given peer is already managed
Definition: nimble_statconn.h:110
nimble_netif.h
GNRC netif implementation for NimBLE.
nimble_statconn_add_slave
int nimble_statconn_add_slave(const uint8_t *addr)
Connect to a peer (slave) with a given address as master.
nimble_netif_eventcb_t
void(* nimble_netif_eventcb_t)(int handle, nimble_netif_event_t event, const uint8_t *addr)
Event callback signature used for asynchronous event signaling.
Definition: nimble_netif.h:160
NIMBLE_STATCONN_NOSLOT
@ NIMBLE_STATCONN_NOSLOT
no more connection slot available
Definition: nimble_statconn.h:108
nimble_statconn_eventcb
void nimble_statconn_eventcb(nimble_netif_eventcb_t cb)
Register a callback that is called on netif events.
nimble_statconn_rm
int nimble_statconn_rm(const uint8_t *addr)
Remove the connection to the given peer.
nimble_statconn_add_master
int nimble_statconn_add_master(const uint8_t *addr)
Connect to peer (master) with a given address as slave.
NIMBLE_STATCONN_OK
@ NIMBLE_STATCONN_OK
all groovy
Definition: nimble_statconn.h:107
NIMBLE_STATCONN_NOTCONN
@ NIMBLE_STATCONN_NOTCONN
given address is not managed
Definition: nimble_statconn.h:109
nimble_statconn_init
void nimble_statconn_init(void)
Initialize the statconn module.