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 
9 #pragma once
10 
21 #include "nimble_autoadv.h"
22 #include "nimble_riot.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
32 #ifndef NIMBLE_AUTOADV_ADV_ITVL_MS
33 #define NIMBLE_AUTOADV_ADV_ITVL_MS (100U) /* 100ms */
34 #endif
35 #ifndef NIMBLE_AUTOADV_ADV_DURATION_MS
36 #define NIMBLE_AUTOADV_ADV_DURATION_MS (BLE_HS_FOREVER) /* forever */
37 #endif
38 #ifndef NIMBLE_AUTOADV_FLAGS
39 #define NIMBLE_AUTOADV_FLAGS (NIMBLE_AUTOADV_FLAG_LEGACY | \
40  NIMBLE_AUTOADV_FLAG_CONNECTABLE | \
41  NIMBLE_AUTOADV_FLAG_SCANNABLE)
42 #endif
43 #ifndef NIMBLE_AUTOADV_PHY
44 #define NIMBLE_AUTOADV_PHY NIMBLE_PHY_1M
45 #endif
46 #ifndef NIMBLE_AUTOADV_TX_POWER
47 #define NIMBLE_AUTOADV_TX_POWER 0 /* 0dBm */
48 #endif
49 #ifndef NIMBLE_AUTOADV_CHANNEL_MAP
50 #define NIMBLE_AUTOADV_CHANNEL_MAP 0
51 #endif
52 #ifndef NIMBLE_AUTOADV_OWN_ADDR_TYPE
53 #define NIMBLE_AUTOADV_OWN_ADDR_TYPE 0xFF /* sets to nimble_riot_own_addr */
54 #endif
55 #ifndef NIMBLE_AUTOADV_FILTER_POLICY
56 #define NIMBLE_AUTOADV_FILTER_POLICY 0
57 #endif
58 
59 #ifndef NIMBLE_AUTOADV_PARAMS
60 #define NIMBLE_AUTOADV_PARAMS \
61  { .adv_itvl_ms = NIMBLE_AUTOADV_ADV_ITVL_MS, \
62  .adv_duration_ms = NIMBLE_AUTOADV_ADV_DURATION_MS, \
63  .flags = NIMBLE_AUTOADV_FLAGS, \
64  .phy = NIMBLE_AUTOADV_PHY, \
65  .tx_power = NIMBLE_AUTOADV_TX_POWER, \
66  .channel_map = NIMBLE_AUTOADV_CHANNEL_MAP, \
67  .own_addr_type = NIMBLE_AUTOADV_OWN_ADDR_TYPE, \
68  .filter_policy = NIMBLE_AUTOADV_FILTER_POLICY }
69 #endif
76  NIMBLE_AUTOADV_PARAMS;
77 
78 #ifdef __cplusplus
79 }
80 #endif
81 
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)