nimble_autoconn.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 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 
109 #ifndef NIMBLE_AUTOCONN_H
110 #define NIMBLE_AUTOCONN_H
111 
112 #include <stdint.h>
113 
114 #include "nimble_netif.h"
115 
116 #ifdef __cplusplus
117 extern "C" {
118 #endif
119 
123 enum {
127 };
128 
132 typedef struct {
134  uint32_t period_scan_ms;
136  uint32_t period_adv_ms;
141  uint32_t adv_itvl_ms;
143  uint32_t scan_itvl_ms;
145  uint32_t scan_win_ms;
147  uint32_t conn_timeout_ms;
154  uint16_t conn_latency;
160  const char *node_id;
162 
178  const uint8_t *ad, size_t adlen);
179 
189 
201  const uint8_t *ad, size_t adlen);
202 
207 
215 
216 #ifdef __cplusplus
217 }
218 #endif
219 
220 #endif /* NIMBLE_AUTOCONN_H */
void nimble_autoconn_disable(void)
Disable the automated connection management.
void nimble_autoconn_eventcb(nimble_netif_eventcb_t cb)
Register a callback that is called on netif events.
int nimble_autoconn_init(const nimble_autoconn_params_t *params, const uint8_t *ad, size_t adlen)
Initialize and enable the autoconn module.
void nimble_autoconn_enable(void)
Enable automated creation of new BLE connections.
int nimble_autoconn_update(const nimble_autoconn_params_t *params, const uint8_t *ad, size_t adlen)
Update the used parameters (timing and node ID)
@ NIMBLE_AUTOCONN_ADERR
error generating advertising data
@ NIMBLE_AUTOCONN_PARAMERR
invalid parameters given
@ NIMBLE_AUTOCONN_OK
like a walk in the park
nimble_phy_t
BLE PHY modes.
Definition: nimble_riot.h:75
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:215
GNRC netif implementation for NimBLE.
Set of configuration parameters needed to run autoconn.
uint32_t period_jitter_ms
a random value from 0 to this value is added to the duration of each scanning and advertising period ...
uint32_t scan_itvl_ms
scan interval applied while in scanning state [in ms]
uint32_t conn_timeout_ms
opening a new connection is aborted after this time [in ms]
uint32_t scan_win_ms
scan window applied while in scanning state [in ms]
uint32_t period_adv_ms
amount of time spend in advertising mode [in ms]
const char * node_id
node ID included in the advertising data, may be NULL
uint32_t period_scan_ms
amount of time spend in scanning mode [in ms]
uint32_t conn_itvl_min_ms
connection interval used when opening a new connection, lower bound.
uint32_t conn_itvl_max_ms
connection interval, upper bound [in ms]
uint32_t adv_itvl_ms
advertising interval used when in advertising mode [in ms]
nimble_phy_t phy_mode
BLE PHY mode to use.
uint16_t conn_latency
slave latency used for new connections
uint32_t conn_super_to_ms
supervision timeout used for new connections [in ms]