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;
136  uint32_t period_adv;
139  uint32_t period_jitter;
141  uint32_t adv_itvl;
143  uint32_t scan_itvl;
145  uint32_t scan_win;
147  uint32_t conn_timeout;
149  uint32_t conn_itvl;
151  uint16_t conn_latency;
153  uint32_t conn_super_to;
155  const char *node_id;
157 
173  const uint8_t *ad, size_t adlen);
174 
184 
196  const uint8_t *ad, size_t adlen);
197 
201 void nimble_autoconn_enable(void);
202 
209 void nimble_autoconn_disable(void);
210 
211 #ifdef __cplusplus
212 }
213 #endif
214 
215 #endif /* NIMBLE_AUTOCONN_H */
216 
nimble_autoconn_params_t::conn_timeout
uint32_t conn_timeout
opening a new connection is aborted after this time [in ms]
Definition: nimble_autoconn.h:147
nimble_autoconn_params_t::conn_super_to
uint32_t conn_super_to
supervision timeout used for new connections [in ms]
Definition: nimble_autoconn.h:153
nimble_autoconn_params_t::period_jitter
uint32_t period_jitter
a random value from 0 to this value is added to the duration of each scanning and advertising period ...
Definition: nimble_autoconn.h:139
nimble_autoconn_update
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_netif.h
GNRC netif implementation for NimBLE.
nimble_autoconn_params_t::period_adv
uint32_t period_adv
amount of time spend in advertising mode [in ms]
Definition: nimble_autoconn.h:136
NIMBLE_AUTOCONN_PARAMERR
@ NIMBLE_AUTOCONN_PARAMERR
invalid parameters given
Definition: nimble_autoconn.h:125
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_autoconn_enable
void nimble_autoconn_enable(void)
Enable automated creation of new BLE connections.
nimble_autoconn_params_t::scan_win
uint32_t scan_win
scan window applied while in scanning state [in ms]
Definition: nimble_autoconn.h:145
nimble_autoconn_params_t::node_id
const char * node_id
node ID included in the advertising data, may be NULL
Definition: nimble_autoconn.h:155
NIMBLE_AUTOCONN_ADERR
@ NIMBLE_AUTOCONN_ADERR
error generating advertising data
Definition: nimble_autoconn.h:126
nimble_autoconn_params_t::adv_itvl
uint32_t adv_itvl
advertising interval used when in advertising mode [in ms]
Definition: nimble_autoconn.h:141
nimble_autoconn_params_t::conn_itvl
uint32_t conn_itvl
connection interval used when opening a new connection [in ms]
Definition: nimble_autoconn.h:149
nimble_autoconn_params_t::period_scan
uint32_t period_scan
amount of time spend in scanning mode [in ms]
Definition: nimble_autoconn.h:134
nimble_autoconn_eventcb
void nimble_autoconn_eventcb(nimble_netif_eventcb_t cb)
Register a callback that is called on netif events.
nimble_autoconn_params_t
Set of configuration parameters needed to run autoconn.
Definition: nimble_autoconn.h:132
nimble_autoconn_params_t::conn_latency
uint16_t conn_latency
slave latency used for new connections [in ms]
Definition: nimble_autoconn.h:151
nimble_autoconn_disable
void nimble_autoconn_disable(void)
Disable the automated connection management.
nimble_autoconn_init
int nimble_autoconn_init(const nimble_autoconn_params_t *params, const uint8_t *ad, size_t adlen)
Initialize and enable the autoconn module.
NIMBLE_AUTOCONN_OK
@ NIMBLE_AUTOCONN_OK
like a walk in the park
Definition: nimble_autoconn.h:124
nimble_autoconn_params_t::scan_itvl
uint32_t scan_itvl
scan interval applied while in scanning state [in ms]
Definition: nimble_autoconn.h:143