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 
9 #pragma once
10 
111 #include <stdint.h>
112 
113 #include "nimble_netif.h"
114 
115 #ifdef __cplusplus
116 extern "C" {
117 #endif
118 
122 enum {
126 };
127 
131 typedef struct {
133  uint32_t period_scan_ms;
135  uint32_t period_adv_ms;
140  uint32_t adv_itvl_ms;
142  uint32_t scan_itvl_ms;
144  uint32_t scan_win_ms;
146  uint32_t conn_timeout_ms;
153  uint16_t conn_latency;
159  const char *node_id;
161 
177  const uint8_t *ad, size_t adlen);
178 
188 
200  const uint8_t *ad, size_t adlen);
201 
206 
214 
215 #ifdef __cplusplus
216 }
217 #endif
218 
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: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.
Definition: nimble_netif.h:214
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]