1 /*
2  * Copyright 2016-2023, Cypress Semiconductor Corporation or
3  * an affiliate of Cypress Semiconductor Corporation.  All rights reserved.
4  *
5  * This software, including source code, documentation and related
6  * materials ("Software") is owned by Cypress Semiconductor Corporation
7  * or one of its affiliates ("Cypress") and is protected by and subject to
8  * worldwide patent protection (United States and foreign),
9  * United States copyright laws and international treaty provisions.
10  * Therefore, you may use this Software only as provided in the license
11  * agreement accompanying the software package from which you
12  * obtained this Software ("EULA").
13  * If no EULA applies, Cypress hereby grants you a personal, non-exclusive,
14  * non-transferable license to copy, modify, and compile the Software
15  * source code solely for use in connection with Cypress's
16  * integrated circuit products.  Any reproduction, modification, translation,
17  * compilation, or representation of this Software except as specified
18  * above is prohibited without the express written permission of Cypress.
19  *
20  * Disclaimer: THIS SOFTWARE IS PROVIDED AS-IS, WITH NO WARRANTY OF ANY KIND,
21  * EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, NONINFRINGEMENT, IMPLIED
22  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cypress
23  * reserves the right to make changes to the Software without notice. Cypress
24  * does not assume any liability arising out of the application or use of the
25  * Software or any product or circuit described in the Software. Cypress does
26  * not authorize its products for use in any products where a malfunction or
27  * failure of the Cypress product may reasonably be expected to result in
28  * significant property damage, injury or death ("High Risk Product"). By
29  * including Cypress's product in a High Risk Product, the manufacturer
30  * of such system or application assumes all risk of such use and in doing
31  * so agrees to indemnify Cypress against all liability.
32  */
33 /** @file
34  *
35  * Runtime Bluetooth configuration parameters
36  *
37  */
38 #pragma once
39 
40 #include "wiced_data_types.h"
41 #include "wiced_bt_types.h"
42 #include "gattdefs.h"
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
48 /**
49  * @addtogroup  wiced_bt_cfg Bluetooth Stack Initialize & Configuration
50  *
51  *
52  * This section describes API and Data structures required to initialize and configure the BT-Stack.
53  *
54  * @{
55  */
56 /*****************************************************************************
57  * Default configuration values
58  ****************************************************************************/
59  /**  */
60 /**
61  * @anchor WICED_DEFAULT_CFG_VALUES
62  * @name Bluetooth Configuration Default Values
63  * @{
64  *
65  * Bluetooth Configuration Default Values
66  *
67  * @note These are typical values for config parameters used for some common BLE, BR/EDR use cases.
68  */
69 #define WICED_BT_CFG_DEFAULT_INQUIRY_SCAN_INTERVAL                  0x0800      /**< Inquiry scan interval (in slots (1 slot = 0.625 ms)) */
70 #define WICED_BT_CFG_DEFAULT_INQUIRY_SCAN_WINDOW                    0x0012      /**< Inquiry scan window (in slots (1 slot = 0.625 ms)) */
71 #define WICED_BT_CFG_DEFAULT_PAGE_SCAN_INTERVAL                     0x0800      /**< Page scan interval (in slots (1 slot = 0.625 ms)) */
72 #define WICED_BT_CFG_DEFAULT_PAGE_SCAN_WINDOW                       0x0012      /**< Page scan window (in slots (1 slot = 0.625 ms)) */
73 #define WICED_BT_CFG_DEFAULT_HIGH_DUTY_SCAN_INTERVAL                96          /**< High duty scan interval (in slots (1 slot = 0.625 ms)) */
74 #define WICED_BT_CFG_DEFAULT_HIGH_DUTY_SCAN_WINDOW                  48          /**< High duty scan window (in slots (1 slot = 0.625 ms)) */
75 #define WICED_BT_CFG_DEFAULT_LOW_DUTY_SCAN_INTERVAL                 2048        /**< Low duty scan interval (in slots (1 slot = 0.625 ms)) */
76 #define WICED_BT_CFG_DEFAULT_LOW_DUTY_SCAN_WINDOW                   18          /**< Low duty scan window (in slots (1 slot = 0.625 ms)) */
77 #define WICED_BT_CFG_DEFAULT_HIGH_DUTY_CONN_SCAN_INTERVAL           96          /**< High duty cycle connection scan interval (in slots (1 slot = 0.625 ms)) */
78 #define WICED_BT_CFG_DEFAULT_HIGH_DUTY_CONN_SCAN_WINDOW             48          /**< High duty cycle connection scan window (in slots (1 slot = 0.625 ms)) */
79 #define WICED_BT_CFG_DEFAULT_LOW_DUTY_CONN_SCAN_INTERVAL            2048        /**< Low duty cycle connection scan interval (in slots (1 slot = 0.625 ms)) */
80 #define WICED_BT_CFG_DEFAULT_LOW_DUTY_CONN_SCAN_WINDOW              18          /**< Low duty cycle connection scan window (in slots (1 slot = 0.625 ms)) */
81 #define WICED_BT_CFG_DEFAULT_CONN_MIN_INTERVAL                      80          /**< Minimum connection event interval ( in 1.25 msec) */
82 #define WICED_BT_CFG_DEFAULT_CONN_MAX_INTERVAL                      80          /**< Maximum connection event interval ( in 1.25 msec) */
83 #define WICED_BT_CFG_DEFAULT_CONN_LATENCY                           0           /**< Connection latency (in number of LL connection events) */
84 #define WICED_BT_CFG_DEFAULT_CONN_SUPERVISION_TIMEOUT               700         /**< Connection link supervision timeout (in 10 msec) */
85 
86 /* undirected connectable advertisement high/low duty cycle interval default */
87 #define WICED_BT_CFG_DEFAULT_HIGH_DUTY_ADV_MIN_INTERVAL             48          /**< Tgap(adv_fast_interval1) = 48 *0.625  = 30ms*/
88 #define WICED_BT_CFG_DEFAULT_HIGH_DUTY_ADV_MAX_INTERVAL             48          /**< Tgap(adv_fast_interval1) = 48 *0.625  = 30ms*/
89 #define WICED_BT_CFG_DEFAULT_LOW_DUTY_ADV_MIN_INTERVAL              2048        /**< Tgap(adv_slow_interval) = 2048 * 0.625 = 1.28s */
90 #define WICED_BT_CFG_DEFAULT_LOW_DUTY_ADV_MAX_INTERVAL              2048        /**< Tgap(adv_slow_interval) = 2048 * 0.625 = 1.28s */
91 
92 /* non-connectable advertisement high/low duty cycle advertisement interval default */
93 #define WICED_BT_CFG_DEFAULT_HIGH_DUTY_NONCONN_ADV_MIN_INTERVAL     160         /**< Tgap(adv_fast_interval2) = 160 * 0.625 = 100 ms */
94 #define WICED_BT_CFG_DEFAULT_HIGH_DUTY_NONCONN_ADV_MAX_INTERVAL     160         /**< Tgap(adv_fast_interval2) = 160 * 0.625 = 100 ms */
95 #define WICED_BT_CFG_DEFAULT_LOW_DUTY_NONCONN_ADV_MIN_INTERVAL      2048        /**< Tgap(adv_slow_interval) = 2048 * 0.625 = 1.28s */
96 #define WICED_BT_CFG_DEFAULT_LOW_DUTY_NONCONN_ADV_MAX_INTERVAL      2048        /**< Tgap(adv_slow_interval) = 2048 * 0.625 = 1.28s */
97 
98 /* directed connectable advertisement high/low duty cycle interval default */
99 #define WICED_BT_CFG_DEFAULT_HIGH_DUTY_DIRECTED_ADV_MIN_INTERVAL    400        /**< Tgap(dir_conn_adv_int_max) = 400 * 0.625 = 250 ms */
100 #define WICED_BT_CFG_DEFAULT_HIGH_DUTY_DIRECTED_ADV_MAX_INTERVAL    800        /**< Tgap(dir_conn_adv_int_min) = 800 * 0.625 = 500 ms */
101 #define WICED_BT_CFG_DEFAULT_LOW_DUTY_DIRECTED_ADV_MIN_INTERVAL     48         /**< Tgap(adv_fast_interval1) = 48 * 0.625 = 30 ms */
102 #define WICED_BT_CFG_DEFAULT_LOW_DUTY_DIRECTED_ADV_MAX_INTERVAL     48         /**< Tgap(adv_fast_interval1) = 48 * 0.625 = 30 ms */
103 
104 /* refreshment timing interval of random private address */
105 #define WICED_BT_CFG_DEFAULT_RANDOM_ADDRESS_CHANGE_TIMEOUT          900        /**< default refreshment timing interval 900secs */
106 #define WICED_BT_CFG_DEFAULT_RANDOM_ADDRESS_NEVER_CHANGE            0          /**< value for disabling random address refresh */
107 #define WICED_BT_CFG_MAX_RANDOM_ADDRESS_CHANGE_TIMEOUT              3600       /**< max refreshment timing interval 3600secs*/
108 
109 /** @} WICED_DEFAULT_CFG_VALUES */
110 
111 /*****************************************************************************
112  * Wiced_bt core stack configuration
113  ****************************************************************************/
114 /** Scan modes */
115 enum wiced_bt_ble_scan_mode_e
116 {
117     BTM_BLE_SCAN_MODE_PASSIVE = 0,  /**< Passive scan mode */
118     BTM_BLE_SCAN_MODE_ACTIVE = 1,   /**< Active scan mode */
119     BTM_BLE_SCAN_MODE_NONE = 0xff   /**< None */
120 };
121 typedef uint8_t wiced_bt_ble_scan_mode_t;   /**< scan mode (see #wiced_bt_ble_scan_mode_e) */
122 
123 /** Security Service Levels (bit fields) */
124 enum wiced_bt_sec_level_e
125 {
126     /** BTM_SEC_BEST_EFFORT : Recommended choice for most applications, to connect to the widest range of devices.
127       * Allows stack to choose the highest level of security possible between the two devices */
128     BTM_SEC_BEST_EFFORT = 1,
129 
130     /** BTM_SEC_SC_REQUIRED : Can be set by applications which need to enforce secure connections.
131       * Note: If this bit is set, the stack will only allow connections to devices paired using Secure Connections */
132     BTM_SEC_SC_REQUIRED = 2,
133 
134     /** BTM_SEC_AUTH_REQUIRED - Can be set by applications which need to enforce Authentication
135       * Note: If this bit is set, the stack will only allow connections to devices paired using authentication */
136     BTM_SEC_AUTH_REQUIRED = 4,
137 
138     /** BTM_SEC_SC_AUTH_REQUIRED : Can be set by applications which need to enforce secure connections with MITM protection.
139      * Note: If this bit is set, the stack will only allow connections to devices paired using Secure Connections with Man In The Middle (MITM) protection */
140     BTM_SEC_SC_AUTH_REQUIRED = (BTM_SEC_SC_REQUIRED | 4),
141 };
142 typedef uint8_t wiced_bt_sec_level_t; /**< Required security level */
143 
144 /** LE Scan settings */
145 typedef struct
146 {
147     wiced_bt_ble_scan_mode_t            scan_mode;                          /**< BLE scan mode \ref wiced_bt_ble_scan_mode_t */
148 
149     /* Advertisement scan configuration
150     * @note Refer to 7.8.10 LE Set Scan Parameters command
151     */
152     uint16_t                            high_duty_scan_interval;            /**< High duty scan interval (in slots (1 slot = 0.625 ms)) (default: #WICED_BT_CFG_DEFAULT_HIGH_DUTY_SCAN_INTERVAL) */
153     uint16_t                            high_duty_scan_window;              /**< High duty scan window (in slots (1 slot = 0.625 ms)) (default: #WICED_BT_CFG_DEFAULT_HIGH_DUTY_SCAN_WINDOW) */
154     uint16_t                            high_duty_scan_duration;            /**< High duty scan duration in seconds (0 for infinite) */
155 
156     uint16_t                            low_duty_scan_interval;             /**< Low duty scan interval (in slots (1 slot = 0.625 ms)) (default: #WICED_BT_CFG_DEFAULT_LOW_DUTY_SCAN_INTERVAL) */
157     uint16_t                            low_duty_scan_window;               /**< Low duty scan window (in slots (1 slot = 0.625 ms)) (default: #WICED_BT_CFG_DEFAULT_LOW_DUTY_SCAN_WINDOW) */
158     uint16_t                            low_duty_scan_duration;             /**< Low duty scan duration in seconds (0 for infinite) */
159 
160     /* Connection scan configuration
161     * @note Refer to 7.8.10 LE Set Scan Parameters command
162     */
163     uint16_t                            high_duty_conn_scan_interval;       /**< High duty cycle connection scan interval (in slots (1 slot = 0.625 ms)) (default: #WICED_BT_CFG_DEFAULT_HIGH_DUTY_CONN_SCAN_INTERVAL) */
164     uint16_t                            high_duty_conn_scan_window;         /**< High duty cycle connection scan window (in slots (1 slot = 0.625 ms)) (default: #WICED_BT_CFG_DEFAULT_HIGH_DUTY_CONN_SCAN_WINDOW) */
165     uint16_t                            high_duty_conn_duration;            /**< High duty cycle connection duration in seconds (0 for infinite) */
166 
167     uint16_t                            low_duty_conn_scan_interval;        /**< Low duty cycle connection scan interval (in slots (1 slot = 0.625 ms)) (default: #WICED_BT_CFG_DEFAULT_LOW_DUTY_CONN_SCAN_INTERVAL) */
168     uint16_t                            low_duty_conn_scan_window;          /**< Low duty cycle connection scan window (in slots (1 slot = 0.625 ms)) (default: #WICED_BT_CFG_DEFAULT_LOW_DUTY_CONN_SCAN_WINDOW) */
169     uint16_t                            low_duty_conn_duration;             /**< Low duty cycle connection duration in seconds (0 for infinite) */
170 
171     /* Connection configuration
172     * @note: Refer to description of valid values in the BT SIG Spec Ver 5.2, section 7.8.12 LE Create Connection command
173     */
174     uint16_t                            conn_min_interval;                  /**< Minimum connection interval (in 1.25 msec) (default: #WICED_BT_CFG_DEFAULT_CONN_MIN_INTERVAL) */
175     uint16_t                            conn_max_interval;                  /**< Maximum connection interval (in 1.25 msec) (default: #WICED_BT_CFG_DEFAULT_CONN_MAX_INTERVAL) */
176     uint16_t                            conn_latency;                       /**< Connection latency */
177     uint16_t                            conn_supervision_timeout;           /**< Connection link supervision timeout (in 10 msec) (default: #WICED_BT_CFG_DEFAULT_CONN_SUPERVISION_TIMEOUT) */
178 } wiced_bt_cfg_ble_scan_settings_t;
179 
180 /** advertising channel map */
181 enum wiced_bt_ble_advert_chnl_map_e
182 {
183     BTM_BLE_ADVERT_CHNL_37 = (0x01 << 0),  /**< ADV channel */
184     BTM_BLE_ADVERT_CHNL_38 = (0x01 << 1),  /**< ADV channel */
185     BTM_BLE_ADVERT_CHNL_39 = (0x01 << 2)   /**< ADV channel */
186 };
187 typedef uint8_t wiced_bt_ble_advert_chnl_map_t;  /**< BLE advertisement channel map (see #wiced_bt_ble_advert_chnl_map_e) */
188 
189 /** Advertising settings */
190 /**
191  * @note: Refer to valid ranges for the min and max intervals in the Core Specification 5.2, 7.8.5 LE Set Advertising Parameters command of the
192  * Host Controller Interface Functional Specification
193  */
194 typedef struct
195 {
196     wiced_bt_ble_advert_chnl_map_t      channel_map;   /**< Advertising channel map (mask of #BTM_BLE_ADVERT_CHNL_37, #BTM_BLE_ADVERT_CHNL_38, #BTM_BLE_ADVERT_CHNL_39) */
197 
198     uint16_t high_duty_min_interval;             /**< High duty undirected connectable advert minimum advertising interval (in slots (1 slot = 0.625 ms)) (default: #WICED_BT_CFG_DEFAULT_HIGH_DUTY_ADV_MIN_INTERVAL) */
199     uint16_t high_duty_max_interval;             /**< High duty undirected connectable advert maximum advertising interval (in slots (1 slot = 0.625 ms)) (default: #WICED_BT_CFG_DEFAULT_HIGH_DUTY_ADV_MAX_INTERVAL) */
200     uint16_t high_duty_duration;                 /**< High duty advertising duration in seconds (0 for infinite) */
201 
202     uint16_t low_duty_min_interval;              /**< Low duty undirected connectable advert minimum advertising interval (in slots (1 slot = 0.625 ms)) (default: #WICED_BT_CFG_DEFAULT_LOW_DUTY_ADV_MIN_INTERVAL) */
203     uint16_t low_duty_max_interval;              /**< Low duty undirected connectable advert maximum advertising interval (in slots (1 slot = 0.625 ms)) (default: #WICED_BT_CFG_DEFAULT_LOW_DUTY_ADV_MAX_INTERVAL) */
204     uint16_t low_duty_duration;                  /**< Low duty advertising duration in seconds (0 for infinite) */
205 
206     uint16_t high_duty_directed_min_interval;    /**< high duty directed adv minimum advertising interval (in slots (1 slot = 0.625 ms)) (default: #WICED_BT_CFG_DEFAULT_HIGH_DUTY_DIRECTED_ADV_MIN_INTERVAL) */
207     uint16_t high_duty_directed_max_interval;    /**< high duty directed adv maximum advertising interval (in slots (1 slot = 0.625 ms)) (default: #WICED_BT_CFG_DEFAULT_HIGH_DUTY_DIRECTED_ADV_MAX_INTERVAL) */
208 
209     uint16_t low_duty_directed_min_interval;     /**< Low duty directed adv minimum advertising interval (in slots (1 slot = 0.625 ms)) (default: #WICED_BT_CFG_DEFAULT_LOW_DUTY_DIRECTED_ADV_MIN_INTERVAL) */
210     uint16_t low_duty_directed_max_interval;     /**< Low duty directed adv maximum advertising interval (in slots (1 slot = 0.625 ms)) (default: #WICED_BT_CFG_DEFAULT_LOW_DUTY_DIRECTED_ADV_MAX_INTERVAL) */
211     uint16_t low_duty_directed_duration;         /**< Low duty directed advertising duration in seconds (0 for infinite) */
212 
213     uint16_t high_duty_nonconn_min_interval;     /**< High duty non-connectable adv minimum advertising interval (in slots (1 slot = 0.625 ms)) (default: #WICED_BT_CFG_DEFAULT_HIGH_DUTY_NONCONN_ADV_MIN_INTERVAL) */
214     uint16_t high_duty_nonconn_max_interval;     /**< High duty non-connectable adv maximum advertising interval (in slots (1 slot = 0.625 ms)) (default: #WICED_BT_CFG_DEFAULT_HIGH_DUTY_NONCONN_ADV_MAX_INTERVAL) */
215     uint16_t high_duty_nonconn_duration;         /**< High duty non-connectable advertising duration in seconds (0 for infinite) */
216 
217     uint16_t low_duty_nonconn_min_interval;      /**< Low duty non-connectable adv minimum advertising interval (in slots (1 slot = 0.625 ms)) (default: #WICED_BT_CFG_DEFAULT_LOW_DUTY_NONCONN_ADV_MIN_INTERVAL) */
218     uint16_t low_duty_nonconn_max_interval;      /**< Low duty non-connectable adv maximum advertising interval (in slots (1 slot = 0.625 ms)) (default: #WICED_BT_CFG_DEFAULT_LOW_DUTY_NONCONN_ADV_MAX_INTERVAL) */
219     uint16_t low_duty_nonconn_duration;          /**< Low duty non-connectable advertising duration in seconds (0 for infinite) */
220 
221 } wiced_bt_cfg_ble_advert_settings_t;
222 
223 typedef uint16_t wiced_bt_gatt_appearance_t;     /**< GATT appearance (see gatt_appearance_e in gattdefs.h) */
224 
225 /** GATT settings */
226 typedef struct
227 {
228     uint8_t  max_db_service_modules;  /**< Maximum number of GATT database segments to be added into the GATT DB
229                                       * @note: Should be set to 0 for most applications which do not update the GATT DB after invocation of
230                                       * \ref wiced_bt_gatt_db_init
231                                       */
232     uint8_t  max_eatt_bearers;        /**< Maximum number of allowed EATT bearers
233                                       * @note: Should be set to 0, for applications which support only legacy bearers.
234                                       */
235 } wiced_bt_cfg_gatt_t;
236 
237 /** Audio/Video Distribution configuration */
238 typedef struct
239 {
240     uint8_t  max_links; /**< Maximum simultaneous audio/video links over AVDT
241                         @note: This shall be <= \ref wiced_bt_cfg_br_t.br_max_simultaneous_links;
242                         */
243     uint8_t  max_seps;  /**< Maximum number of stream end points */
244 } wiced_bt_cfg_avdt_t;
245 
246 /** Audio/Video Remote Control configuration */
247 typedef struct
248 {
249     uint8_t max_links;  /**< Maximum simultaneous remote control links over AVRC
250                         @note: This shall be <= \ref wiced_bt_cfg_br_t.br_max_simultaneous_links;
251                         */
252 } wiced_bt_cfg_avrc_t;
253 
254 
255 /** RFCOMM configuration */
256 typedef struct
257 {
258     uint8_t  max_links;  /**< Maximum number of simultaneous connected remote devices over RFCOMM
259                          @note: This shall be <= \ref wiced_bt_cfg_br_t.br_max_simultaneous_links;
260                          */
261     uint8_t  max_ports;  /**< Maximum number of simultaneous RFCOMM ports */
262 } wiced_bt_cfg_rfcomm_t;
263 
264 /** Ischoronous Connection configuration settings */
265 typedef struct
266 {
267     uint16_t max_sdu_size;       /**< Max SDU size */
268     uint8_t channel_count;       /**< maximum number of audio channels per packet (left, right, etc.,) */
269     uint8_t max_cis_conn;        /**< Max Number of CIS connections */
270     uint8_t max_cig_count;       /**< Max Number of CIG connections */
271     uint8_t max_buffers_per_cis; /**< Max Number of buffers per CIS */
272     uint8_t max_big_count;       /**< Max Number of BIG connections */
273 } wiced_bt_cfg_isoc_t;
274 
275 /** BR/EDR configuration settings */
276 typedef struct {
277     uint8_t                br_max_simultaneous_links; /**< Max number for simultaneous connections for a layer, profile, protocol */
278     uint16_t               br_max_rx_pdu_size;        /**< Maximum size allowed for any received L2CAP PDU
279                                                       * Minimum value - 48
280                                                       * Maximum GATT MTU over legacy bearers shall be set to <= this value
281                                                       * Maximum MPS for EATT channels shall be set to <= this value
282                                                       */
283     wiced_bt_dev_class_t   device_class;              /**< Local device class */
284     wiced_bt_cfg_rfcomm_t  rfcomm_cfg;                /**< RFCOMM settings */
285     wiced_bt_cfg_avdt_t    avdt_cfg;                  /**< Audio/Video Distribution configuration */
286     wiced_bt_cfg_avrc_t    avrc_cfg;                  /**< Audio/Video Remote Control configuration */
287 }wiced_bt_cfg_br_t;
288 
289 /** BLE configuration settings */
290 typedef struct {
291     uint8_t    ble_max_simultaneous_links;   /**< Max number for simultaneous connections for a layer, profile, protocol */
292     uint16_t   ble_max_rx_pdu_size;          /**< Maximum size allowed for any received L2CAP PDU
293                                              * Minimum value - 65 (to support SM)
294                                              * Maximum GATT MTU over legacy bearers shall be set to <= this value
295                                              * Maximum MPS for EATT channels shall be set to <= this value
296                                              */
297     wiced_bt_gatt_appearance_t appearance;   /**< Device appearance to be sent out during advertising */
298 
299     uint16_t   rpa_refresh_timeout;          /**< Interval of random address refreshing - secs. The timeout value cannot be more than 1 hr = 3600s
300                                               *
301                                               * @note BLE Privacy is disabled if the value is 0.
302                                               */
303     uint16_t   host_addr_resolution_db_size; /**< addr resolution db size */
304 
305     const wiced_bt_cfg_ble_scan_settings_t   *p_ble_scan_cfg;     /**< BLE scan settings */
306     const wiced_bt_cfg_ble_advert_settings_t *p_ble_advert_cfg;   /**< BLE advertisement settings */
307     int8_t                                    default_ble_power_level;  /**< Default LE power level, Refer lm_TxPwrTable table for the power range */
308 }wiced_bt_cfg_ble_t;
309 
310 /** Settings for application managed L2CAP protocols (optional) */
311 typedef struct
312 {
313     uint8_t max_app_l2cap_psms;                 /**< Maximum number of application-managed PSMs        */
314     uint8_t max_app_l2cap_channels;             /**< Maximum number of application-managed channels    */
315 
316     uint8_t max_app_l2cap_le_fixed_channels;    /**< Maximum number of application managed fixed channels supported. > */
317 
318     uint8_t max_app_l2cap_br_edr_ertm_chnls;    /**< Maximum application ERTM channels, BR/EDR only    */
319     uint8_t max_app_l2cap_br_edr_ertm_tx_win;   /**< Maximum application ERTM TX Window, BR/EDR only   */
320 } wiced_bt_cfg_l2cap_application_t;
321 
322 /** Bluetooth stack configuration */
323 typedef struct wiced_bt_cfg_settings_t_
324 {
325     uint8_t *device_name;                                    /**< Local device name (NULL terminated) */
326     wiced_bt_sec_level_t security_required;                  /**< BTM_SEC_BEST_EFFORT is recommended choice for most applications,
327                                                                     to connect to the widest range of devices. Allows stack to choose
328                                                                     the highest level of security possible between the two devices */
329     const wiced_bt_cfg_br_t *p_br_cfg;                       /**< BR/EDR related configuration */
330     const wiced_bt_cfg_ble_t *p_ble_cfg;                     /**< BLE related configuration */
331     const wiced_bt_cfg_gatt_t *p_gatt_cfg;                   /**< GATT settings */
332     const wiced_bt_cfg_isoc_t *p_isoc_cfg;                   /**< Ischoronous Connection configuration */
333     const wiced_bt_cfg_l2cap_application_t *p_l2cap_app_cfg; /**< l2cap configuration fgitor application defined profiles/protocols */
334 } wiced_bt_cfg_settings_t;
335 
336 /**
337  * Returns the expected dynamic memory size required for the stack based on the p_bt_cfg_settings
338  *
339  * @param[in] p_bt_cfg_settings         : Bluetooth stack configuration
340  *
341  * @return    dynamic memory size requirements of the stack
342  */
343 int32_t wiced_bt_stack_get_dynamic_memory_size_for_config(const wiced_bt_cfg_settings_t* p_bt_cfg_settings);
344 
345 
346 #ifdef __cplusplus
347 } /* extern "C" */
348 #endif
349 
350 
351 /**@} wiced_bt_cfg */
352