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