nimble_autoadv_params.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2022 Inria
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 
19 #ifndef NIMBLE_AUTOADV_PARAMS_H
20 #define NIMBLE_AUTOADV_PARAMS_H
21 
22 #include "nimble_autoadv.h"
23 #include "nimble_riot.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
33 #ifndef NIMBLE_AUTOADV_ADV_ITVL_MS
34 #define NIMBLE_AUTOADV_ADV_ITVL_MS (100U) /* 100ms */
35 #endif
36 #ifndef NIMBLE_AUTOADV_ADV_DURATION_MS
37 #define NIMBLE_AUTOADV_ADV_DURATION_MS (BLE_HS_FOREVER) /* forever */
38 #endif
39 #ifndef NIMBLE_AUTOADV_FLAGS
40 #define NIMBLE_AUTOADV_FLAGS (NIMBLE_AUTOADV_FLAG_LEGACY | \
41  NIMBLE_AUTOADV_FLAG_CONNECTABLE | \
42  NIMBLE_AUTOADV_FLAG_SCANNABLE)
43 #endif
44 #ifndef NIMBLE_AUTOADV_PHY
45 #define NIMBLE_AUTOADV_PHY NIMBLE_PHY_1M
46 #endif
47 #ifndef NIMBLE_AUTOADV_TX_POWER
48 #define NIMBLE_AUTOADV_TX_POWER 0 /* 0dBm */
49 #endif
50 #ifndef NIMBLE_AUTOADV_CHANNEL_MAP
51 #define NIMBLE_AUTOADV_CHANNEL_MAP 0
52 #endif
53 #ifndef NIMBLE_AUTOADV_OWN_ADDR_TYPE
54 #define NIMBLE_AUTOADV_OWN_ADDR_TYPE 0xFF /* sets to nimble_riot_own_addr */
55 #endif
56 #ifndef NIMBLE_AUTOADV_FILTER_POLICY
57 #define NIMBLE_AUTOADV_FILTER_POLICY 0
58 #endif
59 
60 #ifndef NIMBLE_AUTOADV_PARAMS
61 #define NIMBLE_AUTOADV_PARAMS \
62  { .adv_itvl_ms = NIMBLE_AUTOADV_ADV_ITVL_MS, \
63  .adv_duration_ms = NIMBLE_AUTOADV_ADV_DURATION_MS, \
64  .flags = NIMBLE_AUTOADV_FLAGS, \
65  .phy = NIMBLE_AUTOADV_PHY, \
66  .tx_power = NIMBLE_AUTOADV_TX_POWER, \
67  .channel_map = NIMBLE_AUTOADV_CHANNEL_MAP, \
68  .own_addr_type = NIMBLE_AUTOADV_OWN_ADDR_TYPE, \
69  .filter_policy = NIMBLE_AUTOADV_FILTER_POLICY }
70 #endif
77  NIMBLE_AUTOADV_PARAMS;
78 
79 #ifdef __cplusplus
80 }
81 #endif
82 
83 #endif /* NIMBLE_AUTOADV_PARAMS_H */
static const nimble_autoadv_cfg_t nimble_autoadv_cfg
nimble_autoadv configuration
RIOT specific glue functions for integrating NimBLE.
Parameter set used to configure accepting connections (advertising)