1 /******************************************************************************
2  *
3  *  Copyright (c) 2014 The Android Open Source Project
4  *  Copyright (C) 1999-2012 Broadcom Corporation
5  *
6  *  Licensed under the Apache License, Version 2.0 (the "License");
7  *  you may not use this file except in compliance with the License.
8  *  You may obtain a copy of the License at:
9  *
10  *  http://www.apache.org/licenses/LICENSE-2.0
11  *
12  *  Unless required by applicable law or agreed to in writing, software
13  *  distributed under the License is distributed on an "AS IS" BASIS,
14  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  *  See the License for the specific language governing permissions and
16  *  limitations under the License.
17  *
18  ******************************************************************************/
19 
20 #ifndef BT_TARGET_H
21 #define BT_TARGET_H
22 
23 #include <bt_common.h>
24 
25 #ifndef BUILDCFG
26 #define BUILDCFG
27 #endif
28 
29 /*
30 #if !defined(HAS_BDROID_BUILDCFG) && !defined(HAS_NO_BDROID_BUILDCFG)
31 #error "An Android.mk file did not include bdroid_CFLAGS and possibly not bdorid_C_INCLUDES"
32 #endif
33 */
34 
35 #ifdef HAS_BDROID_BUILDCFG
36 #include "bdroid_buildcfg.h"
37 #endif
38 
39 #include "bluedroid_user_config.h"
40 #include "stack/bt_types.h"   /* This must be defined AFTER buildcfg.h */
41 
42 #include "stack/dyn_mem.h"    /* defines static and/or dynamic memory for components */
43 
44 
45 /* OS Configuration from User config (eg: sdkconfig) */
46 #define BT_BTU_TASK_STACK_SIZE      UC_BTU_TASK_STACK_SIZE
47 
48 /******************************************************************************
49 **
50 ** Classic BT features
51 **
52 ******************************************************************************/
53 #if (UC_BT_CLASSIC_ENABLED == TRUE)
54 #define CLASSIC_BT_INCLUDED         TRUE
55 #define BTC_SM_INCLUDED             TRUE
56 #define BTC_PRF_QUEUE_INCLUDED      TRUE
57 #define BTC_GAP_BT_INCLUDED         TRUE
58 #define BTA_SDP_INCLUDED            TRUE
59 #define BTA_DM_PM_INCLUDED          TRUE
60 #define BTC_DM_PM_INCLUDED          TRUE
61 #define SDP_INCLUDED                TRUE
62 #define BTA_DM_QOS_INCLUDED         TRUE
63 
64 #if (UC_BT_A2DP_ENABLED == TRUE)
65 #define BTA_AR_INCLUDED             TRUE
66 #define BTA_AV_INCLUDED             TRUE
67 #define AVDT_INCLUDED               TRUE
68 #define A2D_INCLUDED                TRUE
69 #define AVCT_INCLUDED               TRUE
70 #define AVRC_INCLUDED               TRUE
71 #define BTC_AV_INCLUDED             TRUE
72 #define BTA_AV_SINK_INCLUDED        TRUE
73 #define BTC_AV_SINK_INCLUDED        TRUE
74 #define SBC_DEC_INCLUDED            TRUE
75 #define BTC_AV_SRC_INCLUDED         TRUE
76 #define SBC_ENC_INCLUDED            TRUE
77 #endif /* UC_BT_A2DP_ENABLED */
78 
79 #if (UC_BT_SPP_ENABLED == TRUE)
80 #define RFCOMM_INCLUDED             TRUE
81 #define BTA_JV_INCLUDED             TRUE
82 #define BTA_JV_RFCOMM_INCLUDED      TRUE
83 #define BTC_SPP_INCLUDED            TRUE
84 #endif /* UC_BT_SPP_ENABLED */
85 
86 #if (UC_BT_L2CAP_ENABLED == TRUE)
87 #define BTA_JV_INCLUDED             TRUE
88 #define BTC_L2CAP_INCLUDED          TRUE
89 #define BTC_SDP_INCLUDED            TRUE
90 #define VND_BT_JV_BTA_L2CAP         TRUE
91 #endif /* UC_BT_L2CAP_ENABLED */
92 
93 #if (UC_BT_HFP_AG_ENABLED == TRUE) || (UC_BT_HFP_CLIENT_ENABLED == TRUE)
94 #ifndef RFCOMM_INCLUDED
95 #define RFCOMM_INCLUDED             TRUE
96 #endif
97 #ifndef BTM_SCO_INCLUDED
98 #define BTM_SCO_INCLUDED            TRUE
99 #endif
100 #ifndef SBC_DEC_INCLUDED
101 #define SBC_DEC_INCLUDED            TRUE
102 #endif
103 #ifndef SBC_ENC_INCLUDED
104 #define SBC_ENC_INCLUDED            TRUE
105 #endif
106 #ifndef PLC_INCLUDED
107 #define PLC_INCLUDED                TRUE
108 #endif
109 
110 #if (UC_BT_HFP_AG_ENABLED == TRUE)
111 #ifndef BTM_MAX_SCO_LINKS_AG
112 #define BTM_MAX_SCO_LINKS_AG        (1)
113 #endif
114 #define BTC_HF_INCLUDED             TRUE
115 #define BTA_AG_INCLUDED             TRUE
116 #else
117 #ifndef BTM_MAX_SCO_LINKS_AG
118 #define BTM_MAX_SCO_LINKS_AG        (0)
119 #endif
120 #endif /* (UC_BT_HFP_AG_ENABLED == TRUE) */
121 #if (UC_BT_HFP_CLIENT_ENABLED == TRUE)
122 #ifndef BTM_MAX_SCO_LINKS_CLIENT
123 #define BTM_MAX_SCO_LINKS_CLIENT    (1)
124 #endif
125 #define BTC_HF_CLIENT_INCLUDED      TRUE
126 #define BTA_HF_INCLUDED             TRUE
127 #else
128 #ifndef BTM_MAX_SCO_LINKS_CLIENT
129 #define BTM_MAX_SCO_LINKS_CLIENT    (0)
130 #endif
131 #endif /* (UC_BT_HFP_CLIENT_ENABLED == TRUE) */
132 
133 #ifndef BTM_MAX_SCO_LINKS
134 #define BTM_MAX_SCO_LINKS           (BTM_MAX_SCO_LINKS_AG + BTM_MAX_SCO_LINKS_CLIENT)
135 #endif
136 #endif /* (UC_BT_HFP_AG_ENABLED == TRUE) || (UC_BT_HFP_CLIENT_ENABLED == TRUE) */
137 
138 #if UC_BT_SSP_ENABLED
139 #define BT_SSP_INCLUDED             TRUE
140 #endif /* UC_BT_SSP_ENABLED */
141 
142 #if UC_BT_HID_ENABLED
143 #define BT_HID_INCLUDED             TRUE
144 #endif /* UC_BT_HID_ENABLED */
145 
146 #if UC_BT_HID_HOST_ENABLED
147 #define HID_HOST_INCLUDED           TRUE
148 #define BTA_HH_INCLUDED             TRUE
149 #define BTC_HH_INCLUDED             TRUE
150 #endif /* UC_BT_HID_HOST_ENABLED */
151 
152 #if UC_BT_HID_DEVICE_ENABLED
153 #define HID_DEV_INCLUDED            TRUE
154 #define BTA_HD_INCLUDED             TRUE
155 #define BTC_HD_INCLUDED             TRUE
156 #endif /* UC_BT_HID_DEVICE_ENABLED */
157 
158 #endif /* UC_BT_CLASSIC_ENABLED */
159 
160 /* This is set to enable use of GAP L2CAP connections. */
161 #if (VND_BT_JV_BTA_L2CAP == TRUE)
162 #define BTA_JV_L2CAP_INCLUDED       TRUE
163 #define GAP_CONN_INCLUDED           TRUE
164 #endif /* VND_BT_JV_BTA_L2CAP */
165 
166 #ifndef CLASSIC_BT_INCLUDED
167 #define CLASSIC_BT_INCLUDED         FALSE
168 #endif /* CLASSIC_BT_INCLUDED */
169 
170 #ifndef CLASSIC_BT_GATT_INCLUDED
171 #define CLASSIC_BT_GATT_INCLUDED    FALSE
172 #endif /* CLASSIC_BT_GATT_INCLUDED */
173 /******************************************************************************
174 **
175 ** BLE features
176 **
177 ******************************************************************************/
178 #if (UC_BT_BLE_ENABLED ==TRUE)
179 #define BLE_INCLUDED              TRUE
180 #else
181 #define BLE_INCLUDED              FALSE
182 #endif /* UC_BT_BLE_ENABLED */
183 
184 #if (UC_BT_BLE_50_FEATURES_SUPPORTED == TRUE)
185 #define BLE_50_FEATURE_SUPPORT   TRUE
186 #else
187 #define BLE_50_FEATURE_SUPPORT   FALSE
188 #endif
189 
190 #if (UC_BT_BLE_ENABLED ==TRUE)
191 #if (UC_BT_BLE_42_FEATURES_SUPPORTED == TRUE || BLE_50_FEATURE_SUPPORT == FALSE)
192 #define BLE_42_FEATURE_SUPPORT   TRUE
193 #else
194 #define BLE_42_FEATURE_SUPPORT   FALSE
195 #endif
196 #else
197 #define BLE_42_FEATURE_SUPPORT   FALSE
198 #define BLE_50_FEATURE_SUPPORT   FALSE
199 #endif /* UC_BT_BLE_ENABLED */
200 
201 #if (UC_BT_BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
202 #define BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER   TRUE
203 #else
204 #define BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER   FALSE
205 #endif
206 
207 #if (UC_BT_BLE_FEAT_PERIODIC_ADV_ENH == TRUE)
208 #define BLE_FEAT_PERIODIC_ADV_ENH   TRUE
209 #else
210 #define BLE_FEAT_PERIODIC_ADV_ENH   FALSE
211 #endif
212 
213 #if (UC_BT_BLE_FEAT_CREATE_SYNC_ENH == TRUE)
214 #define BLE_FEAT_CREATE_SYNC_ENH   TRUE
215 #else
216 #define BLE_FEAT_CREATE_SYNC_ENH   FALSE
217 #endif
218 
219 #if (UC_BT_BLE_HIGH_DUTY_ADV_INTERVAL == TRUE)
220 #define BLE_HIGH_DUTY_ADV_INTERVAL TRUE
221 #else
222 #define BLE_HIGH_DUTY_ADV_INTERVAL FALSE
223 #endif
224 
225 #if (UC_BT_BLE_RPA_SUPPORTED  == TRUE)
226 #define CONTROLLER_RPA_LIST_ENABLE   TRUE
227 #else
228 #define CONTROLLER_RPA_LIST_ENABLE   FALSE
229 #endif
230 
231 #if (UC_BT_GATTS_ENABLE)
232 #define GATTS_INCLUDED              TRUE
233 #else
234 #define GATTS_INCLUDED              FALSE
235 #endif /* UC_BT_GATTS_ENABLE */
236 
237 #if (UC_BT_GATTC_ENABLE)
238 #define GATTC_INCLUDED              TRUE
239 #else
240 #define GATTC_INCLUDED              FALSE
241 #endif  /* UC_BT_GATTC_ENABLE */
242 
243 #if (UC_BT_GATTC_ENABLE && UC_BT_GATTC_CACHE_NVS_FLASH_ENABLED)
244 #define GATTC_CACHE_NVS             TRUE
245 #else
246 #define GATTC_CACHE_NVS             FALSE
247 #endif  /* UC_BT_GATTC_ENABLE && UC_BT_GATTC_CACHE_NVS_FLASH_ENABLED */
248 
249 #if (UC_BT_GATTC_ENABLE && UC_BT_GATTC_CONNECT_RETRY_COUNT)
250 #define GATTC_CONNECT_RETRY_COUNT             UC_BT_GATTC_CONNECT_RETRY_COUNT
251 #else
252 #define GATTC_CONNECT_RETRY_COUNT             0
253 #endif  /* UC_BT_GATTC_ENABLE && UC_BT_GATTC_CONNECT_RETRY_COUNT */
254 
255 #if (GATTC_CONNECT_RETRY_COUNT > 0)
256 #define GATTC_CONNECT_RETRY_EN     TRUE
257 #else
258 #define GATTC_CONNECT_RETRY_EN     FALSE
259 #endif
260 
261 #ifdef UC_BT_GATTC_NOTIF_REG_MAX
262 #define BTA_GATTC_NOTIF_REG_MAX     UC_BT_GATTC_NOTIF_REG_MAX
263 #else
264 #define BTA_GATTC_NOTIF_REG_MAX     5
265 #endif
266 
267 #if (UC_BT_SMP_ENABLE)
268 #define SMP_INCLUDED                TRUE
269 #if (BLE_INCLUDED == TRUE)
270 #define BLE_PRIVACY_SPT             TRUE
271 #else
272 #define BLE_PRIVACY_SPT             FALSE
273 #endif  /*BLE_INCLUDED*/
274 #else
275 #define SMP_INCLUDED                FALSE
276 #define BLE_PRIVACY_SPT             FALSE
277 #endif  /* UC_BT_SMP_ENABLE */
278 
279 #if(UC_BT_SMP_SLAVE_CON_PARAMS_UPD_ENABLE)
280 #define SMP_SLAVE_CON_PARAMS_UPD_ENABLE     TRUE
281 #else
282 #define SMP_SLAVE_CON_PARAMS_UPD_ENABLE     FALSE
283 #endif /* UC_BT_SMP_SLAVE_CON_PARAMS_UPD_ENABLE */
284 
285 #if (UC_BT_BLE_SMP_ID_RESET_ENABLE)
286 #define BLE_SMP_ID_RESET_ENABLE          TRUE
287 #else
288 #define BLE_SMP_ID_RESET_ENABLE          FALSE
289 #endif
290 
291 #if (UC_BT_BLE_SMP_BOND_NVS_FLASH)
292 #define BLE_SMP_BOND_NVS_FLASH      TRUE
293 #else
294 #define BLE_SMP_BOND_NVS_FLASH      FALSE
295 #endif
296 
297 #ifdef UC_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP
298 #define BLE_ADV_REPORT_FLOW_CONTROL         (UC_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP && BLE_INCLUDED)
299 #endif /* UC_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP */
300 
301 #ifdef UC_BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM
302 #define BLE_ADV_REPORT_FLOW_CONTROL_NUM     UC_BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM
303 #endif /* UC_BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM */
304 
305 #ifdef UC_BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD
306 #define BLE_ADV_REPORT_DISCARD_THRSHOLD     UC_BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD
307 #endif /* UC_BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD */
308 
309 #ifdef UC_BT_ACL_CONNECTIONS
310 #define MAX_ACL_CONNECTIONS         UC_BT_ACL_CONNECTIONS
311 #define GATT_MAX_PHY_CHANNEL        UC_BT_ACL_CONNECTIONS
312 #endif  /* UC_BT_ACL_CONNECTIONS */
313 
314 #ifdef UC_BT_MULTI_CONNECTION_ENBALE
315 #define BT_MULTI_CONNECTION_ENBALE  UC_BT_MULTI_CONNECTION_ENBALE
316 #endif
317 
318 #if(BT_MULTI_CONNECTION_ENBALE && (CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3))
319 #define BLE_CE_LEN_MIN           5
320 #else
321 #define BLE_CE_LEN_MIN           0
322 #endif
323 
324 #ifdef UC_BT_BLE_ESTAB_LINK_CONN_TOUT
325 #define BLE_ESTABLISH_LINK_CONNECTION_TIMEOUT UC_BT_BLE_ESTAB_LINK_CONN_TOUT
326 #endif
327 
328 //------------------Added from bdroid_buildcfg.h---------------------
329 #ifndef L2CAP_EXTFEA_SUPPORTED_MASK
330 #define L2CAP_EXTFEA_SUPPORTED_MASK (L2CAP_EXTFEA_ENH_RETRANS | L2CAP_EXTFEA_STREAM_MODE | L2CAP_EXTFEA_NO_CRC | L2CAP_EXTFEA_FIXED_CHNLS)
331 #endif
332 
333 #ifndef BTUI_OPS_FORMATS
334 #define BTUI_OPS_FORMATS (BTA_OP_VCARD21_MASK | BTA_OP_ANY_MASK)
335 #endif
336 
337 #ifndef BTA_RFC_MTU_SIZE
338 #define BTA_RFC_MTU_SIZE (L2CAP_MTU_SIZE-L2CAP_MIN_OFFSET-RFCOMM_DATA_OVERHEAD)
339 #endif
340 
341 #ifndef SBC_NO_PCM_CPY_OPTION
342 #define SBC_NO_PCM_CPY_OPTION FALSE
343 #endif
344 
345 #ifndef BT_APP_DEMO
346 #define BT_APP_DEMO TRUE
347 #endif
348 
349 #ifndef BTIF_INCLUDED
350 #define BTIF_INCLUDED FALSE
351 #endif
352 
353 /******************************************************************************
354 **
355 ** BTC-layer components
356 **
357 ******************************************************************************/
358 #ifndef BTC_GAP_BT_INCLUDED
359 #define BTC_GAP_BT_INCLUDED FALSE
360 #endif
361 
362 #ifndef BTC_PRF_QUEUE_INCLUDED
363 #define BTC_PRF_QUEUE_INCLUDED FALSE
364 #endif
365 
366 #ifndef BTC_SM_INCLUDED
367 #define BTC_SM_INCLUDED FALSE
368 #endif
369 
370 #ifndef BTC_AV_INCLUDED
371 #define BTC_AV_INCLUDED FALSE
372 #endif
373 
374 #ifndef BTC_AV_SINK_INCLUDED
375 #define BTC_AV_SINK_INCLUDED FALSE
376 #endif
377 
378 #ifndef BTC_AV_SRC_INCLUDED
379 #define BTC_AV_SRC_INCLUDED FALSE
380 #endif
381 
382 #ifndef BTC_SPP_INCLUDED
383 #define BTC_SPP_INCLUDED FALSE
384 #endif
385 
386 #ifndef BTC_HH_INCLUDED
387 #define BTC_HH_INCLUDED FALSE
388 #endif
389 
390 #ifndef BTC_HD_INCLUDED
391 #define BTC_HD_INCLUDED FALSE
392 #endif
393 
394 #ifndef SBC_DEC_INCLUDED
395 #define SBC_DEC_INCLUDED FALSE
396 #endif
397 
398 #ifndef SBC_ENC_INCLUDED
399 #define SBC_ENC_INCLUDED FALSE
400 #endif
401 
402 /******************************************************************************
403 **
404 ** BTA-layer components
405 **
406 ******************************************************************************/
407 #ifndef BTA_INCLUDED
408 #define BTA_INCLUDED TRUE
409 #endif
410 
411 #ifndef BTA_DM_PM_INCLUDED
412 #define BTA_DM_PM_INCLUDED FALSE
413 #endif
414 
415 #ifndef BTA_DM_QOS_INCLUDED
416 #define BTA_DM_QOS_INCLUDED FALSE
417 #endif
418 
419 #ifndef BTA_PAN_INCLUDED
420 #define BTA_PAN_INCLUDED FALSE
421 #endif
422 
423 #ifndef BTA_HD_INCLUDED
424 #define BTA_HD_INCLUDED FALSE
425 #endif
426 
427 #ifndef BTA_HH_INCLUDED
428 #define BTA_HH_INCLUDED FALSE
429 #endif
430 
431 #ifndef BTA_HH_ROLE
432 #define BTA_HH_ROLE BTA_MASTER_ROLE_PREF
433 #endif
434 
435 #ifndef BTA_HH_LE_INCLUDED
436 #define BTA_HH_LE_INCLUDED FALSE
437 #endif
438 
439 #ifndef BTA_AR_INCLUDED
440 #define BTA_AR_INCLUDED FALSE
441 #endif
442 
443 #ifndef BTA_AV_INCLUDED
444 #define BTA_AV_INCLUDED FALSE
445 #endif
446 
447 #ifndef BTA_AV_SINK_INCLUDED
448 #define BTA_AV_SINK_INCLUDED FALSE
449 #endif
450 
451 #ifndef BTA_JV_INCLUDED
452 #define BTA_JV_INCLUDED FALSE
453 #endif
454 
455 #ifndef BTA_SDP_INCLUDED
456 #define BTA_SDP_INCLUDED FALSE
457 #endif
458 
459 /* This is set to enable use of GAP L2CAP connections. */
460 #ifndef VND_BT_JV_BTA_L2CAP
461 #define VND_BT_JV_BTA_L2CAP        FALSE
462 #endif
463 
464 #ifndef BTA_JV_L2CAP_INCLUDED
465 #define BTA_JV_L2CAP_INCLUDED       FALSE
466 #endif
467 
468 #ifndef GAP_CONN_INCLUDED
469 #define GAP_CONN_INCLUDED           FALSE
470 #endif
471 
472 /******************************************************************************
473 **
474 ** Stack-layer components
475 **
476 ******************************************************************************/
477 #ifndef AVCT_INCLUDED
478 #define AVCT_INCLUDED FALSE
479 #endif
480 
481 #ifndef AVDT_INCLUDED
482 #define AVDT_INCLUDED FALSE
483 #endif
484 
485 /******************************************************************************
486 **
487 ** Parameter Configurations for components
488 **
489 ******************************************************************************/
490 #ifndef BTA_DISABLE_DELAY
491 #define BTA_DISABLE_DELAY 200 /* in milliseconds */
492 #endif
493 
494 #ifndef BTA_SYS_TIMER_PERIOD
495 #define BTA_SYS_TIMER_PERIOD  100
496 #endif
497 
498 #ifndef SBC_FOR_EMBEDDED_LINUX
499 #define SBC_FOR_EMBEDDED_LINUX TRUE
500 #endif
501 
502 #ifndef AVDT_VERSION
503 #define AVDT_VERSION  0x0102
504 #endif
505 
506 #ifndef BTA_AG_AT_MAX_LEN
507 #define BTA_AG_AT_MAX_LEN  512
508 #endif
509 
510 #ifndef BTA_AVRCP_FF_RW_SUPPORT
511 #define BTA_AVRCP_FF_RW_SUPPORT FALSE
512 #endif
513 
514 #ifndef BTA_AG_SCO_PKT_TYPES
515 #define BTA_AG_SCO_PKT_TYPES  (BTM_SCO_LINK_ONLY_MASK | BTM_SCO_PKT_TYPES_MASK_EV3 |  BTM_SCO_PKT_TYPES_MASK_NO_3_EV3 | BTM_SCO_PKT_TYPES_MASK_NO_2_EV5 | BTM_SCO_PKT_TYPES_MASK_NO_3_EV5)
516 #endif
517 
518 #ifndef BTA_AV_RET_TOUT
519 #define BTA_AV_RET_TOUT 15
520 #endif
521 
522 #ifndef PORCHE_PAIRING_CONFLICT
523 #define PORCHE_PAIRING_CONFLICT  TRUE
524 #endif
525 
526 #ifndef BTA_AV_CO_CP_SCMS_T
527 #define BTA_AV_CO_CP_SCMS_T  FALSE
528 #endif
529 
530 #if UC_BT_BLE_HOST_QUEUE_CONGESTION_CHECK
531 #define SCAN_QUEUE_CONGEST_CHECK  TRUE
532 #else
533 #define SCAN_QUEUE_CONGEST_CHECK  FALSE
534 #endif
535 
536 #ifdef UC_CONFIG_BT_GATTS_PPCP_CHAR_GAP
537 #define BTM_PERIPHERAL_ENABLED   UC_CONFIG_BT_GATTS_PPCP_CHAR_GAP
538 #endif
539 
540 #ifdef UC_BT_GATTS_SEND_SERVICE_CHANGE_MODE
541 #define GATTS_SEND_SERVICE_CHANGE_MODE UC_BT_GATTS_SEND_SERVICE_CHANGE_MODE
542 #endif
543 
544 #if (UC_BT_GATTS_ROBUST_CACHING_ENABLED == TRUE)
545 #define GATTS_ROBUST_CACHING_ENABLED TRUE
546 #else
547 #define GATTS_ROBUST_CACHING_ENABLED FALSE
548 #endif
549 
550 #if (UC_BT_GATTS_DEVICE_NAME_WRITABLE == TRUE)
551 #define GATTS_DEVICE_NAME_WRITABLE TRUE
552 #else
553 #define GATTS_DEVICE_NAME_WRITABLE FALSE
554 #endif
555 
556 #if (UC_BT_GATTS_APPEARANCE_WRITABLE == TRUE)
557 #define GATTS_APPEARANCE_WRITABLE TRUE
558 #else
559 #define GATTS_APPEARANCE_WRITABLE FALSE
560 #endif
561 
562 #ifdef UC_BT_BLE_ACT_SCAN_REP_ADV_SCAN
563 #define BTM_BLE_ACTIVE_SCAN_REPORT_ADV_SCAN_RSP_INDIVIDUALLY    UC_BT_BLE_ACT_SCAN_REP_ADV_SCAN
564 #endif
565 
566 #ifdef UC_BT_BLE_RPA_TIMEOUT
567 #define BTM_BLE_PRIVATE_ADDR_INT UC_BT_BLE_RPA_TIMEOUT
568 #endif
569 
570 #if (UC_BT_CLASSIC_BQB_ENABLED == TRUE)
571 #define BT_CLASSIC_BQB_INCLUDED TRUE
572 #else
573 #define BT_CLASSIC_BQB_INCLUDED FALSE
574 #endif
575 
576 /* This feature is used to enable interleaved scan*/
577 #ifndef BTA_HOST_INTERLEAVE_SEARCH
578 #define BTA_HOST_INTERLEAVE_SEARCH FALSE
579 #endif
580 
581 #ifndef BT_USE_TRACES
582 #define BT_USE_TRACES  FALSE
583 #endif
584 
585 #ifndef BT_TRACE_BTIF
586 #define BT_TRACE_BTIF  TRUE
587 #endif
588 
589 #ifndef BT_TRACE_VERBOSE
590 #define BT_TRACE_VERBOSE  FALSE
591 #endif
592 
593 #ifndef BTA_DM_SDP_DB_SIZE
594 #define BTA_DM_SDP_DB_SIZE  8000
595 #endif
596 
597 #ifndef HL_INCLUDED
598 #define HL_INCLUDED  TRUE
599 #endif
600 
601 #ifndef AG_VOICE_SETTINGS
602 #define AG_VOICE_SETTINGS  HCI_DEFAULT_VOICE_SETTINGS
603 #endif
604 
605 #ifndef BTIF_DM_OOB_TEST
606 #define BTIF_DM_OOB_TEST  FALSE
607 #endif
608 
609 // How long to wait before activating sniff mode after entering the
610 // idle state for FTS, OPS connections
611 #ifndef BTA_FTS_OPS_IDLE_TO_SNIFF_DELAY_MS
612 #define BTA_FTS_OPS_IDLE_TO_SNIFF_DELAY_MS 7000
613 #endif
614 #ifndef BTA_FTC_OPS_IDLE_TO_SNIFF_DELAY_MS
615 #define BTA_FTC_OPS_IDLE_TO_SNIFF_DELAY_MS 5000
616 #endif
617 
618 //------------------End added from bdroid_buildcfg.h---------------------
619 
620 
621 /******************************************************************************
622 **
623 ** Buffer Size
624 **
625 ******************************************************************************/
626 
627 #ifndef BT_DEFAULT_BUFFER_SIZE
628 #define BT_DEFAULT_BUFFER_SIZE          (4096 + 16)
629 #endif
630 
631 #ifndef BT_SMALL_BUFFER_SIZE
632 #define BT_SMALL_BUFFER_SIZE            660
633 #endif
634 
635 /* Receives HCI events from the lower-layer. */
636 #ifndef HCI_CMD_BUF_SIZE
637 #define HCI_CMD_BUF_SIZE                BT_SMALL_BUFFER_SIZE
638 #endif
639 
640 /* Sends SDP data packets. */
641 #ifndef SDP_DATA_BUF_SIZE
642 #define SDP_DATA_BUF_SIZE               BT_DEFAULT_BUFFER_SIZE
643 #endif
644 
645 /* Sends RFCOMM command packets. */
646 #ifndef RFCOMM_CMD_BUF_SIZE
647 #define RFCOMM_CMD_BUF_SIZE             BT_SMALL_BUFFER_SIZE
648 #endif
649 
650 /* Sends RFCOMM data packets. */
651 #ifndef RFCOMM_DATA_BUF_SIZE
652 #define RFCOMM_DATA_BUF_SIZE            BT_DEFAULT_BUFFER_SIZE
653 #endif
654 
655 /* Sends L2CAP packets to the peer and HCI messages to the controller. */
656 #ifndef L2CAP_CMD_BUF_SIZE
657 #define L2CAP_CMD_BUF_SIZE              BT_SMALL_BUFFER_SIZE
658 #endif
659 
660 #ifndef L2CAP_USER_TX_BUF_SIZE
661 #define L2CAP_USER_TX_BUF_SIZE          BT_DEFAULT_BUFFER_SIZE
662 #endif
663 
664 #ifndef L2CAP_USER_RX_BUF_SIZE
665 #define L2CAP_USER_RX_BUF_SIZE          BT_DEFAULT_BUFFER_SIZE
666 #endif
667 
668 /* Sends L2CAP segmented packets in ERTM mode */
669 #ifndef L2CAP_FCR_TX_BUF_SIZE
670 #define L2CAP_FCR_TX_BUF_SIZE           BT_DEFAULT_BUFFER_SIZE
671 #endif
672 
673 /* Receives L2CAP segmented packets in ERTM mode */
674 #ifndef L2CAP_FCR_RX_BUF_SIZE
675 #define L2CAP_FCR_RX_BUF_SIZE           BT_DEFAULT_BUFFER_SIZE
676 #endif
677 
678 #ifndef L2CAP_FCR_ERTM_BUF_SIZE
679 #define L2CAP_FCR_ERTM_BUF_SIZE         (10240 + 24)
680 #endif
681 
682 /* Number of ACL buffers to assign to LE
683    if the HCI buffer pool is shared with BR/EDR */
684 #ifndef L2C_DEF_NUM_BLE_BUF_SHARED
685 #define L2C_DEF_NUM_BLE_BUF_SHARED      1
686 #endif
687 
688 /* Used by BTM when it sends HCI commands to the controller. */
689 #ifndef BTM_CMD_BUF_SIZE
690 #define BTM_CMD_BUF_SIZE                BT_SMALL_BUFFER_SIZE
691 #endif
692 
693 #ifndef OBX_LRG_DATA_BUF_SIZE
694 #define OBX_LRG_DATA_BUF_SIZE           (8080 + 26)
695 #endif
696 
697 /* Used to send data to L2CAP. */
698 #ifndef GAP_DATA_BUF_SIZE
699 #define GAP_DATA_BUF_SIZE               BT_DEFAULT_BUFFER_SIZE
700 #endif
701 
702 /* BNEP data and protocol messages. */
703 #ifndef BNEP_BUF_SIZE
704 #define BNEP_BUF_SIZE                   BT_DEFAULT_BUFFER_SIZE
705 #endif
706 
707 /* AVDTP buffer size for protocol messages */
708 #ifndef AVDT_CMD_BUF_SIZE
709 #define AVDT_CMD_BUF_SIZE               BT_SMALL_BUFFER_SIZE
710 #endif
711 
712 /* AVDTP buffer size for media packets in case of fragmentation */
713 #ifndef AVDT_DATA_BUF_SIZE
714 #define AVDT_DATA_BUF_SIZE              BT_DEFAULT_BUFFER_SIZE
715 #endif
716 
717 #ifndef PAN_BUF_SIZE
718 #define PAN_BUF_SIZE                    BT_DEFAULT_BUFFER_SIZE
719 #endif
720 
721 /* Maximum number of buffers to allocate for PAN */
722 #ifndef PAN_BUF_MAX
723 #define PAN_BUF_MAX                     100
724 #endif
725 
726 /* AVCTP buffer size for protocol messages */
727 #ifndef AVCT_CMD_BUF_SIZE
728 #define AVCT_CMD_BUF_SIZE               288
729 #endif
730 
731 /* AVRCP buffer size for protocol messages */
732 #ifndef AVRC_CMD_BUF_SIZE
733 #define AVRC_CMD_BUF_SIZE               288
734 #endif
735 
736 /* AVRCP Metadata buffer size for protocol messages */
737 #ifndef AVRC_META_CMD_BUF_SIZE
738 #define AVRC_META_CMD_BUF_SIZE          BT_SMALL_BUFFER_SIZE
739 #endif
740 
741 #ifndef BTA_HL_LRG_DATA_BUF_SIZE
742 #define BTA_HL_LRG_DATA_BUF_SIZE        (10240 + 24)
743 #endif
744 
745 /* GATT Server Database buffer size */
746 #ifndef GATT_DB_BUF_SIZE
747 #define GATT_DB_BUF_SIZE                128
748 #endif
749 
750 /* GATT Data sending buffer size */
751 #ifndef GATT_DATA_BUF_SIZE
752 #define GATT_DATA_BUF_SIZE              BT_DEFAULT_BUFFER_SIZE
753 #endif
754 
755 /******************************************************************************
756 **
757 ** HCI Services (H4)
758 **
759 ******************************************************************************/
760 
761 /* Use 2 second for low-resolution systems, override to 1 for high-resolution systems */
762 #ifndef BT_1SEC_TIMEOUT
763 #define BT_1SEC_TIMEOUT             (2)
764 #endif
765 
766 /* Quick Timer */
767 /* if L2CAP_FCR_INCLUDED is TRUE then it should have 100 millisecond resolution */
768 /* if none of them is included then QUICK_TIMER_TICKS_PER_SEC is set to 0 to exclude quick timer */
769 #ifndef QUICK_TIMER_TICKS_PER_SEC
770 #define QUICK_TIMER_TICKS_PER_SEC   10       /* 100ms timer */
771 #endif
772 
773 /******************************************************************************
774 **
775 ** BTM
776 **
777 ******************************************************************************/
778 
779 /* Cancel Inquiry on incoming SSP */
780 #ifndef BTM_NO_SSP_ON_INQUIRY
781 #define BTM_NO_SSP_ON_INQUIRY       FALSE
782 #endif
783 
784 /* Includes SCO if TRUE */
785 #ifndef BTM_SCO_INCLUDED
786 #define BTM_SCO_INCLUDED                FALSE       /* TRUE includes SCO code */
787 #endif
788 
789 /* Includes SCO if TRUE */
790 #ifndef BTM_SCO_HCI_INCLUDED
791 #if UC_BT_HFP_AUDIO_DATA_PATH_HCI
792 #define BTM_SCO_HCI_INCLUDED            TRUE       /* TRUE includes SCO over HCI code */
793 #else
794 #define BTM_SCO_HCI_INCLUDED            FALSE
795 #endif /* UC_HFP_AUDIO_DATA_PATH_HCI */
796 #endif
797 
798 /* Includes WBS if TRUE */
799 #ifndef BTM_WBS_INCLUDED
800 #define BTM_WBS_INCLUDED                UC_BT_HFP_WBS_ENABLE    /* TRUE includes WBS code */
801 #endif
802 
803 /*  This is used to work around a controller bug that doesn't like Disconnect
804 **  issued while there is a role switch in progress
805 */
806 #ifndef BTM_DISC_DURING_RS
807 #define BTM_DISC_DURING_RS TRUE
808 #endif
809 
810 /**************************
811 ** Initial SCO TX credit
812 *************************/
813 /* max TX SCO data packet size */
814 #ifndef BTM_SCO_DATA_SIZE_MAX
815 #define BTM_SCO_DATA_SIZE_MAX       120 //240
816 #endif
817 
818 /* max TX eSCO data packet size */
819 #ifndef BTM_MSBC_FRAME_SIZE
820 #define BTM_MSBC_FRAME_SIZE      60
821 #endif
822 
823 /* TX eSCO data packet size */
824 #ifndef BTM_MSBC_FRAME_DATA_SIZE
825 #define BTM_MSBC_FRAME_DATA_SIZE          57
826 #endif
827 
828 /* The size in bytes of the BTM inquiry database. 5 As Default */
829 #ifndef BTM_INQ_DB_SIZE
830 #define BTM_INQ_DB_SIZE             5
831 #endif
832 
833 /* The default scan mode */
834 #ifndef BTM_DEFAULT_SCAN_TYPE
835 #define BTM_DEFAULT_SCAN_TYPE       BTM_SCAN_TYPE_INTERLACED
836 #endif
837 
838 /* Should connections to unknown devices be allowed when not discoverable? */
839 #ifndef BTM_ALLOW_CONN_IF_NONDISCOVER
840 #define BTM_ALLOW_CONN_IF_NONDISCOVER   TRUE
841 #endif
842 
843 /* Sets the Page_Scan_Window:  the length of time that the device is performing a page scan. */
844 #ifndef BTM_DEFAULT_CONN_WINDOW
845 #define BTM_DEFAULT_CONN_WINDOW     0x0012
846 #endif
847 
848 /* Sets the Page_Scan_Activity:  the interval between the start of two consecutive page scans. */
849 #ifndef BTM_DEFAULT_CONN_INTERVAL
850 #define BTM_DEFAULT_CONN_INTERVAL   0x0800
851 #endif
852 
853 /* When automatic inquiry scan is enabled, this sets the inquiry scan window. */
854 #ifndef BTM_DEFAULT_DISC_WINDOW
855 #define BTM_DEFAULT_DISC_WINDOW     0x0012
856 #endif
857 
858 /* When automatic inquiry scan is enabled, this sets the inquiry scan interval. */
859 #ifndef BTM_DEFAULT_DISC_INTERVAL
860 #define BTM_DEFAULT_DISC_INTERVAL   0x0800
861 #endif
862 
863 /*
864 * {SERVICE_CLASS, MAJOR_CLASS, MINOR_CLASS}
865 *
866 * SERVICE_CLASS:0x5A (Bit17 -Networking,Bit19 - Capturing,Bit20 -Object Transfer,Bit22 -Telephony)
867 * MAJOR_CLASS:0x02 - PHONE
868 * MINOR_CLASS:0x0C - SMART_PHONE
869 *
870 */
871 #define BTA_DM_COD_SMARTPHONE {0x5A, 0x02, 0x0C}
872 
873 /*
874 * {SERVICE_CLASS, MAJOR_CLASS, MINOR_CLASS}
875 *
876 * SERVICE_CLASS:0x2C (Bit21 - Audio, Bit19 - Capturing)
877 * MAJOR_CLASS:0x04 - Audio/Video
878 * MINOR_CLASS:0x05 - LoudSpeaker
879 */
880 #define BTA_DM_COD_LOUDSPEAKER {0x2C, 0x04, 0x14}
881 
882 /*
883 * {SERVICE_CLASS, MAJOR_CLASS, MINOR_CLASS}
884 *
885 * SERVICE_CLASS:0x00 None
886 * MAJOR_CLASS:0x1f - Uncategorized: device code not specified
887 * MINOR_CLASS:0x00 - None
888 */
889 #define BTA_DM_COD_UNCLASSIFIED {0x00, 0x1f, 0x00}
890 
891 /* Default class of device */
892 #ifndef BTA_DM_COD
893 #define BTA_DM_COD BTA_DM_COD_UNCLASSIFIED
894 #endif
895 
896 /* The number of SCO links. */
897 #ifndef BTM_MAX_SCO_LINKS
898 #define BTM_MAX_SCO_LINKS           0	//3
899 #endif
900 
901 /* The preferred type of SCO links (2-eSCO, 0-SCO). */
902 #ifndef BTM_DEFAULT_SCO_MODE
903 #define BTM_DEFAULT_SCO_MODE        2
904 #endif
905 
906 /* The number of security records for peer devices. 15 AS Default*/
907 #ifndef BTM_SEC_MAX_DEVICE_RECORDS
908 #define BTM_SEC_MAX_DEVICE_RECORDS  UC_BT_SMP_MAX_BONDS
909 #endif
910 
911 /* The number of security records for services. 32 AS Default*/
912 #ifndef BTM_SEC_MAX_SERVICE_RECORDS
913 #define BTM_SEC_MAX_SERVICE_RECORDS 8 // 32
914 #endif
915 
916 /* If True, force a retrieval of remote device name for each bond in case it's changed */
917 #ifndef BTM_SEC_FORCE_RNR_FOR_DBOND
918 #define BTM_SEC_FORCE_RNR_FOR_DBOND  FALSE
919 #endif
920 
921 /* Maximum device name length used in btm database. Up to 248*/
922 #ifndef BTM_MAX_REM_BD_NAME_LEN
923 #define BTM_MAX_REM_BD_NAME_LEN     64
924 #endif
925 
926 /* Maximum local device name length stored btm database.
927   '0' disables storage of the local name in BTM */
928 #if UC_MAX_LOC_BD_NAME_LEN
929 #define BTM_MAX_LOC_BD_NAME_LEN     UC_MAX_LOC_BD_NAME_LEN
930 #define BTC_MAX_LOC_BD_NAME_LEN     BTM_MAX_LOC_BD_NAME_LEN
931 #else
932 #define BTM_MAX_LOC_BD_NAME_LEN     64
933 #define BTC_MAX_LOC_BD_NAME_LEN     BTM_MAX_LOC_BD_NAME_LEN
934 #endif
935 
936 /* Fixed Default String. When this is defined as null string, the device's
937  * product model name is used as the default local name.
938  */
939 #ifndef BTM_DEF_LOCAL_NAME
940 #define BTM_DEF_LOCAL_NAME      ""
941 #endif
942 
943 /* Maximum service name stored with security authorization (0 if not needed) */
944 #ifndef BTM_SEC_SERVICE_NAME_LEN
945 #define BTM_SEC_SERVICE_NAME_LEN    BT_MAX_SERVICE_NAME_LEN
946 #endif
947 
948 /* Maximum length of the service name. */
949 #ifndef BT_MAX_SERVICE_NAME_LEN
950 #define BT_MAX_SERVICE_NAME_LEN     21
951 #endif
952 
953 /* ACL buffer size in HCI Host Buffer Size command. */
954 #ifndef BTM_ACL_BUF_SIZE
955 #define BTM_ACL_BUF_SIZE            0
956 #endif
957 
958 /* The maximum number of clients that can register with the power manager. */
959 #ifndef BTM_MAX_PM_RECORDS
960 #define BTM_MAX_PM_RECORDS          2
961 #endif
962 
963 /* This is set to show debug trace messages for the power manager. */
964 #ifndef BTM_PM_DEBUG
965 #define BTM_PM_DEBUG                FALSE
966 #endif
967 
968 /* This is set to TRUE if link is to be unparked due to BTM_CreateSCO API. */
969 #ifndef BTM_SCO_WAKE_PARKED_LINK
970 #define BTM_SCO_WAKE_PARKED_LINK    FALSE
971 #endif
972 
973 /* If the user does not respond to security process requests within this many seconds,
974  * a negative response would be sent automatically.
975  * 30 is LMP response timeout value */
976 #ifndef BTM_SEC_TIMEOUT_VALUE
977 #define BTM_SEC_TIMEOUT_VALUE           35
978 #endif
979 
980 /* Maximum number of callbacks that can be registered using BTM_RegisterForVSEvents */
981 #ifndef BTM_MAX_VSE_CALLBACKS
982 #define BTM_MAX_VSE_CALLBACKS           3
983 #endif
984 
985 /******************************************
986 **    Lisbon Features
987 *******************************************/
988 /* This is set to TRUE if the FEC is required for EIR packet. */
989 #ifndef BTM_EIR_DEFAULT_FEC_REQUIRED
990 #define BTM_EIR_DEFAULT_FEC_REQUIRED    TRUE
991 #endif
992 
993 /* The IO capability of the local device (for Simple Pairing) */
994 #ifndef BTM_LOCAL_IO_CAPS
995 #define BTM_LOCAL_IO_CAPS               BTM_IO_CAP_NONE
996 #endif
997 
998 #ifndef BTM_LOCAL_IO_CAPS_BLE
999 #if (BLE_INCLUDED == TRUE && SMP_INCLUDED == TRUE)
1000 #define BTM_LOCAL_IO_CAPS_BLE           BTM_IO_CAP_KBDISP
1001 #else
1002 #define BTM_LOCAL_IO_CAPS_BLE           4
1003 #endif  ///BLE_INCLUDED == TRUE && SMP_INCLUDED == TRUE
1004 #endif
1005 
1006 /* The default MITM Protection Requirement (for Simple Pairing)
1007  * Possible values are BTM_AUTH_SP_YES or BTM_AUTH_SP_NO */
1008 #ifndef BTM_DEFAULT_AUTH_REQ
1009 #define BTM_DEFAULT_AUTH_REQ            BTM_AUTH_SP_NO
1010 #endif
1011 
1012 /* The default MITM Protection Requirement for dedicated bonding using Simple Pairing
1013  * Possible values are BTM_AUTH_AP_YES or BTM_AUTH_AP_NO */
1014 #ifndef BTM_DEFAULT_DD_AUTH_REQ
1015 #define BTM_DEFAULT_DD_AUTH_REQ            BTM_AUTH_AP_YES
1016 #endif
1017 
1018 /* Include Out-of-Band implementation for Simple Pairing */
1019 #ifndef BTM_OOB_INCLUDED
1020 #define BTM_OOB_INCLUDED                TRUE
1021 #endif
1022 
1023 /* TRUE to include Sniff Subrating */
1024 #if (BTA_DM_PM_INCLUDED == TRUE)
1025 #ifndef BTM_SSR_INCLUDED
1026 #define BTM_SSR_INCLUDED                FALSE
1027 #endif
1028 #endif /* BTA_DM_PM_INCLUDED */
1029 
1030 /*************************
1031 ** End of Lisbon Features
1032 **************************/
1033 
1034 /* 4.1/4.2 secure connections feature */
1035 #ifndef SC_MODE_INCLUDED
1036 // Disable AES-CCM (BT 4.1) for BT Classic to workaround controller AES issue. E0 encryption (BT 4.0) will be used.
1037 #define SC_MODE_INCLUDED                FALSE
1038 #endif
1039 
1040 /* Used for conformance testing ONLY */
1041 #ifndef BTM_BLE_CONFORMANCE_TESTING
1042 #define BTM_BLE_CONFORMANCE_TESTING           FALSE
1043 #endif
1044 
1045 /******************************************************************************
1046 **
1047 ** CONTROLLER TO HOST FLOW CONTROL
1048 **
1049 ******************************************************************************/
1050 
1051 #define C2H_FLOW_CONTROL_INCLUDED TRUE
1052 
1053 /******************************************************************************
1054 **
1055 ** L2CAP
1056 **
1057 ******************************************************************************/
1058 
1059 #ifndef L2CAP_CLIENT_INCLUDED
1060 #define L2CAP_CLIENT_INCLUDED FALSE
1061 #endif
1062 
1063 /* The maximum number of simultaneous applications that can register with LE L2CAP. */
1064 #ifndef BLE_MAX_L2CAP_CLIENTS
1065 #define BLE_MAX_L2CAP_CLIENTS           15
1066 #endif
1067 
1068 /* Support status of L2CAP connection-oriented dynamic channels over LE transport with dynamic CID */
1069 #ifndef BLE_L2CAP_COC_INCLUDED
1070 #define BLE_L2CAP_COC_INCLUDED          FALSE // LE COC not use by default
1071 #endif
1072 
1073 /* Support status of L2CAP connection-oriented dynamic channels over LE or BR/EDR transport with dynamic CID */
1074 #ifndef L2CAP_COC_INCLUDED
1075 #if (CLASSIC_BT_INCLUDED == TRUE || BLE_L2CAP_COC_INCLUDED == TRUE)
1076 #define L2CAP_COC_INCLUDED              TRUE
1077 #else
1078 #define L2CAP_COC_INCLUDED              FALSE
1079 #endif
1080 #endif
1081 
1082 /* The maximum number of simultaneous links that L2CAP can support. Up to 7*/
1083 #ifndef MAX_ACL_CONNECTIONS
1084 #define MAX_L2CAP_LINKS             5
1085 #else
1086 #define MAX_L2CAP_LINKS             MAX_ACL_CONNECTIONS
1087 #endif
1088 
1089 /* The maximum number of simultaneous channels that L2CAP can support. Up to 16*/
1090 #ifndef MAX_L2CAP_CHANNELS
1091 #if (CLASSIC_BT_INCLUDED == TRUE)
1092 #define MAX_L2CAP_CHANNELS          16
1093 #else
1094 #if (SMP_INCLUDED == FALSE)
1095 #define MAX_L2CAP_CHANNELS          MAX_ACL_CONNECTIONS  //This is used in the BLE client when start connected with the peer device
1096 #else
1097 #define MAX_L2CAP_CHANNELS          (MAX_ACL_CONNECTIONS * 2)  //This is used in the BLE client when start connected with the peer device and in SMP
1098 #endif   ///SMP_INCLUDED == FALSE
1099 #endif   ///CLASSIC_BT_INCLUDED == TRUE
1100 #endif   ///MAX_L2CAP_CHANNELS
1101 
1102 /* The maximum number of simultaneous applications that can register with L2CAP. */
1103 #ifndef MAX_L2CAP_CLIENTS
1104 #if (CLASSIC_BT_INCLUDED == TRUE)
1105 #define MAX_L2CAP_CLIENTS           8
1106 #else
1107 #define MAX_L2CAP_CLIENTS           1  //Not support to allocate a channel control block in BLE only mode
1108 #endif  ///CLASSIC_BT_INCLUDED == TRUE
1109 #endif
1110 
1111 /* The number of seconds of link inactivity before a link is disconnected. */
1112 #ifndef L2CAP_LINK_INACTIVITY_TOUT
1113 #define L2CAP_LINK_INACTIVITY_TOUT  4
1114 #endif
1115 
1116 /* The number of seconds of link inactivity after bonding before a link is disconnected. */
1117 #ifndef L2CAP_BONDING_TIMEOUT
1118 #define L2CAP_BONDING_TIMEOUT       3
1119 #endif
1120 
1121 /* The time from the HCI connection complete to disconnect if no channel is established. */
1122 #ifndef L2CAP_LINK_STARTUP_TOUT
1123 #define L2CAP_LINK_STARTUP_TOUT     60
1124 #endif
1125 
1126 /* The L2CAP MTU; must be in accord with the HCI ACL pool size. */
1127 #ifndef L2CAP_MTU_SIZE
1128 #define L2CAP_MTU_SIZE              1691
1129 #endif
1130 
1131 /* The L2CAP MPS over Bluetooth; must be in accord with the FCR tx pool size and ACL down buffer size. */
1132 #ifndef L2CAP_MPS_OVER_BR_EDR
1133 #define L2CAP_MPS_OVER_BR_EDR       1010
1134 #endif
1135 
1136 /* If host flow control enabled, this is the number of buffers the controller can have unacknowledged. */
1137 #ifndef L2CAP_HOST_FC_ACL_BUFS
1138 #define L2CAP_HOST_FC_ACL_BUFS      20
1139 #endif
1140 
1141 /* This is set to enable L2CAP to  take the ACL link out of park mode when ACL data is to be sent. */
1142 #ifndef L2CAP_WAKE_PARKED_LINK
1143 #define L2CAP_WAKE_PARKED_LINK      TRUE
1144 #endif
1145 
1146 /* Whether link wants to be the master or the slave. */
1147 #ifndef L2CAP_DESIRED_LINK_ROLE
1148 #define L2CAP_DESIRED_LINK_ROLE     HCI_ROLE_SLAVE
1149 #endif
1150 
1151 /* Include Non-Flushable Packet Boundary Flag feature of Lisbon */
1152 #ifndef L2CAP_NON_FLUSHABLE_PB_INCLUDED
1153 #define L2CAP_NON_FLUSHABLE_PB_INCLUDED     TRUE
1154 #endif
1155 
1156 /* Minimum number of ACL credit for high priority link */
1157 #ifndef L2CAP_HIGH_PRI_MIN_XMIT_QUOTA
1158 #define L2CAP_HIGH_PRI_MIN_XMIT_QUOTA       5
1159 #endif
1160 
1161 /* used for monitoring HCI ACL credit management */
1162 #ifndef L2CAP_HCI_FLOW_CONTROL_DEBUG
1163 #define L2CAP_HCI_FLOW_CONTROL_DEBUG        TRUE
1164 #endif
1165 
1166 /* Used for calculating transmit buffers off of */
1167 #ifndef L2CAP_NUM_XMIT_BUFFS
1168 #define L2CAP_NUM_XMIT_BUFFS                HCI_ACL_BUF_MAX
1169 #endif
1170 
1171 /* Unicast Connectionless Data */
1172 #ifndef L2CAP_UCD_INCLUDED
1173 #define L2CAP_UCD_INCLUDED                  FALSE
1174 #endif
1175 
1176 /* Unicast Connectionless Data MTU */
1177 #ifndef L2CAP_UCD_MTU
1178 #define L2CAP_UCD_MTU                       L2CAP_MTU_SIZE
1179 #endif
1180 
1181 /* Unicast Connectionless Data Idle Timeout */
1182 #ifndef L2CAP_UCD_IDLE_TIMEOUT
1183 #define L2CAP_UCD_IDLE_TIMEOUT              2
1184 #endif
1185 
1186 /* Unicast Connectionless Data Idle Timeout */
1187 #ifndef L2CAP_UCD_CH_PRIORITY
1188 #define L2CAP_UCD_CH_PRIORITY               L2CAP_CHNL_PRIORITY_MEDIUM
1189 #endif
1190 
1191 /* Used for features using fixed channels; set to zero if no fixed channels supported (BLE, etc.) */
1192 /* Excluding L2CAP signaling channel and UCD */
1193 #ifndef L2CAP_NUM_FIXED_CHNLS
1194 #if (CLASSIC_BT_INCLUDED == TRUE)
1195 #define L2CAP_NUM_FIXED_CHNLS               32
1196 #else
1197 #define L2CAP_NUM_FIXED_CHNLS               3   //There are just three fix channel in the BLE only mode(gatt,signal,smp)
1198 #endif  ///CLASSIC_BT_INCLUDED == TRUE
1199 #endif
1200 
1201 /* First fixed channel supported */
1202 #ifndef L2CAP_FIRST_FIXED_CHNL
1203 #define L2CAP_FIRST_FIXED_CHNL              4
1204 #endif
1205 
1206 #ifndef L2CAP_LAST_FIXED_CHNL
1207 #define L2CAP_LAST_FIXED_CHNL           (L2CAP_FIRST_FIXED_CHNL + L2CAP_NUM_FIXED_CHNLS - 1)
1208 #endif
1209 
1210 /* Round Robin service channels in link */
1211 #ifndef L2CAP_ROUND_ROBIN_CHANNEL_SERVICE
1212 #define L2CAP_ROUND_ROBIN_CHANNEL_SERVICE   TRUE
1213 #endif
1214 
1215 /* Used for calculating transmit buffers off of */
1216 #ifndef L2CAP_NUM_XMIT_BUFFS
1217 #define L2CAP_NUM_XMIT_BUFFS                HCI_ACL_BUF_MAX
1218 #endif
1219 
1220 /* used for monitoring eL2CAP data flow */
1221 #ifndef L2CAP_ERTM_STATS
1222 #define L2CAP_ERTM_STATS                    FALSE
1223 #endif
1224 
1225 /* Used for conformance testing ONLY:  When TRUE lets scriptwrapper overwrite info response */
1226 #ifndef L2CAP_CONFORMANCE_TESTING
1227 #define L2CAP_CONFORMANCE_TESTING           FALSE
1228 #endif
1229 
1230 /*
1231  * Max bytes per connection to buffer locally before dropping the
1232  * connection if local client does not receive it  - default is 1MB
1233  */
1234 #ifndef L2CAP_MAX_RX_BUFFER
1235 #define L2CAP_MAX_RX_BUFFER                 0x100000
1236 #endif
1237 
1238 
1239 #ifndef TIMER_PARAM_TYPE
1240 #define TIMER_PARAM_TYPE    UINT32
1241 #endif
1242 
1243 /******************************************************************************
1244 **
1245 ** BLE
1246 **
1247 ******************************************************************************/
1248 
1249 #ifndef BLE_INCLUDED
1250 #define BLE_INCLUDED            FALSE
1251 #endif
1252 
1253 #ifndef BLE_ANDROID_CONTROLLER_SCAN_FILTER
1254 #define BLE_ANDROID_CONTROLLER_SCAN_FILTER            TRUE
1255 #endif
1256 
1257 #ifndef LOCAL_BLE_CONTROLLER_ID
1258 #define LOCAL_BLE_CONTROLLER_ID         (1)
1259 #endif
1260 
1261 /*
1262  * Toggles support for general LE privacy features such as remote address
1263  * resolution, local address rotation etc.
1264  */
1265 #ifndef BLE_PRIVACY_SPT
1266 #define BLE_PRIVACY_SPT         FALSE
1267 #endif
1268 
1269 /*
1270  * Enables or disables support for local privacy (ex. address rotation)
1271  */
1272 #ifndef BLE_LOCAL_PRIVACY_ENABLED
1273 #define BLE_LOCAL_PRIVACY_ENABLED         TRUE
1274 #endif
1275 
1276 /*
1277  * Toggles support for vendor specific extensions such as RPA offloading,
1278  * feature discovery, multi-adv etc.
1279  */
1280 #ifndef BLE_VND_INCLUDED
1281 #define BLE_VND_INCLUDED        FALSE
1282 #endif
1283 
1284 #ifndef BTM_BLE_ADV_TX_POWER
1285 #ifdef CONFIG_IDF_TARGET_ESP32
1286 #define BTM_BLE_ADV_TX_POWER {-12, -9, -6, -3, 0, 3, 6, 9}
1287 #else
1288 #define BTM_BLE_ADV_TX_POWER {-24, -21, -18, -15, -12, -9, -6, -3, 0, 3, 6, 9, 12, 15, 18, 20}
1289 #endif
1290 #endif
1291 
1292 #ifndef BTM_TX_POWER
1293 #ifdef CONFIG_IDF_TARGET_ESP32
1294 #define BTM_TX_POWER {-12, -9, -6, -3, 0, 3, 6, 9}
1295 #else
1296 #define BTM_TX_POWER {-24, -21, -18, -15, -12, -9, -6, -3, 0, 3, 6, 9, 12, 15, 18, 20}
1297 #endif
1298 #endif
1299 
1300 #ifndef BTM_TX_POWER_LEVEL_MAX
1301 #ifdef CONFIG_IDF_TARGET_ESP32
1302 #define BTM_TX_POWER_LEVEL_MAX 7
1303 #else
1304 #define BTM_TX_POWER_LEVEL_MAX 15
1305 #endif
1306 #endif
1307 
1308 
1309 #ifndef BLE_BATCH_SCAN_INCLUDED
1310 #define BLE_BATCH_SCAN_INCLUDED  TRUE
1311 #endif
1312 
1313 /******************************************************************************
1314 **
1315 ** ATT/GATT Protocol/Profile Settings
1316 **
1317 ******************************************************************************/
1318 #ifndef GATT_INCLUDED
1319 #if BLE_INCLUDED == TRUE
1320 #define GATT_INCLUDED TRUE
1321 #else
1322 #define GATT_INCLUDED FALSE
1323 #endif
1324 #endif
1325 
1326 #ifndef BTA_GATT_INCLUDED
1327 #if BLE_INCLUDED == TRUE
1328 #define BTA_GATT_INCLUDED TRUE
1329 #else
1330 #define BTA_GATT_INCLUDED FALSE
1331 #endif
1332 #endif
1333 
1334 #if BTA_GATT_INCLUDED == TRUE && BLE_INCLUDED == FALSE
1335 #error "can't have GATT without BLE"
1336 #endif
1337 
1338 #ifndef BLE_LLT_INCLUDED
1339 #define BLE_LLT_INCLUDED    TRUE
1340 #endif
1341 
1342 /* Added this marco to fixed the android 7.0 will lead to update connection parameters
1343    collision when the slave sent the HCI_BLE_UPD_LL_CONN_PARAMS comment to the controller
1344    request the master to update connection parameters directly. */
1345 #ifndef BLE_SLAVE_UPD_CONN_PARAMS
1346 #define BLE_SLAVE_UPD_CONN_PARAMS FALSE
1347 #endif
1348 
1349 #ifndef ATT_INCLUDED
1350 #define ATT_INCLUDED         TRUE
1351 #endif
1352 
1353 #ifndef ATT_DEBUG
1354 #define ATT_DEBUG           FALSE
1355 #endif
1356 
1357 #ifndef BLE_PERIPHERAL_MODE_SUPPORT
1358 #define BLE_PERIPHERAL_MODE_SUPPORT  TRUE
1359 #endif
1360 
1361 #ifndef BLE_DELAY_REQUEST_ENC
1362 /* This flag is to work around IPHONE problem, We need to wait for iPhone ready
1363    before send encryption request to iPhone */
1364 #define BLE_DELAY_REQUEST_ENC        FALSE
1365 #endif
1366 
1367 #ifndef GAP_TRANSPORT_SUPPORTED
1368 #define GAP_TRANSPORT_SUPPORTED      GATT_TRANSPORT_LE_BR_EDR
1369 #endif
1370 
1371 #ifndef GATTP_TRANSPORT_SUPPORTED
1372 #define GATTP_TRANSPORT_SUPPORTED    GATT_TRANSPORT_LE_BR_EDR
1373 #endif
1374 
1375 #ifndef GATT_MAX_SR_PROFILES
1376 #define GATT_MAX_SR_PROFILES        UC_CONFIG_BT_GATT_MAX_SR_PROFILES
1377 #endif
1378 
1379 #ifndef GATT_MAX_APPS
1380 #define GATT_MAX_APPS            8 /* MAX is 32 note: 2 apps used internally GATT and GAP */
1381 #endif
1382 
1383 #ifndef GATT_MAX_PHY_CHANNEL
1384 #define GATT_MAX_PHY_CHANNEL        7
1385 #endif
1386 
1387 /* Used for conformance testing ONLY */
1388 #ifndef GATT_CONFORMANCE_TESTING
1389 #define GATT_CONFORMANCE_TESTING           FALSE
1390 #endif
1391 
1392 /* number of background connection device allowance, ideally to be the same as WL size
1393 */
1394 #ifndef GATT_MAX_BG_CONN_DEV
1395 #define GATT_MAX_BG_CONN_DEV        8 /*MAX is 32*/
1396 #endif
1397 
1398 /******************************************************************************
1399 **
1400 ** GATT
1401 **
1402 ******************************************************************************/
1403 #ifndef GATTC_INCLUDED
1404 #if BLE_INCLUDED == TRUE
1405 #define GATTC_INCLUDED         FALSE
1406 #else
1407 #define GATTC_INCLUDED         FALSE
1408 #endif
1409 #endif
1410 
1411 #ifndef GATTS_INCLUDED
1412 #if BLE_INCLUDED == TRUE
1413 #define GATTS_INCLUDED         TRUE
1414 #else
1415 #define GATTS_INCLUDED         FALSE
1416 #endif
1417 #endif
1418 
1419 /******************************************************************************
1420 **
1421 ** SMP
1422 **
1423 ******************************************************************************/
1424 #ifndef SMP_INCLUDED
1425 #if BLE_INCLUDED == TRUE
1426 #define SMP_INCLUDED         FALSE
1427 #else
1428 #define SMP_INCLUDED         FALSE
1429 #endif
1430 #endif
1431 
1432 #ifndef SMP_DEBUG
1433 #define SMP_DEBUG            FALSE
1434 #endif
1435 
1436 #ifndef SMP_DEFAULT_AUTH_REQ
1437 #define SMP_DEFAULT_AUTH_REQ    SMP_AUTH_NB_ENC_ONLY
1438 #endif
1439 
1440 #ifndef SMP_MAX_ENC_KEY_SIZE
1441 #define SMP_MAX_ENC_KEY_SIZE    16
1442 #endif
1443 
1444 #ifndef SMP_MIN_ENC_KEY_SIZE
1445 #define SMP_MIN_ENC_KEY_SIZE    7
1446 #endif
1447 
1448 /* minimum link timeout after SMP pairing is done, leave room for key exchange
1449    and racing condition for the following service connection.
1450    Prefer greater than 0 second, and no less than default inactivity link idle
1451    timer(L2CAP_LINK_INACTIVITY_TOUT) in l2cap) */
1452 #ifndef SMP_LINK_TOUT_MIN
1453 #if (L2CAP_LINK_INACTIVITY_TOUT > 0)
1454 #define SMP_LINK_TOUT_MIN               L2CAP_LINK_INACTIVITY_TOUT
1455 #else
1456 #define SMP_LINK_TOUT_MIN               2
1457 #endif
1458 #endif
1459 
1460 /******************************************************************************
1461 **
1462 ** BT_SSP
1463 **
1464 ******************************************************************************/
1465 #ifndef BT_SSP_INCLUDED
1466 #define BT_SSP_INCLUDED         FALSE
1467 #endif
1468 
1469 #if BT_SSP_INCLUDED == TRUE && CLASSIC_BT_INCLUDED == FALSE
1470 #error "Can't have SSP without CLASSIC BT"
1471 #endif
1472 
1473 /******************************************************************************
1474 **
1475 ** SDP
1476 **
1477 ******************************************************************************/
1478 
1479 #ifndef SDP_INCLUDED
1480 #define SDP_INCLUDED                FALSE
1481 #endif
1482 
1483 #if (SDP_INCLUDED == TRUE) && (BTA_JV_INCLUDED == TRUE) && (BT_CLASSIC_BQB_INCLUDED == TRUE)
1484 #define BT_SDP_BQB_INCLUDED         TRUE
1485 #else
1486 #define BT_SDP_BQB_INCLUDED         FALSE
1487 #endif
1488 
1489 /* This is set to enable SDP server functionality. */
1490 #ifndef SDP_SERVER_ENABLED
1491 #if SDP_INCLUDED == TRUE
1492 #define SDP_SERVER_ENABLED          TRUE
1493 #else
1494 #define SDP_SERVER_ENABLED          FALSE
1495 #endif
1496 #endif
1497 
1498 /* This is set to enable SDP client functionality. */
1499 #ifndef SDP_CLIENT_ENABLED
1500 #if SDP_INCLUDED == TRUE
1501 #define SDP_CLIENT_ENABLED          TRUE
1502 #else
1503 #define SDP_CLIENT_ENABLED          FALSE
1504 #endif
1505 #endif
1506 
1507 /* The maximum number of SDP records the server can support. */
1508 #ifndef SDP_MAX_RECORDS
1509 #define SDP_MAX_RECORDS             6  /*max is 30*/
1510 #endif
1511 
1512 /* The maximum number of attributes in each record. */
1513 #ifndef SDP_MAX_REC_ATTR
1514 #if (defined(HID_DEV_INCLUDED) && (HID_DEV_INCLUDED==TRUE)) || (defined(BTC_SDP_INCLUDED) && (BTC_SDP_INCLUDED==TRUE))
1515 #define SDP_MAX_REC_ATTR            25
1516 #else
1517 #define SDP_MAX_REC_ATTR            8
1518 #endif /* defined(HID_DEV_INCLUDED) && (HID_DEV_INCLUDED==TRUE) */
1519 #endif
1520 
1521 #ifndef SDP_MAX_PAD_LEN
1522 #define SDP_MAX_PAD_LEN             300
1523 #endif
1524 
1525 /* The maximum length, in bytes, of an attribute. */
1526 #ifndef SDP_MAX_ATTR_LEN
1527 #define SDP_MAX_ATTR_LEN            400
1528 #endif
1529 
1530 /* The maximum number of attribute filters supported by SDP databases. */
1531 #ifndef SDP_MAX_ATTR_FILTERS
1532 #define SDP_MAX_ATTR_FILTERS        15
1533 #endif
1534 
1535 /* The maximum number of UUID filters supported by SDP databases. */
1536 #ifndef SDP_MAX_UUID_FILTERS
1537 #define SDP_MAX_UUID_FILTERS        3
1538 #endif
1539 
1540 /* The maximum number of record handles retrieved in a search. */
1541 #ifndef SDP_MAX_DISC_SERVER_RECS
1542 #define SDP_MAX_DISC_SERVER_RECS    21
1543 #endif
1544 
1545 /* The size of a scratchpad buffer, in bytes, for storing the response to an attribute request. */
1546 #ifndef SDP_MAX_LIST_BYTE_COUNT
1547 #define SDP_MAX_LIST_BYTE_COUNT     4096
1548 #endif
1549 
1550 /* The maximum number of parameters in an SDP protocol element. */
1551 #ifndef SDP_MAX_PROTOCOL_PARAMS
1552 #define SDP_MAX_PROTOCOL_PARAMS     2
1553 #endif
1554 
1555 /* The maximum number of simultaneous client and server connections. */
1556 #ifndef SDP_MAX_CONNECTIONS
1557 #define SDP_MAX_CONNECTIONS         4
1558 #endif
1559 
1560 /* The MTU size for the L2CAP configuration. */
1561 #ifndef SDP_MTU_SIZE
1562 #define SDP_MTU_SIZE                672
1563 #endif
1564 
1565 /* The flush timeout for the L2CAP configuration. */
1566 #ifndef SDP_FLUSH_TO
1567 #define SDP_FLUSH_TO                0xFFFF
1568 #endif
1569 
1570 /* The name for security authorization. */
1571 #ifndef SDP_SERVICE_NAME
1572 #define SDP_SERVICE_NAME            "Service Discovery"
1573 #endif
1574 
1575 /* The security level for BTM. */
1576 #ifndef SDP_SECURITY_LEVEL
1577 #define SDP_SECURITY_LEVEL          BTM_SEC_NONE
1578 #endif
1579 
1580 /******************************************************************************
1581 **
1582 ** RFCOMM
1583 **
1584 ******************************************************************************/
1585 #ifndef RFCOMM_INCLUDED
1586 #define RFCOMM_INCLUDED             FALSE
1587 #endif
1588 
1589 #if (RFCOMM_INCLUDED == TRUE) && (BT_CLASSIC_BQB_INCLUDED == TRUE)
1590 #define BT_RFCOMM_BQB_INCLUDED      TRUE
1591 #else
1592 #define BT_RFCOMM_BQB_INCLUDED      FALSE
1593 #endif
1594 
1595 #ifndef BTA_JV_RFCOMM_INCLUDED
1596 #define BTA_JV_RFCOMM_INCLUDED      FALSE
1597 #endif
1598 
1599 /* The maximum number of ports supported. */
1600 #ifndef MAX_RFC_PORTS
1601 #define MAX_RFC_PORTS               8 /*max is 30*/
1602 #endif
1603 
1604 /* The maximum simultaneous links to different devices. */
1605 #ifndef MAX_ACL_CONNECTIONS
1606 #define MAX_BD_CONNECTIONS          3 /*max is 7*/
1607 #else
1608 #define MAX_BD_CONNECTIONS          MAX_ACL_CONNECTIONS
1609 #endif
1610 
1611 /* The port receive queue low watermark level, in bytes. */
1612 #ifndef PORT_RX_LOW_WM
1613 #define PORT_RX_LOW_WM              (BTA_RFC_MTU_SIZE * PORT_RX_BUF_LOW_WM)
1614 #endif
1615 
1616 /* The port receive queue high watermark level, in bytes. */
1617 #ifndef PORT_RX_HIGH_WM
1618 #define PORT_RX_HIGH_WM             (BTA_RFC_MTU_SIZE * PORT_RX_BUF_HIGH_WM)
1619 #endif
1620 
1621 /* The port receive queue critical watermark level, in bytes. */
1622 #ifndef PORT_RX_CRITICAL_WM
1623 #define PORT_RX_CRITICAL_WM         (BTA_RFC_MTU_SIZE * PORT_RX_BUF_CRITICAL_WM)
1624 #endif
1625 
1626 /* The port receive queue low watermark level, in number of buffers. */
1627 #ifndef PORT_RX_BUF_LOW_WM
1628 #define PORT_RX_BUF_LOW_WM          4
1629 #endif
1630 
1631 /* The port receive queue high watermark level, in number of buffers. */
1632 #ifndef PORT_RX_BUF_HIGH_WM
1633 #define PORT_RX_BUF_HIGH_WM         10
1634 #endif
1635 
1636 /* The port receive queue critical watermark level, in number of buffers. */
1637 #ifndef PORT_RX_BUF_CRITICAL_WM
1638 #define PORT_RX_BUF_CRITICAL_WM     15
1639 #endif
1640 
1641 /* The port transmit queue high watermark level, in bytes. */
1642 #ifndef PORT_TX_HIGH_WM
1643 #define PORT_TX_HIGH_WM             (BTA_RFC_MTU_SIZE * PORT_TX_BUF_HIGH_WM)
1644 #endif
1645 
1646 /* The port transmit queue critical watermark level, in bytes. */
1647 #ifndef PORT_TX_CRITICAL_WM
1648 #define PORT_TX_CRITICAL_WM         (BTA_RFC_MTU_SIZE * PORT_TX_BUF_CRITICAL_WM)
1649 #endif
1650 
1651 /* The port transmit queue high watermark level, in number of buffers. */
1652 #ifndef PORT_TX_BUF_HIGH_WM
1653 #define PORT_TX_BUF_HIGH_WM         10
1654 #endif
1655 
1656 /* The port transmit queue high watermark level, in number of buffers. */
1657 #ifndef PORT_TX_BUF_CRITICAL_WM
1658 #define PORT_TX_BUF_CRITICAL_WM     15
1659 #endif
1660 
1661 /* The RFCOMM multiplexer preferred flow control mechanism. */
1662 #ifndef PORT_FC_DEFAULT
1663 #define PORT_FC_DEFAULT             PORT_FC_CREDIT
1664 #endif
1665 
1666 /* The maximum number of credits receiver sends to peer when using credit-based flow control. */
1667 #ifndef PORT_CREDIT_RX_MAX
1668 #define PORT_CREDIT_RX_MAX          16
1669 #endif
1670 
1671 /* The credit low watermark level. */
1672 #ifndef PORT_CREDIT_RX_LOW
1673 #define PORT_CREDIT_RX_LOW          8
1674 #endif
1675 
1676 /* ERTM Tx window size */
1677 #ifndef RFC_FCR_OPT_TX_WINDOW_SIZE
1678 #define RFC_FCR_OPT_TX_WINDOW_SIZE  10
1679 #endif
1680 
1681 /* ERTM Maximum transmissions before disconnecting */
1682 #ifndef RFC_FCR_OPT_MAX_TX_B4_DISCNT
1683 #define RFC_FCR_OPT_MAX_TX_B4_DISCNT 20
1684 #endif
1685 
1686 /* ERTM Retransmission timeout (2 secs) */
1687 #ifndef RFC_FCR_OPT_RETX_TOUT
1688 #define RFC_FCR_OPT_RETX_TOUT        2000
1689 #endif
1690 
1691 /* ERTM Monitor timeout (12 secs) */
1692 #ifndef RFC_FCR_OPT_MONITOR_TOUT
1693 #define RFC_FCR_OPT_MONITOR_TOUT     12000
1694 #endif
1695 
1696 /* ERTM ERTM MPS segment size */
1697 #ifndef RFC_FCR_OPT_MAX_PDU_SIZE
1698 #define RFC_FCR_OPT_MAX_PDU_SIZE     1010
1699 #endif
1700 
1701 /******************************************************************************
1702 **
1703 ** OBEX
1704 **
1705 ******************************************************************************/
1706 
1707 /*
1708  * Buffer size to reassemble the SDU.
1709  * It will allow buffers to be used that are larger than the L2CAP_MAX_MTU.
1710  */
1711 #ifndef OBX_USER_RX_BUF_SIZE
1712 #define OBX_USER_RX_BUF_SIZE    OBX_LRG_DATA_BUF_SIZE
1713 #endif
1714 
1715 /*
1716  * Buffer size to hold the SDU.
1717  * It will allow buffers to be used that are larger than the L2CAP_MAX_MTU.
1718  */
1719 #ifndef OBX_USER_TX_BUF_SIZE
1720 #define OBX_USER_TX_BUF_SIZE    OBX_LRG_DATA_BUF_SIZE
1721 #endif
1722 
1723 /* Buffer size used to hold MPS segments during SDU reassembly. */
1724 #ifndef OBX_FCR_RX_BUF_SIZE
1725 #define OBX_FCR_RX_BUF_SIZE     BT_DEFAULT_BUFFER_SIZE
1726 #endif
1727 
1728 /*
1729  * Buffer size used to hold MPS segments used in (re)transmissions.
1730  * The size of each buffer must be able to hold the maximum MPS segment size
1731  * passed in L2CA_SetFCROptions plus BT_HDR (8) + HCI preamble (4) +
1732  * L2CAP_MIN_OFFSET (11 - as of BT 2.1 + EDR Spec).
1733  */
1734 #ifndef OBX_FCR_TX_BUF_SIZE
1735 #define OBX_FCR_TX_BUF_SIZE     BT_DEFAULT_BUFFER_SIZE
1736 #endif
1737 
1738 /*
1739  * Size of the transmission window when using enhanced retransmission mode. Not used
1740  * in basic and streaming modes. Range: 1 - 63
1741  */
1742 #ifndef OBX_FCR_OPT_TX_WINDOW_SIZE_BR_EDR
1743 #define OBX_FCR_OPT_TX_WINDOW_SIZE_BR_EDR       20
1744 #endif
1745 
1746 /*
1747  * Number of transmission attempts for a single I-Frame before taking
1748  * Down the connection. Used In ERTM mode only. Value is Ignored in basic and
1749  * Streaming modes.
1750  * Range: 0, 1-0xFF
1751  * 0 - infinite retransmissions
1752  * 1 - single transmission
1753  */
1754 #ifndef OBX_FCR_OPT_MAX_TX_B4_DISCNT
1755 #define OBX_FCR_OPT_MAX_TX_B4_DISCNT    20
1756 #endif
1757 
1758 /*
1759  * Retransmission Timeout
1760  * Range: Minimum 2000 (2 secs) on BR/EDR when supporting PBF.
1761  */
1762 #ifndef OBX_FCR_OPT_RETX_TOUT
1763 #define OBX_FCR_OPT_RETX_TOUT           2000
1764 #endif
1765 
1766 /*
1767  * Monitor Timeout
1768  * Range: Minimum 12000 (12 secs) on BR/EDR when supporting PBF.
1769  */
1770 #ifndef OBX_FCR_OPT_MONITOR_TOUT
1771 #define OBX_FCR_OPT_MONITOR_TOUT        12000
1772 #endif
1773 
1774 /*
1775  * Maximum PDU payload size.
1776  * Suggestion: The maximum amount of data that will fit into a 3-DH5 packet.
1777  * Range: 2 octets
1778 */
1779 #ifndef OBX_FCR_OPT_MAX_PDU_SIZE
1780 #define OBX_FCR_OPT_MAX_PDU_SIZE        L2CAP_MPS_OVER_BR_EDR
1781 #endif
1782 
1783 /*
1784  * Pool ID where to reassemble the SDU.
1785  * This Pool will allow buffers to be used that are larger than
1786  * the L2CAP_MAX_MTU.
1787  */
1788 #ifndef OBX_USER_RX_POOL_ID
1789 #define OBX_USER_RX_POOL_ID              4
1790 #endif
1791 
1792 /*
1793  * Pool ID where to hold the SDU.
1794  * This Pool will allow buffers to be used that are larger than
1795  * the L2CAP_MAX_MTU.
1796  */
1797 #ifndef OBX_USER_TX_POOL_ID
1798 #define OBX_USER_TX_POOL_ID              4
1799 #endif
1800 
1801 /*
1802  * GKI Buffer Pool ID used to hold MPS segments during SDU reassembly
1803  */
1804 #ifndef OBX_FCR_RX_POOL_ID
1805 #define OBX_FCR_RX_POOL_ID                3
1806 #endif
1807 
1808 /*
1809  * Pool ID used to hold MPS segments used in (re)transmissions.
1810  * L2CAP_DEFAULT_ERM_POOL_ID is specified to use the HCI ACL data pool.
1811  * Note:  This pool needs to have enough buffers to hold two times the window size negotiated
1812  * in the L2CA_SetFCROptions (2 * tx_win_size)  to allow for retransmissions.
1813  * The size of each buffer must be able to hold the maximum MPS segment size passed in
1814  * L2CA_SetFCROptions plus BT_HDR (8) + HCI preamble (4) + L2CAP_MIN_OFFSET (11 - as of BT 2.1 + EDR Spec).
1815  */
1816 #ifndef OBX_FCR_TX_POOL_ID
1817 #define OBX_FCR_TX_POOL_ID                3
1818 #endif
1819 
1820 
1821 /******************************************************************************
1822 **
1823 ** BNEP
1824 **
1825 ******************************************************************************/
1826 
1827 #ifndef BNEP_INCLUDED
1828 #define BNEP_INCLUDED               FALSE
1829 #endif
1830 
1831 /* BNEP status API call is used mainly to get the L2CAP handle */
1832 #ifndef BNEP_SUPPORTS_STATUS_API
1833 #define BNEP_SUPPORTS_STATUS_API            FALSE
1834 #endif
1835 
1836 /*
1837 ** When BNEP connection changes roles after the connection is established
1838 ** we will do an authentication check again on the new role
1839 */
1840 #ifndef BNEP_DO_AUTH_FOR_ROLE_SWITCH
1841 #define BNEP_DO_AUTH_FOR_ROLE_SWITCH        FALSE
1842 #endif
1843 
1844 
1845 /* Maximum number of protocol filters supported. */
1846 #ifndef BNEP_MAX_PROT_FILTERS
1847 #define BNEP_MAX_PROT_FILTERS       5
1848 #endif
1849 
1850 /* Maximum number of multicast filters supported. */
1851 #ifndef BNEP_MAX_MULTI_FILTERS
1852 #define BNEP_MAX_MULTI_FILTERS      5
1853 #endif
1854 
1855 /* Minimum MTU size. */
1856 #ifndef BNEP_MIN_MTU_SIZE
1857 #define BNEP_MIN_MTU_SIZE           L2CAP_MTU_SIZE
1858 #endif
1859 
1860 /* Preferred MTU size. */
1861 #ifndef BNEP_MTU_SIZE
1862 #define BNEP_MTU_SIZE               BNEP_MIN_MTU_SIZE
1863 #endif
1864 
1865 /* Maximum number of buffers allowed in transmit data queue. */
1866 #ifndef BNEP_MAX_XMITQ_DEPTH
1867 #define BNEP_MAX_XMITQ_DEPTH        20
1868 #endif
1869 
1870 /* Maximum number BNEP of connections supported. */
1871 #ifndef BNEP_MAX_CONNECTIONS
1872 #define BNEP_MAX_CONNECTIONS        7
1873 #endif
1874 
1875 
1876 /******************************************************************************
1877 **
1878 ** AVDTP
1879 **
1880 ******************************************************************************/
1881 
1882 #ifndef AVDT_INCLUDED
1883 #define AVDT_INCLUDED               TRUE
1884 #endif
1885 
1886 /* Include reporting capability in AVDTP */
1887 #ifndef AVDT_REPORTING
1888 #define AVDT_REPORTING              TRUE
1889 #endif
1890 
1891 /* Include multiplexing capability in AVDTP */
1892 #ifndef AVDT_MULTIPLEXING
1893 #define AVDT_MULTIPLEXING           TRUE
1894 #endif
1895 
1896 /* Number of simultaneous links to different peer devices. */
1897 #ifndef AVDT_NUM_LINKS
1898 #define AVDT_NUM_LINKS              2
1899 #endif
1900 
1901 /* Number of simultaneous stream endpoints. */
1902 #ifndef AVDT_NUM_SEPS
1903 #define AVDT_NUM_SEPS               3
1904 #endif
1905 
1906 /* Number of transport channels setup per media stream(audio or video) */
1907 #ifndef AVDT_NUM_CHANNELS
1908 
1909 #if AVDT_REPORTING == TRUE
1910 /* signaling, media and reporting channels */
1911 #define AVDT_NUM_CHANNELS   3
1912 #else
1913 /* signaling and media channels */
1914 #define AVDT_NUM_CHANNELS   2
1915 #endif  // AVDT_REPORTING
1916 
1917 #endif  // AVDT_NUM_CHANNELS
1918 
1919 /* Number of transport channels setup by AVDT for all media streams
1920  * AVDT_NUM_CHANNELS * Number of simultaneous streams.
1921  */
1922 #ifndef AVDT_NUM_TC_TBL
1923 #define AVDT_NUM_TC_TBL             6
1924 #endif
1925 
1926 /* Maximum size in bytes of the codec capabilities information element. */
1927 #ifndef AVDT_CODEC_SIZE
1928 #define AVDT_CODEC_SIZE             10
1929 #endif
1930 
1931 /* Maximum size in bytes of the content protection information element. */
1932 #ifndef AVDT_PROTECT_SIZE
1933 #define AVDT_PROTECT_SIZE           90
1934 #endif
1935 
1936 /* Maximum number of GKI buffers in the fragment queue (for video frames).
1937  * Must be less than the number of buffers in the buffer pool of size AVDT_DATA_POOL_SIZE */
1938 #ifndef AVDT_MAX_FRAG_COUNT
1939 #define AVDT_MAX_FRAG_COUNT         15
1940 #endif
1941 
1942 /******************************************************************************
1943 **
1944 ** PAN
1945 **
1946 ******************************************************************************/
1947 
1948 #ifndef PAN_INCLUDED
1949 #define PAN_INCLUDED                     FALSE
1950 #endif
1951 
1952 /* This will enable the PANU role */
1953 #ifndef PAN_SUPPORTS_ROLE_PANU
1954 #define PAN_SUPPORTS_ROLE_PANU              FALSE
1955 #endif
1956 
1957 /* This will enable the GN role */
1958 #ifndef PAN_SUPPORTS_ROLE_GN
1959 #define PAN_SUPPORTS_ROLE_GN                FALSE
1960 #endif
1961 
1962 /* This will enable the NAP role */
1963 #ifndef PAN_SUPPORTS_ROLE_NAP
1964 #define PAN_SUPPORTS_ROLE_NAP               FALSE
1965 #endif
1966 
1967 /* This is just for debugging purposes */
1968 #ifndef PAN_SUPPORTS_DEBUG_DUMP
1969 #define PAN_SUPPORTS_DEBUG_DUMP             FALSE
1970 #endif
1971 
1972 /* Maximum number of PAN connections allowed */
1973 #ifndef MAX_PAN_CONNS
1974 #define MAX_PAN_CONNS                    7
1975 #endif
1976 
1977 /* Default service name for NAP role */
1978 #ifndef PAN_NAP_DEFAULT_SERVICE_NAME
1979 #define PAN_NAP_DEFAULT_SERVICE_NAME    "Network Access Point Service"
1980 #endif
1981 
1982 /* Default service name for GN role */
1983 #ifndef PAN_GN_DEFAULT_SERVICE_NAME
1984 #define PAN_GN_DEFAULT_SERVICE_NAME     "Group Network Service"
1985 #endif
1986 
1987 /* Default service name for PANU role */
1988 #ifndef PAN_PANU_DEFAULT_SERVICE_NAME
1989 #define PAN_PANU_DEFAULT_SERVICE_NAME   "PAN User Service"
1990 #endif
1991 
1992 /* Default description for NAP role service */
1993 #ifndef PAN_NAP_DEFAULT_DESCRIPTION
1994 #define PAN_NAP_DEFAULT_DESCRIPTION     "NAP"
1995 #endif
1996 
1997 /* Default description for GN role service */
1998 #ifndef PAN_GN_DEFAULT_DESCRIPTION
1999 #define PAN_GN_DEFAULT_DESCRIPTION      "GN"
2000 #endif
2001 
2002 /* Default description for PANU role service */
2003 #ifndef PAN_PANU_DEFAULT_DESCRIPTION
2004 #define PAN_PANU_DEFAULT_DESCRIPTION    "PANU"
2005 #endif
2006 
2007 /* Default Security level for PANU role. */
2008 #ifndef PAN_PANU_SECURITY_LEVEL
2009 #define PAN_PANU_SECURITY_LEVEL          0
2010 #endif
2011 
2012 /* Default Security level for GN role. */
2013 #ifndef PAN_GN_SECURITY_LEVEL
2014 #define PAN_GN_SECURITY_LEVEL            0
2015 #endif
2016 
2017 /* Default Security level for NAP role. */
2018 #ifndef PAN_NAP_SECURITY_LEVEL
2019 #define PAN_NAP_SECURITY_LEVEL           0
2020 #endif
2021 
2022 /******************************************************************************
2023 **
2024 ** HFP
2025 **
2026 ******************************************************************************/
2027 
2028 #if (BTC_HF_INCLUDED == TRUE) && (BT_CLASSIC_BQB_INCLUDED == TRUE)
2029 #define BT_HF_AG_BQB_INCLUDED           TRUE
2030 #else
2031 #define BT_HF_AG_BQB_INCLUDED           FALSE
2032 #endif
2033 
2034 #if (BTC_HF_CLIENT_INCLUDED == TRUE) && (BT_CLASSIC_BQB_INCLUDED == TRUE)
2035 #define BT_HF_CLIENT_BQB_INCLUDED       TRUE
2036 #else
2037 #define BT_HF_CLIENT_BQB_INCLUDED       FALSE
2038 #endif
2039 
2040 /******************************************************************************
2041 **
2042 ** GAP
2043 **
2044 ******************************************************************************/
2045 
2046 #ifndef GAP_INCLUDED
2047 #define GAP_INCLUDED                TRUE
2048 #endif
2049 
2050 /* This is set to enable posting event for data write */
2051 #ifndef GAP_CONN_POST_EVT_INCLUDED
2052 #define GAP_CONN_POST_EVT_INCLUDED  FALSE
2053 #endif
2054 
2055 /* The maximum number of simultaneous GAP L2CAP connections. */
2056 #ifndef GAP_MAX_CONNECTIONS
2057 #define GAP_MAX_CONNECTIONS         10 // 30
2058 #endif
2059 
2060 /* keep the raw data received from SDP server in database. */
2061 #ifndef SDP_RAW_DATA_INCLUDED
2062 #define SDP_RAW_DATA_INCLUDED       TRUE
2063 #endif
2064 
2065 /* Inquiry duration in 1.28 second units. */
2066 #ifndef SDP_DEBUG
2067 #define SDP_DEBUG                   TRUE
2068 #endif
2069 
2070 /******************************************************************************
2071 **
2072 ** HID
2073 **
2074 ******************************************************************************/
2075 #ifndef BT_HID_INCLUDED
2076 #define BT_HID_INCLUDED         FALSE
2077 #endif
2078 
2079 /* HID Device Role Included */
2080 #ifndef HID_DEV_INCLUDED
2081 #define HID_DEV_INCLUDED   FALSE
2082 #endif
2083 
2084 #ifndef HID_DEV_SUBCLASS
2085 #define HID_DEV_SUBCLASS   COD_MINOR_POINTING
2086 #endif
2087 
2088 #ifndef HID_CONTROL_BUF_SIZE
2089 #define HID_CONTROL_BUF_SIZE            BT_DEFAULT_BUFFER_SIZE
2090 #endif
2091 
2092 #ifndef HID_INTERRUPT_BUF_SIZE
2093 #define HID_INTERRUPT_BUF_SIZE          BT_DEFAULT_BUFFER_SIZE
2094 #endif
2095 
2096 #ifndef HID_DEV_MTU_SIZE
2097 #define HID_DEV_MTU_SIZE 64
2098 #endif
2099 
2100 #ifndef HID_DEV_FLUSH_TO
2101 #define HID_DEV_FLUSH_TO 0xffff
2102 #endif
2103 
2104 #if (BTA_HD_INCLUDED == TRUE) && (HID_DEV_INCLUDED == TRUE) && (BT_CLASSIC_BQB_INCLUDED == TRUE)
2105 #define BT_HID_DEVICE_BQB_INCLUDED      TRUE
2106 #else
2107 #define BT_HID_DEVICE_BQB_INCLUDED      FALSE
2108 #endif
2109 
2110 /*************************************************************************
2111 ** Definitions for Both HID-Host & Device
2112 */
2113 #ifndef HID_MAX_SVC_NAME_LEN
2114 #define HID_MAX_SVC_NAME_LEN  32
2115 #endif
2116 
2117 #ifndef HID_MAX_SVC_DESCR_LEN
2118 #define HID_MAX_SVC_DESCR_LEN 32
2119 #endif
2120 
2121 #ifndef HID_MAX_PROV_NAME_LEN
2122 #define HID_MAX_PROV_NAME_LEN 32
2123 #endif
2124 
2125 /*************************************************************************
2126 ** Definitions for HID-Host
2127 */
2128 #ifndef  HID_HOST_INCLUDED
2129 #define HID_HOST_INCLUDED           FALSE
2130 #endif
2131 
2132 #ifndef HID_HOST_MAX_DEVICES
2133 #define HID_HOST_MAX_DEVICES        7
2134 #endif
2135 
2136 #ifndef HID_HOST_MTU
2137 #define HID_HOST_MTU                640
2138 #endif
2139 
2140 #ifndef HID_HOST_FLUSH_TO
2141 #define HID_HOST_FLUSH_TO                 0xffff
2142 #endif
2143 
2144 #ifndef HID_HOST_MAX_CONN_RETRY
2145 #define HID_HOST_MAX_CONN_RETRY     (3)
2146 #endif
2147 
2148 #ifndef HID_HOST_REPAGE_WIN
2149 #define HID_HOST_REPAGE_WIN          (2)
2150 #endif
2151 
2152 /*************************************************************************
2153  * A2DP Definitions
2154  */
2155 #ifndef A2D_INCLUDED
2156 #define A2D_INCLUDED            FALSE
2157 #endif
2158 
2159 #if (BTC_AV_SRC_INCLUDED == TRUE) && (BT_CLASSIC_BQB_INCLUDED == TRUE)
2160 #define A2D_SRC_BQB_INCLUDED TRUE
2161 #else
2162 #define A2D_SRC_BQB_INCLUDED FALSE
2163 #endif
2164 
2165 /******************************************************************************
2166 **
2167 ** AVCTP
2168 **
2169 ******************************************************************************/
2170 
2171 /* Number of simultaneous ACL links to different peer devices. */
2172 #ifndef AVCT_NUM_LINKS
2173 #define AVCT_NUM_LINKS              2
2174 #endif
2175 
2176 /* Number of simultaneous AVCTP connections. */
2177 #ifndef AVCT_NUM_CONN
2178 #define AVCT_NUM_CONN               3
2179 #endif
2180 
2181 /******************************************************************************
2182 **
2183 ** AVRCP
2184 **
2185 ******************************************************************************/
2186 #ifndef AVRC_INCLUDED
2187 #define AVRC_INCLUDED               FALSE
2188 #endif
2189 
2190 #ifndef AVRC_METADATA_INCLUDED
2191 #if AVRC_INCLUDED == TRUE
2192 #define AVRC_METADATA_INCLUDED      TRUE
2193 #else
2194 #define AVRC_METADATA_INCLUDED      FALSE
2195 #endif
2196 #endif
2197 
2198 #ifndef AVRC_ADV_CTRL_INCLUDED
2199 #if AVRC_INCLUDED == TRUE
2200 #define AVRC_ADV_CTRL_INCLUDED      TRUE
2201 #else
2202 #define AVRC_ADV_CTRL_INCLUDED      FALSE
2203 #endif
2204 #endif
2205 
2206 #ifndef AVRC_CTLR_INCLUDED
2207 #if AVRC_INCLUDED == TRUE
2208 #define AVRC_CTLR_INCLUDED          TRUE
2209 #else
2210 #define AVRC_CTLR_INCLUDED          FALSE
2211 #endif
2212 #endif
2213 
2214 /******************************************************************************
2215 **
2216 ** MCAP
2217 **
2218 ******************************************************************************/
2219 #ifndef MCA_INCLUDED
2220 #define MCA_INCLUDED                FALSE
2221 #endif
2222 
2223 /* The MTU size for the L2CAP configuration on control channel. 48 is the minimal */
2224 #ifndef MCA_CTRL_MTU
2225 #define MCA_CTRL_MTU    60
2226 #endif
2227 
2228 /* The maximum number of registered MCAP instances. */
2229 #ifndef MCA_NUM_REGS
2230 #define MCA_NUM_REGS    12
2231 #endif
2232 
2233 /* The maximum number of control channels (to difference devices) per registered MCAP instances. */
2234 #ifndef MCA_NUM_LINKS
2235 #define MCA_NUM_LINKS   3
2236 #endif
2237 
2238 /* The maximum number of MDEP (including HDP echo) per registered MCAP instances. */
2239 #ifndef MCA_NUM_DEPS
2240 #define MCA_NUM_DEPS    13
2241 #endif
2242 
2243 /* The maximum number of MDL link per control channel. */
2244 #ifndef MCA_NUM_MDLS
2245 #define MCA_NUM_MDLS    4
2246 #endif
2247 
2248 /* Buffer size to reassemble the SDU. */
2249 #ifndef MCA_USER_RX_BUF_SIZE
2250 #define MCA_USER_RX_BUF_SIZE    BT_DEFAULT_BUFFER_SIZE
2251 #endif
2252 
2253 /* Buffer size to hold the SDU. */
2254 #ifndef MCA_USER_TX_BUF_SIZE
2255 #define MCA_USER_TX_BUF_SIZE    BT_DEFAULT_BUFFER_SIZE
2256 #endif
2257 
2258 /*
2259  * Buffer size used to hold MPS segments during SDU reassembly
2260  */
2261 #ifndef MCA_FCR_RX_BUF_SIZE
2262 #define MCA_FCR_RX_BUF_SIZE     BT_DEFAULT_BUFFER_SIZE
2263 #endif
2264 
2265 /*
2266  * Default buffer size used to hold MPS segments used in (re)transmissions.
2267  * The size of each buffer must be able to hold the maximum MPS segment size
2268  * passed in tL2CAP_FCR_OPTIONS plus BT_HDR (8) + HCI preamble (4) +
2269  * L2CAP_MIN_OFFSET (11 - as of BT 2.1 + EDR Spec).
2270  */
2271 #ifndef MCA_FCR_TX_BUF_SIZE
2272 #define MCA_FCR_TX_BUF_SIZE     BT_DEFAULT_BUFFER_SIZE
2273 #endif
2274 
2275 /* MCAP control channel FCR Option:
2276 Size of the transmission window when using enhanced retransmission mode.
2277 1 is defined by HDP specification for control channel.
2278 */
2279 #ifndef MCA_FCR_OPT_TX_WINDOW_SIZE
2280 #define MCA_FCR_OPT_TX_WINDOW_SIZE      1
2281 #endif
2282 
2283 /* MCAP control channel FCR Option:
2284 Number of transmission attempts for a single I-Frame before taking
2285 Down the connection. Used In ERTM mode only. Value is Ignored in basic and
2286 Streaming modes.
2287 Range: 0, 1-0xFF
2288 0 - infinite retransmissions
2289 1 - single transmission
2290 */
2291 #ifndef MCA_FCR_OPT_MAX_TX_B4_DISCNT
2292 #define MCA_FCR_OPT_MAX_TX_B4_DISCNT    20
2293 #endif
2294 
2295 /* MCAP control channel FCR Option: Retransmission Timeout
2296 The AVRCP specification set a value in the range of 300 - 2000 ms
2297 Timeout (in msecs) to detect Lost I-Frames. Only used in Enhanced retransmission mode.
2298 Range: Minimum 2000 (2 secs) when supporting PBF.
2299  */
2300 #ifndef MCA_FCR_OPT_RETX_TOUT
2301 #define MCA_FCR_OPT_RETX_TOUT           2000
2302 #endif
2303 
2304 /* MCAP control channel FCR Option: Monitor Timeout
2305 The AVRCP specification set a value in the range of 300 - 2000 ms
2306 Timeout (in msecs) to detect Lost S-Frames. Only used in Enhanced retransmission mode.
2307 Range: Minimum 12000 (12 secs) when supporting PBF.
2308 */
2309 #ifndef MCA_FCR_OPT_MONITOR_TOUT
2310 #define MCA_FCR_OPT_MONITOR_TOUT        12000
2311 #endif
2312 
2313 /* MCAP control channel FCR Option: Maximum PDU payload size.
2314 The maximum number of payload octets that the local device can receive in a single PDU.
2315 */
2316 #ifndef MCA_FCR_OPT_MPS_SIZE
2317 #define MCA_FCR_OPT_MPS_SIZE            1000
2318 #endif
2319 
2320 /* Shared transport */
2321 #ifndef NFC_SHARED_TRANSPORT_ENABLED
2322 #define NFC_SHARED_TRANSPORT_ENABLED    FALSE
2323 #endif
2324 
2325 /******************************************************************************
2326 **
2327 ** Sleep Mode (Low Power Mode)
2328 **
2329 ******************************************************************************/
2330 
2331 #ifndef HCILP_INCLUDED
2332 #define HCILP_INCLUDED                  FALSE
2333 #endif
2334 
2335 /******************************************************************************
2336 **
2337 ** APPL - Application Task
2338 **
2339 ******************************************************************************/
2340 
2341 #define L2CAP_FEATURE_REQ_ID      73
2342 #define L2CAP_FEATURE_RSP_ID     173
2343 
2344 /******************************************************************************
2345 **
2346 ** BTA
2347 **
2348 ******************************************************************************/
2349 /* BTA EIR canned UUID list (default is dynamic) */
2350 #ifndef BTA_EIR_CANNED_UUID_LIST
2351 #define BTA_EIR_CANNED_UUID_LIST FALSE
2352 #endif
2353 
2354 /* Number of supported customer UUID in EIR */
2355 #ifndef BTA_EIR_SERVER_NUM_CUSTOM_UUID
2356 #define BTA_EIR_SERVER_NUM_CUSTOM_UUID     8
2357 #endif
2358 
2359 /* CHLD override for bluedroid */
2360 #ifndef BTA_AG_CHLD_VAL_ECC
2361 #define BTA_AG_CHLD_VAL_ECC  "(0,1,1x,2,2x,3)"
2362 #endif
2363 
2364 #ifndef BTA_AG_CHLD_VAL
2365 #define BTA_AG_CHLD_VAL  "(0,1,2,3)"
2366 #endif
2367 
2368 /* Set the CIND to match HFP 1.5 */
2369 #ifndef BTA_AG_CIND_INFO
2370 #define BTA_AG_CIND_INFO "(\"call\",(0,1)),(\"callsetup\",(0-3)),(\"service\",(0-1)),(\"signal\",(0-5)),(\"roam\",(0,1)),(\"battchg\",(0-5)),(\"callheld\",(0-2))"
2371 #endif
2372 
2373 #ifndef BTA_DM_AVOID_A2DP_ROLESWITCH_ON_INQUIRY
2374 #define BTA_DM_AVOID_A2DP_ROLESWITCH_ON_INQUIRY FALSE
2375 #endif
2376 
2377 #ifndef BTA_GATTC_MAX_CACHE_CHAR
2378 #define BTA_GATTC_MAX_CACHE_CHAR UC_BT_GATTC_MAX_CACHE_CHAR
2379 #endif
2380 
2381 /******************************************************************************
2382 **
2383 ** Tracing:  Include trace header file here.
2384 **
2385 ******************************************************************************/
2386 
2387 /* Enable/disable BTSnoop memory logging */
2388 #ifndef BTSNOOP_MEM
2389 #define BTSNOOP_MEM FALSE
2390 #endif
2391 
2392 #include "common/bt_trace.h"
2393 
2394 #endif /* BT_TARGET_H */
2395