1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
|
/***************************************************************************//**
* File Name: cycfg_bt_settings.c
*
* Description:
* Runtime Bluetooth stack configuration parameters.
* This file should not be modified. It was automatically generated by
* Bluetooth Configurator 2.60.0.1460
*
********************************************************************************
* Copyright 2023 Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation.
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
#include "cycfg_bt_settings.h"
#include "cycfg_gap.h"
#include "wiced_bt_dev.h"
#include "wiced_bt_gatt.h"
#include "wiced_bt_cfg.h"
#if !defined (WICED_BTSTACK_VERSION_MAJOR)
#define WICED_BTSTACK_VERSION_MAJOR (2)
#endif
/*****************************************************************************
* wiced_bt core stack configuration
****************************************************************************/
#if (WICED_BTSTACK_VERSION_MAJOR >= 3)
/* LE scan settings */
const wiced_bt_cfg_ble_scan_settings_t cy_bt_cfg_scan_settings =
{
.scan_mode = CY_BT_SCAN_MODE, /* LE scan mode (BTM_BLE_SCAN_MODE_PASSIVE, BTM_BLE_SCAN_MODE_ACTIVE, or BTM_BLE_SCAN_MODE_NONE) */
/* Advertisement scan configuration */
.high_duty_scan_interval = CY_BT_HIGH_DUTY_SCAN_INTERVAL, /* High duty scan interval (in slots (1 slot = 0.625 ms)) */
.high_duty_scan_window = CY_BT_HIGH_DUTY_SCAN_WINDOW, /* High duty scan window (in slots (1 slot = 0.625 ms)) */
.high_duty_scan_duration = CY_BT_HIGH_DUTY_SCAN_DURATION, /* High duty scan duration in seconds (0 for infinite) */
.low_duty_scan_interval = CY_BT_LOW_DUTY_SCAN_INTERVAL, /* Low duty scan interval (in slots (1 slot = 0.625 ms)) */
.low_duty_scan_window = CY_BT_LOW_DUTY_SCAN_WINDOW, /* Low duty scan window (in slots (1 slot = 0.625 ms)) */
.low_duty_scan_duration = CY_BT_LOW_DUTY_SCAN_DURATION, /* Low duty scan duration in seconds (0 for infinite) */
/* Connection scan configuration */
.high_duty_conn_scan_interval = CY_BT_HIGH_DUTY_CONN_SCAN_INTERVAL, /* High duty cycle connection scan interval (in slots (1 slot = 0.625 ms)) */
.high_duty_conn_scan_window = CY_BT_HIGH_DUTY_CONN_SCAN_WINDOW, /* High duty cycle connection scan window (in slots (1 slot = 0.625 ms)) */
.high_duty_conn_duration = CY_BT_HIGH_DUTY_CONN_SCAN_DURATION, /* High duty cycle connection duration in seconds (0 for infinite) */
.low_duty_conn_scan_interval = CY_BT_LOW_DUTY_CONN_SCAN_INTERVAL, /* Low duty cycle connection scan interval (in slots (1 slot = 0.625 ms)) */
.low_duty_conn_scan_window = CY_BT_LOW_DUTY_CONN_SCAN_WINDOW, /* Low duty cycle connection scan window (in slots (1 slot = 0.625 ms)) */
.low_duty_conn_duration = CY_BT_LOW_DUTY_CONN_SCAN_DURATION, /* Low duty cycle connection duration in seconds (0 for infinite) */
/* Connection configuration */
.conn_min_interval = CY_BT_CONN_MIN_INTERVAL, /* Minimum connection interval (in slots (1 slot = 1.25 ms)) */
.conn_max_interval = CY_BT_CONN_MAX_INTERVAL, /* Maximum connection interval (in slots (1 slot = 1.25 ms)) */
.conn_latency = CY_BT_CONN_LATENCY, /* Connection latency */
.conn_supervision_timeout = CY_BT_CONN_SUPERVISION_TIMEOUT, /* Connection link supervision timeout (in 10 ms) */
};
/* LE advertisement settings */
const wiced_bt_cfg_ble_advert_settings_t cy_bt_cfg_adv_settings =
{
.channel_map = CY_BT_CHANNEL_MAP, /* Advertising channel map (mask of BTM_BLE_ADVERT_CHNL_37, BTM_BLE_ADVERT_CHNL_38, BTM_BLE_ADVERT_CHNL_39) */
.high_duty_min_interval = CY_BT_HIGH_DUTY_ADV_MIN_INTERVAL, /* High duty undirected connectable minimum advertising interval (in slots (1 slot = 0.625 ms)) */
.high_duty_max_interval = CY_BT_HIGH_DUTY_ADV_MAX_INTERVAL, /* High duty undirected connectable maximum advertising interval (in slots (1 slot = 0.625 ms)) */
.high_duty_duration = CY_BT_HIGH_DUTY_ADV_DURATION, /* High duty undirected connectable advertising duration in seconds (0 for infinite) */
.low_duty_min_interval = CY_BT_LOW_DUTY_ADV_MIN_INTERVAL, /* Low duty undirected connectable minimum advertising interval (in slots (1 slot = 0.625 ms)) */
.low_duty_max_interval = CY_BT_LOW_DUTY_ADV_MAX_INTERVAL, /* Low duty undirected connectable maximum advertising interval (in slots (1 slot = 0.625 ms)) */
.low_duty_duration = CY_BT_LOW_DUTY_ADV_DURATION, /* Low duty undirected connectable advertising duration in seconds (0 for infinite) */
.high_duty_directed_min_interval = CY_BT_HIGH_DUTY_DIRECTED_ADV_MIN_INTERVAL, /* High duty directed connectable minimum advertising interval (in slots (1 slot = 0.625 ms)) */
.high_duty_directed_max_interval = CY_BT_HIGH_DUTY_DIRECTED_ADV_MAX_INTERVAL, /* High duty directed connectable maximum advertising interval (in slots (1 slot = 0.625 ms)) */
.low_duty_directed_min_interval = CY_BT_LOW_DUTY_DIRECTED_ADV_MIN_INTERVAL, /* Low duty directed connectable minimum advertising interval (in slots (1 slot = 0.625 ms)) */
.low_duty_directed_max_interval = CY_BT_LOW_DUTY_DIRECTED_ADV_MAX_INTERVAL, /* Low duty directed connectable maximum advertising interval (in slots (1 slot = 0.625 ms)) */
.low_duty_directed_duration = CY_BT_LOW_DUTY_DIRECTED_ADV_DURATION, /* Low duty directed connectable advertising duration in seconds (0 for infinite) */
.high_duty_nonconn_min_interval = CY_BT_HIGH_DUTY_NONCONN_ADV_MIN_INTERVAL, /* High duty non-connectable minimum advertising interval (in slots (1 slot = 0.625 ms)) */
.high_duty_nonconn_max_interval = CY_BT_HIGH_DUTY_NONCONN_ADV_MAX_INTERVAL, /* High duty non-connectable maximum advertising interval (in slots (1 slot = 0.625 ms)) */
.high_duty_nonconn_duration = CY_BT_HIGH_DUTY_NONCONN_ADV_DURATION, /* High duty non-connectable advertising duration in seconds (0 for infinite) */
.low_duty_nonconn_min_interval = CY_BT_LOW_DUTY_NONCONN_ADV_MIN_INTERVAL, /* Low duty non-connectable minimum advertising interval (in slots (1 slot = 0.625 ms)) */
.low_duty_nonconn_max_interval = CY_BT_LOW_DUTY_NONCONN_ADV_MAX_INTERVAL, /* Low duty non-connectable maximum advertising interval (in slots (1 slot = 0.625 ms)) */
.low_duty_nonconn_duration = CY_BT_LOW_DUTY_NONCONN_ADV_DURATION /* Low duty non-connectable advertising duration in seconds (0 for infinite) */
};
/* LE configuration settings */
const wiced_bt_cfg_ble_t cy_bt_cfg_ble =
{
.ble_max_simultaneous_links = (CY_BT_CLIENT_MAX_LINKS + CY_BT_SERVER_MAX_LINKS), /* Max number for simultaneous connections for a layer, profile, protocol */
.ble_max_rx_pdu_size = CY_BT_RX_PDU_SIZE, /* Maximum size allowed for any received L2CAP PDU
* Minimum value - 65 (to support SM)
* Maximum GATT MTU over legacy bearers shall be set to <= this value
* Maximum MPS for EATT channels shall be set to <= this value */
.appearance = CY_BT_APPEARANCE, /* GATT appearance (see gatt_appearance_e) */
.rpa_refresh_timeout = CY_BT_RPA_TIMEOUT, /* Interval of random address refreshing - secs */
.host_addr_resolution_db_size = 5, /* LE Address Resolution DB settings - effective only for pre 4.2 controller */
.p_ble_scan_cfg = &cy_bt_cfg_scan_settings, /* LE scan settings */
.p_ble_advert_cfg = &cy_bt_cfg_adv_settings, /* LE advertisement settings */
.default_ble_power_level = CY_BT_TX_POWER, /* Default LE power level, Refer lm_TxPwrTable table for the power range */
};
/* GATT settings */
const wiced_bt_cfg_gatt_t cy_bt_cfg_gatt =
{
.max_db_service_modules = 0, /* Maximum number of service modules in the DB */
.max_eatt_bearers = 0, /* Maximum number of allowed gatt bearers */
};
/* Application-managed L2CAP protocol configuration */
const wiced_bt_cfg_l2cap_application_t cy_bt_cfg_l2cap =
{
.max_app_l2cap_psms = CY_BT_L2CAP_MAX_LE_PSM, /* Maximum number of application-managed PSMs */
.max_app_l2cap_channels = CY_BT_L2CAP_MAX_LE_CHANNELS, /* Maximum number of application-managed channels */
.max_app_l2cap_le_fixed_channels = CY_BT_L2CAP_MAX_LE_FIXED_CHANNELS, /* Maximum number of application-managed fixed channels supported */
.max_app_l2cap_br_edr_ertm_chnls = CY_BT_L2CAP_MAX_BR_ERTM_CHANNELS, /* Maximum application ERTM channels, BR/EDR only */
.max_app_l2cap_br_edr_ertm_tx_win = CY_BT_L2CAP_MAX_BR_ERTM_TX_WIN, /* Maximum application ERTM TX Window, BR/EDR only */
};
/* Bluetooth stack configuration */
const wiced_bt_cfg_settings_t wiced_bt_cfg_settings =
{
.device_name = (uint8_t*)app_gap_device_name, /* Local device name (NULL terminated) */
.security_required = CY_BT_SECURITY_LEVEL, /* BTM_SEC_BEST_EFFORT is recommended choice for most applications,
* to connect to the widest range of devices. Allows stack to choose
* the highest level of security possible between the two devices */
.p_ble_cfg = &cy_bt_cfg_ble, /* LE related configuration */
.p_gatt_cfg = &cy_bt_cfg_gatt, /* GATT settings */
.p_l2cap_app_cfg = &cy_bt_cfg_l2cap, /* Application-managed L2CAP protocol configuration */
};
#else
/* Bluetooth stack configuration */
const wiced_bt_cfg_settings_t wiced_bt_cfg_settings =
{
.device_name = (uint8_t*)app_gap_device_name, /* Local device name (NULL terminated) */
.device_class = {0x00, 0x00, 0x00}, /* Local device class */
.security_requirement_mask = BTM_SEC_NONE, /* Security requirements mask (BTM_SEC_NONE, or combination of BTM_SEC_IN_AUTHENTICATE, BTM_SEC_OUT_AUTHENTICATE, BTM_SEC_ENCRYPT (see #wiced_bt_sec_level_e)) */
.max_simultaneous_links = (CY_BT_CLIENT_MAX_LINKS + CY_BT_SERVER_MAX_LINKS), /* Maximum number simultaneous links to different devices */
/* LE scan settings */
.ble_scan_cfg =
{
.scan_mode = CY_BT_SCAN_MODE, /* LE scan mode (BTM_BLE_SCAN_MODE_PASSIVE, BTM_BLE_SCAN_MODE_ACTIVE, or BTM_BLE_SCAN_MODE_NONE) */
/* Advertisement scan configuration */
.high_duty_scan_interval = CY_BT_HIGH_DUTY_SCAN_INTERVAL, /* High duty scan interval (in slots (1 slot = 0.625 ms)) */
.high_duty_scan_window = CY_BT_HIGH_DUTY_SCAN_WINDOW, /* High duty scan window (in slots (1 slot = 0.625 ms)) */
.high_duty_scan_duration = CY_BT_HIGH_DUTY_SCAN_DURATION, /* High duty scan duration in seconds (0 for infinite) */
.low_duty_scan_interval = CY_BT_LOW_DUTY_SCAN_INTERVAL, /* Low duty scan interval (in slots (1 slot = 0.625 ms)) */
.low_duty_scan_window = CY_BT_LOW_DUTY_SCAN_WINDOW, /* Low duty scan window (in slots (1 slot = 0.625 ms)) */
.low_duty_scan_duration = CY_BT_LOW_DUTY_SCAN_DURATION, /* Low duty scan duration in seconds (0 for infinite) */
/* Connection scan configuration */
.high_duty_conn_scan_interval = CY_BT_HIGH_DUTY_CONN_SCAN_INTERVAL, /* High duty cycle connection scan interval (in slots (1 slot = 0.625 ms)) */
.high_duty_conn_scan_window = CY_BT_HIGH_DUTY_CONN_SCAN_WINDOW, /* High duty cycle connection scan window (in slots (1 slot = 0.625 ms)) */
.high_duty_conn_duration = CY_BT_HIGH_DUTY_CONN_SCAN_DURATION, /* High duty cycle connection duration in seconds (0 for infinite) */
.low_duty_conn_scan_interval = CY_BT_LOW_DUTY_CONN_SCAN_INTERVAL, /* Low duty cycle connection scan interval (in slots (1 slot = 0.625 ms)) */
.low_duty_conn_scan_window = CY_BT_LOW_DUTY_CONN_SCAN_WINDOW, /* Low duty cycle connection scan window (in slots (1 slot = 0.625 ms)) */
.low_duty_conn_duration = CY_BT_LOW_DUTY_CONN_SCAN_DURATION, /* Low duty cycle connection duration in seconds (0 for infinite) */
/* Connection configuration */
.conn_min_interval = CY_BT_CONN_MIN_INTERVAL, /* Minimum connection interval (in slots (1 slot = 1.25 ms)) */
.conn_max_interval = CY_BT_CONN_MAX_INTERVAL, /* Maximum connection interval (in slots (1 slot = 1.25 ms)) */
.conn_latency = CY_BT_CONN_LATENCY, /* Connection latency */
.conn_supervision_timeout = CY_BT_CONN_SUPERVISION_TIMEOUT, /* Connection link supervision timeout (in 10 ms) */
},
/* LE advertisement settings */
.ble_advert_cfg =
{
.channel_map = CY_BT_CHANNEL_MAP, /* Advertising channel map (mask of BTM_BLE_ADVERT_CHNL_37, BTM_BLE_ADVERT_CHNL_38, BTM_BLE_ADVERT_CHNL_39) */
.high_duty_min_interval = CY_BT_HIGH_DUTY_ADV_MIN_INTERVAL, /* High duty undirected connectable minimum advertising interval (in slots (1 slot = 0.625 ms)) */
.high_duty_max_interval = CY_BT_HIGH_DUTY_ADV_MAX_INTERVAL, /* High duty undirected connectable maximum advertising interval (in slots (1 slot = 0.625 ms)) */
.high_duty_duration = CY_BT_HIGH_DUTY_ADV_DURATION, /* High duty undirected connectable advertising duration in seconds (0 for infinite) */
.low_duty_min_interval = CY_BT_LOW_DUTY_ADV_MIN_INTERVAL, /* Low duty undirected connectable minimum advertising interval (in slots (1 slot = 0.625 ms)) */
.low_duty_max_interval = CY_BT_LOW_DUTY_ADV_MAX_INTERVAL, /* Low duty undirected connectable maximum advertising interval (in slots (1 slot = 0.625 ms)) */
.low_duty_duration = CY_BT_LOW_DUTY_ADV_DURATION, /* Low duty undirected connectable advertising duration in seconds (0 for infinite) */
.high_duty_directed_min_interval = CY_BT_HIGH_DUTY_DIRECTED_ADV_MIN_INTERVAL, /* High duty directed connectable minimum advertising interval (in slots (1 slot = 0.625 ms)) */
.high_duty_directed_max_interval = CY_BT_HIGH_DUTY_DIRECTED_ADV_MAX_INTERVAL, /* High duty directed connectable maximum advertising interval (in slots (1 slot = 0.625 ms)) */
.low_duty_directed_min_interval = CY_BT_LOW_DUTY_DIRECTED_ADV_MIN_INTERVAL, /* Low duty directed connectable minimum advertising interval (in slots (1 slot = 0.625 ms)) */
.low_duty_directed_max_interval = CY_BT_LOW_DUTY_DIRECTED_ADV_MAX_INTERVAL, /* Low duty directed connectable maximum advertising interval (in slots (1 slot = 0.625 ms)) */
.low_duty_directed_duration = CY_BT_LOW_DUTY_DIRECTED_ADV_DURATION, /* Low duty directed connectable advertising duration in seconds (0 for infinite) */
.high_duty_nonconn_min_interval = CY_BT_HIGH_DUTY_NONCONN_ADV_MIN_INTERVAL, /* High duty non-connectable minimum advertising interval (in slots (1 slot = 0.625 ms)) */
.high_duty_nonconn_max_interval = CY_BT_HIGH_DUTY_NONCONN_ADV_MAX_INTERVAL, /* High duty non-connectable maximum advertising interval (in slots (1 slot = 0.625 ms)) */
.high_duty_nonconn_duration = CY_BT_HIGH_DUTY_NONCONN_ADV_DURATION, /* High duty non-connectable advertising duration in seconds (0 for infinite) */
.low_duty_nonconn_min_interval = CY_BT_LOW_DUTY_NONCONN_ADV_MIN_INTERVAL, /* Low duty non-connectable minimum advertising interval (in slots (1 slot = 0.625 ms)) */
.low_duty_nonconn_max_interval = CY_BT_LOW_DUTY_NONCONN_ADV_MAX_INTERVAL, /* Low duty non-connectable maximum advertising interval (in slots (1 slot = 0.625 ms)) */
.low_duty_nonconn_duration = CY_BT_LOW_DUTY_NONCONN_ADV_DURATION /* Low duty non-connectable advertising duration in seconds (0 for infinite) */
},
/* GATT configuration */
.gatt_cfg =
{
.appearance = CY_BT_APPEARANCE, /* GATT appearance (see gatt_appearance_e) */
.client_max_links = CY_BT_CLIENT_MAX_LINKS, /* Client config: maximum number of servers that local client can connect to */
.server_max_links = CY_BT_SERVER_MAX_LINKS, /* Server config: maximum number of remote clients connections allowed by the local */
.max_attr_len = CY_BT_MAX_ATTR_LEN, /* Maximum attribute length; gki_cfg must have a corresponding buffer pool that can hold this length */
.max_mtu_size = CY_BT_MTU_SIZE /* Maximum MTU size for GATT connections, should be between 23 and (max_attr_len + 5) */
},
/* RFCOMM configuration */
.rfcomm_cfg =
{
.max_links = 0, /* Maximum number of simultaneous connected remote devices */
.max_ports = 0 /* Maximum number of simultaneous RFCOMM ports */
},
/* Application-managed L2CAP protocol configuration */
.l2cap_application =
{
.max_links = 0, /* Maximum number of application-managed l2cap links (BR/EDR and LE) */
/* BR/EDR l2cap configuration */
.max_psm = 0, /* Maximum number of application-managed BR/EDR PSMs */
.max_channels = 0, /* Maximum number of application-managed BR/EDR channels */
/* LE L2cap connection-oriented channels configuration */
.max_le_psm = CY_BT_L2CAP_MAX_LE_PSM, /* Maximum number of application-managed LE PSMs */
.max_le_channels = CY_BT_L2CAP_MAX_LE_CHANNELS, /* Maximum number of application-managed LE channels */
/* LE L2cap fixed channel configuration */
.max_le_l2cap_fixed_channels = 0, /* Maximum number of application-managed fixed channels supported (in addition to mandatory channels 4, 5 and 6) */
.max_rx_mtu = CY_BT_L2CAP_MTU_SIZE /* Maximum RX MTU allowed */
},
.addr_resolution_db_size = 5, /* LE Address Resolution DB settings - effective only for pre 4.2 controller */
.rpa_refresh_timeout = CY_BT_RPA_TIMEOUT, /* Interval of random address refreshing - secs */
.stack_scratch_size = WICED_BT_CFG_DEFAULT_STACK_SCRATCH_SIZE, /* Memory area reserved for the stack transient memory requirements */
.ble_white_list_size = CY_BT_FILTER_ACCEPT_LIST_SIZE, /* Maximum number of filter accept list devices allowed. Cannot be more than 128 */
.default_ble_power_level = CY_BT_TX_POWER /* Default LE power level */
};
#endif
|