bt_target.h 51 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859
  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. #ifndef BT_TARGET_H
  20. #define BT_TARGET_H
  21. #ifndef BUILDCFG
  22. #define BUILDCFG
  23. #endif
  24. /*
  25. #if !defined(HAS_BDROID_BUILDCFG) && !defined(HAS_NO_BDROID_BUILDCFG)
  26. #error "An Android.mk file did not include bdroid_CFLAGS and possibly not bdorid_C_INCLUDES"
  27. #endif
  28. */
  29. #ifdef HAS_BDROID_BUILDCFG
  30. #include "bdroid_buildcfg.h"
  31. #endif
  32. #include "sdkconfig.h"
  33. #include "bt_types.h" /* This must be defined AFTER buildcfg.h */
  34. /* Include common GKI definitions used by this platform */
  35. #include "gki_target.h"
  36. #include "dyn_mem.h" /* defines static and/or dynamic memory for components */
  37. #if CONFIG_CLASSIC_BT_ENABLED
  38. #define BTA_SDP_INCLUDED TRUE
  39. #define BTA_PAN_INCLUDED FALSE
  40. #define BTA_HH_INCLUDED FALSE
  41. #define BTA_AR_INCLUDED TRUE
  42. #define BTA_AV_INCLUDED TRUE
  43. #define BTA_AV_SINK_INCLUDED TRUE
  44. #define SDP_INCLUDED TRUE
  45. #define RFCOMM_INCLUDED FALSE
  46. #define PAN_INCLUDED FALSE
  47. #define HID_HOST_INCLUDED FALSE
  48. #define AVDT_INCLUDED TRUE
  49. #define A2D_INCLUDED TRUE
  50. #define AVCT_INCLUDED TRUE
  51. #define AVRC_INCLUDED TRUE
  52. #define SBC_DEC_INCLUDED TRUE
  53. #define SBC_ENC_INCLUDED FALSE
  54. #define MCA_INCLUDED FALSE
  55. #define BTC_SM_INCLUDED TRUE
  56. #define BTC_PRF_QUEUE_INCLUDED TRUE
  57. #define BTC_GAP_BT_INCLUDED TRUE
  58. #define BTC_AV_INCLUDED TRUE
  59. #else /* #if CONFIG_CLASSIC_BT_ENABLED */
  60. #define BTA_SDP_INCLUDED FALSE
  61. #define BTA_PAN_INCLUDED FALSE
  62. #define BTA_HH_INCLUDED FALSE
  63. #define BTA_AR_INCLUDED FALSE
  64. #define BTA_AV_INCLUDED FALSE
  65. #define BTA_AV_SINK_INCLUDED FALSE
  66. #define SDP_INCLUDED FALSE
  67. #define RFCOMM_INCLUDED FALSE
  68. #define PAN_INCLUDED FALSE
  69. #define HID_HOST_INCLUDED FALSE
  70. #define AVDT_INCLUDED FALSE
  71. #define A2D_INCLUDED FALSE
  72. #define AVCT_INCLUDED FALSE
  73. #define AVRC_INCLUDED FALSE
  74. #define SBC_DEC_INCLUDED FALSE
  75. #define SBC_ENC_INCLUDED FALSE
  76. #define MCA_INCLUDED FALSE
  77. #define BTC_SM_INCLUDED FALSE
  78. #define BTC_PRF_QUEUE_INCLUDED FALSE
  79. #define BTC_GAP_BT_INCLUDED FALSE
  80. #define BTC_AV_INCLUDED FALSE
  81. #endif /* #if CONFIG_CLASSIC_BT_ENABLED */
  82. //------------------Added from bdroid_buildcfg.h---------------------
  83. #ifndef L2CAP_EXTFEA_SUPPORTED_MASK
  84. #define L2CAP_EXTFEA_SUPPORTED_MASK (L2CAP_EXTFEA_ENH_RETRANS | L2CAP_EXTFEA_STREAM_MODE | L2CAP_EXTFEA_NO_CRC | L2CAP_EXTFEA_FIXED_CHNLS)
  85. #endif
  86. #ifndef BTUI_OPS_FORMATS
  87. #define BTUI_OPS_FORMATS (BTA_OP_VCARD21_MASK | BTA_OP_ANY_MASK)
  88. #endif
  89. #ifndef BTA_RFC_MTU_SIZE
  90. #define BTA_RFC_MTU_SIZE (L2CAP_MTU_SIZE-L2CAP_MIN_OFFSET-RFCOMM_DATA_OVERHEAD)
  91. #endif
  92. #ifndef SBC_NO_PCM_CPY_OPTION
  93. #define SBC_NO_PCM_CPY_OPTION FALSE
  94. #endif
  95. #ifndef BT_APP_DEMO
  96. #define BT_APP_DEMO TRUE
  97. #endif
  98. #ifndef BTIF_INCLUDED
  99. #define BTIF_INCLUDED FALSE
  100. #endif
  101. #ifndef BTA_INCLUDED
  102. #define BTA_INCLUDED TRUE
  103. #endif
  104. #ifndef BTA_PAN_INCLUDED
  105. #define BTA_PAN_INCLUDED FALSE//TRUE
  106. #endif
  107. #ifndef BTA_HH_INCLUDED
  108. #define BTA_HH_INCLUDED FALSE//TRUE
  109. #endif
  110. #ifndef BTA_HH_ROLE
  111. #define BTA_HH_ROLE BTA_MASTER_ROLE_PREF
  112. #endif
  113. #ifndef BTA_HH_LE_INCLUDED
  114. #define BTA_HH_LE_INCLUDED FALSE//TRUE
  115. #endif
  116. #ifndef BTA_AR_INCLUDED
  117. #define BTA_AR_INCLUDED TRUE//TRUE
  118. #endif
  119. #ifndef BTA_AV_INCLUDED
  120. #define BTA_AV_INCLUDED TRUE//TRUE
  121. #endif
  122. #ifndef BTA_AV_SINK_INCLUDED
  123. #define BTA_AV_SINK_INCLUDED TRUE//FALSE
  124. #endif
  125. #ifndef BTA_DISABLE_DELAY
  126. #define BTA_DISABLE_DELAY 200 /* in milliseconds */
  127. #endif
  128. // If the next wakeup time is less than this threshold, we should acquire
  129. // a wakelock instead of setting a wake alarm so we're not bouncing in
  130. // and out of suspend frequently.
  131. // in millisecond
  132. // TODO(zachoverflow): reinstate in alarm code
  133. #ifndef GKI_TIMER_INTERVAL_FOR_WAKELOCK
  134. #define GKI_TIMER_INTERVAL_FOR_WAKELOCK 3000
  135. #endif
  136. #ifndef BTA_SYS_TIMER_PERIOD
  137. #define BTA_SYS_TIMER_PERIOD 100
  138. #endif
  139. #ifndef SBC_FOR_EMBEDDED_LINUX
  140. #define SBC_FOR_EMBEDDED_LINUX TRUE
  141. #endif
  142. #ifndef AVDT_VERSION
  143. #define AVDT_VERSION 0x0102
  144. #endif
  145. #ifndef BTA_AG_AT_MAX_LEN
  146. #define BTA_AG_AT_MAX_LEN 512
  147. #endif
  148. #ifndef BTA_AVRCP_FF_RW_SUPPORT
  149. #define BTA_AVRCP_FF_RW_SUPPORT FALSE//TRUE
  150. #endif
  151. #ifndef BTA_AG_SCO_PKT_TYPES
  152. #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)
  153. #endif
  154. #ifndef BTA_AV_RET_TOUT
  155. #define BTA_AV_RET_TOUT 15
  156. #endif
  157. #ifndef PORCHE_PAIRING_CONFLICT
  158. #define PORCHE_PAIRING_CONFLICT TRUE
  159. #endif
  160. #ifndef BTA_AV_CO_CP_SCMS_T
  161. #define BTA_AV_CO_CP_SCMS_T FALSE//FALSE
  162. #endif
  163. /* This feature is used to eanble interleaved scan*/
  164. #ifndef BTA_HOST_INTERLEAVE_SEARCH
  165. #define BTA_HOST_INTERLEAVE_SEARCH FALSE//FALSE
  166. #endif
  167. #ifndef BT_USE_TRACES
  168. #define BT_USE_TRACES TRUE
  169. #endif
  170. #ifndef BT_TRACE_BTIF
  171. #define BT_TRACE_BTIF TRUE
  172. #endif
  173. #ifndef BT_TRACE_VERBOSE
  174. #define BT_TRACE_VERBOSE FALSE
  175. #endif
  176. #ifndef BTA_DM_SDP_DB_SIZE
  177. #define BTA_DM_SDP_DB_SIZE 8000
  178. #endif
  179. #ifndef HL_INCLUDED
  180. #define HL_INCLUDED TRUE
  181. #endif
  182. #ifndef AG_VOICE_SETTINGS
  183. #define AG_VOICE_SETTINGS HCI_DEFAULT_VOICE_SETTINGS
  184. #endif
  185. #ifndef BTIF_DM_OOB_TEST
  186. #define BTIF_DM_OOB_TEST FALSE//TRUE
  187. #endif
  188. // How long to wait before activating sniff mode after entering the
  189. // idle state for FTS, OPS connections
  190. #ifndef BTA_FTS_OPS_IDLE_TO_SNIFF_DELAY_MS
  191. #define BTA_FTS_OPS_IDLE_TO_SNIFF_DELAY_MS 7000
  192. #endif
  193. //------------------End added from bdroid_buildcfg.h---------------------
  194. /******************************************************************************
  195. **
  196. ** GKI Buffer Pools
  197. **
  198. ******************************************************************************/
  199. /* Receives HCI events from the lower-layer. */
  200. #ifndef HCI_CMD_POOL_ID
  201. #define HCI_CMD_POOL_ID GKI_POOL_ID_2
  202. #endif
  203. #ifndef HCI_CMD_POOL_BUF_SIZE
  204. #define HCI_CMD_POOL_BUF_SIZE GKI_BUF2_SIZE
  205. #endif
  206. /* Receives ACL data packets from thelower-layer. */
  207. #ifndef HCI_ACL_POOL_ID
  208. #define HCI_ACL_POOL_ID GKI_POOL_ID_3
  209. #endif
  210. /* Maximum number of buffers available for ACL receive data. */
  211. #ifndef HCI_ACL_BUF_MAX
  212. #define HCI_ACL_BUF_MAX GKI_BUF3_MAX
  213. #endif
  214. /* Receives SCO data packets from the lower-layer. */
  215. #ifndef HCI_SCO_POOL_ID
  216. #define HCI_SCO_POOL_ID GKI_POOL_ID_6
  217. #endif
  218. /* Sends SDP data packets. */
  219. #ifndef SDP_POOL_ID
  220. #define SDP_POOL_ID 3
  221. #endif
  222. /* Sends RFCOMM command packets. */
  223. #ifndef RFCOMM_CMD_POOL_ID
  224. #define RFCOMM_CMD_POOL_ID GKI_POOL_ID_2
  225. #endif
  226. /* Sends RFCOMM data packets. */
  227. #ifndef RFCOMM_DATA_POOL_ID
  228. #define RFCOMM_DATA_POOL_ID GKI_POOL_ID_3
  229. #endif
  230. #ifndef RFCOMM_DATA_POOL_BUF_SIZE
  231. #define RFCOMM_DATA_POOL_BUF_SIZE GKI_BUF3_SIZE
  232. #endif
  233. /* Sends L2CAP packets to the peer and HCI messages to the controller. */
  234. #ifndef L2CAP_CMD_POOL_ID
  235. #define L2CAP_CMD_POOL_ID GKI_POOL_ID_2
  236. #endif
  237. /* Sends L2CAP segmented packets in ERTM mode */
  238. #ifndef L2CAP_FCR_TX_POOL_ID
  239. #define L2CAP_FCR_TX_POOL_ID HCI_ACL_POOL_ID
  240. #endif
  241. /* Receives L2CAP segmented packets in ERTM mode */
  242. #ifndef L2CAP_FCR_RX_POOL_ID
  243. #define L2CAP_FCR_RX_POOL_ID HCI_ACL_POOL_ID
  244. #endif
  245. /* Number of ACL buffers to assign to LE
  246. if the HCI buffer pool is shared with BR/EDR */
  247. #ifndef L2C_DEF_NUM_BLE_BUF_SHARED
  248. #define L2C_DEF_NUM_BLE_BUF_SHARED 1
  249. #endif
  250. /* Used by BTM when it sends HCI commands to the controller. */
  251. #ifndef BTM_CMD_POOL_ID
  252. #define BTM_CMD_POOL_ID GKI_POOL_ID_2
  253. #endif
  254. #ifndef OBX_LRG_DATA_POOL_SIZE
  255. #define OBX_LRG_DATA_POOL_SIZE GKI_BUF4_SIZE
  256. #endif
  257. #ifndef OBX_LRG_DATA_POOL_ID
  258. #define OBX_LRG_DATA_POOL_ID GKI_POOL_ID_4
  259. #endif
  260. /* Used to send data to L2CAP. */
  261. #ifndef GAP_DATA_POOL_ID
  262. #define GAP_DATA_POOL_ID GKI_POOL_ID_3
  263. #endif
  264. #ifndef SPP_DB_SIZE
  265. #define SPP_DB_SIZE GKI_BUF3_SIZE
  266. #endif
  267. /* BNEP data and protocol messages. */
  268. #ifndef BNEP_POOL_ID
  269. #define BNEP_POOL_ID GKI_POOL_ID_3
  270. #endif
  271. /* RPC pool for temporary trace message buffers. */
  272. #ifndef RPC_SCRATCH_POOL_ID
  273. #define RPC_SCRATCH_POOL_ID GKI_POOL_ID_2
  274. #endif
  275. /* AVDTP pool for protocol messages */
  276. #ifndef AVDT_CMD_POOL_ID
  277. #define AVDT_CMD_POOL_ID GKI_POOL_ID_2
  278. #endif
  279. /* AVDTP pool size for media packets in case of fragmentation */
  280. #ifndef AVDT_DATA_POOL_SIZE
  281. #define AVDT_DATA_POOL_SIZE GKI_BUF3_SIZE
  282. #endif
  283. #ifndef PAN_POOL_ID
  284. #define PAN_POOL_ID GKI_POOL_ID_3
  285. /* Maximum amount of the shared buffer to allocate for PAN */
  286. #define PAN_POOL_MAX (GKI_BUF3_MAX / 4)
  287. #endif
  288. /* AVCTP pool for protocol messages */
  289. #ifndef AVCT_CMD_POOL_ID
  290. #define AVCT_CMD_POOL_ID GKI_POOL_ID_1
  291. #endif
  292. /* AVRCP pool for protocol messages */
  293. #ifndef AVRC_CMD_POOL_ID
  294. #define AVRC_CMD_POOL_ID GKI_POOL_ID_1
  295. #endif
  296. /* AVRCP pool size for protocol messages */
  297. #ifndef AVRC_CMD_POOL_SIZE
  298. #define AVRC_CMD_POOL_SIZE GKI_BUF1_SIZE
  299. #endif
  300. /* AVRCP Metadata pool for protocol messages */
  301. #ifndef AVRC_META_CMD_POOL_ID
  302. #define AVRC_META_CMD_POOL_ID GKI_POOL_ID_2
  303. #endif
  304. /* AVRCP Metadata pool size for protocol messages */
  305. #ifndef AVRC_META_CMD_POOL_SIZE
  306. #define AVRC_META_CMD_POOL_SIZE GKI_BUF2_SIZE
  307. #endif
  308. /* AVRCP buffer size for browsing channel messages */
  309. #ifndef AVRC_BROWSE_POOL_SIZE
  310. #define AVRC_BROWSE_POOL_SIZE GKI_MAX_BUF_SIZE
  311. #endif
  312. #ifndef BTA_HL_LRG_DATA_POOL_ID
  313. #define BTA_HL_LRG_DATA_POOL_ID GKI_POOL_ID_7
  314. #endif
  315. /* GATT Server Database pool ID */
  316. #ifndef GATT_DB_POOL_ID
  317. #define GATT_DB_POOL_ID GKI_POOL_ID_8
  318. #endif
  319. /* GATT Data sending buffer pool ID, use default ACL pool for fix channel data */
  320. #ifndef GATT_BUF_POOL_ID
  321. #define GATT_BUF_POOL_ID HCI_ACL_POOL_ID
  322. #endif
  323. /******************************************************************************
  324. **
  325. ** Lower Layer Interface
  326. **
  327. ******************************************************************************/
  328. /* Macro for allocating buffer for HCI commands */
  329. #ifndef HCI_GET_CMD_BUF
  330. #if (!defined(HCI_USE_VARIABLE_SIZE_CMD_BUF) || (HCI_USE_VARIABLE_SIZE_CMD_BUF == FALSE))
  331. /* Allocate fixed-size buffer from HCI_CMD_POOL (default case) */
  332. #define HCI_GET_CMD_BUF(paramlen) ((BT_HDR *)GKI_getpoolbuf (HCI_CMD_POOL_ID))
  333. #else
  334. /* Allocate smallest possible buffer (for platforms with limited RAM) */
  335. #define HCI_GET_CMD_BUF(paramlen) ((BT_HDR *)GKI_getbuf ((UINT16)(BT_HDR_SIZE + HCIC_PREAMBLE_SIZE + (paramlen))))
  336. #endif
  337. #endif /* HCI_GET_CMD_BUF */
  338. /******************************************************************************
  339. **
  340. ** HCI Services (H4)
  341. **
  342. ******************************************************************************/
  343. /* Use 2 second for low-resolution systems, override to 1 for high-resolution systems */
  344. #ifndef BT_1SEC_TIMEOUT
  345. #define BT_1SEC_TIMEOUT (2)
  346. #endif
  347. /* Quick Timer */
  348. /* if L2CAP_FCR_INCLUDED is TRUE then it should have 100 millisecond resolution */
  349. /* if none of them is included then QUICK_TIMER_TICKS_PER_SEC is set to 0 to exclude quick timer */
  350. #ifndef QUICK_TIMER_TICKS_PER_SEC
  351. #define QUICK_TIMER_TICKS_PER_SEC 10 /* 100ms timer */
  352. #endif
  353. /******************************************************************************
  354. **
  355. ** BTM
  356. **
  357. ******************************************************************************/
  358. /* Cancel Inquiry on incoming SSP */
  359. #ifndef BTM_NO_SSP_ON_INQUIRY
  360. #define BTM_NO_SSP_ON_INQUIRY FALSE
  361. #endif
  362. /* Includes SCO if TRUE */
  363. #ifndef BTM_SCO_INCLUDED
  364. #define BTM_SCO_INCLUDED FALSE //TRUE /* TRUE includes SCO code */
  365. #endif
  366. /* Includes SCO if TRUE */
  367. #ifndef BTM_SCO_HCI_INCLUDED
  368. #define BTM_SCO_HCI_INCLUDED FALSE /* TRUE includes SCO over HCI code */
  369. #endif
  370. /* Includes WBS if TRUE */
  371. #ifndef BTM_WBS_INCLUDED
  372. #define BTM_WBS_INCLUDED FALSE /* TRUE includes WBS code */
  373. #endif
  374. /* This is used to work around a controller bug that doesn't like Disconnect
  375. ** issued while there is a role switch in progress
  376. */
  377. #ifndef BTM_DISC_DURING_RS
  378. #define BTM_DISC_DURING_RS TRUE
  379. #endif
  380. /**************************
  381. ** Initial SCO TX credit
  382. *************************/
  383. /* max TX SCO data packet size */
  384. #ifndef BTM_SCO_DATA_SIZE_MAX
  385. #define BTM_SCO_DATA_SIZE_MAX 240
  386. #endif
  387. /* The size in bytes of the BTM inquiry database. 40 As Default */
  388. #ifndef BTM_INQ_DB_SIZE
  389. #define BTM_INQ_DB_SIZE 32
  390. #endif
  391. /* The default scan mode */
  392. #ifndef BTM_DEFAULT_SCAN_TYPE
  393. #define BTM_DEFAULT_SCAN_TYPE BTM_SCAN_TYPE_INTERLACED
  394. #endif
  395. /* Should connections to unknown devices be allowed when not discoverable? */
  396. #ifndef BTM_ALLOW_CONN_IF_NONDISCOVER
  397. #define BTM_ALLOW_CONN_IF_NONDISCOVER TRUE
  398. #endif
  399. /* Sets the Page_Scan_Window: the length of time that the device is performing a page scan. */
  400. #ifndef BTM_DEFAULT_CONN_WINDOW
  401. #define BTM_DEFAULT_CONN_WINDOW 0x0012
  402. #endif
  403. /* Sets the Page_Scan_Activity: the interval between the start of two consecutive page scans. */
  404. #ifndef BTM_DEFAULT_CONN_INTERVAL
  405. #define BTM_DEFAULT_CONN_INTERVAL 0x0800
  406. #endif
  407. /* When automatic inquiry scan is enabled, this sets the inquiry scan window. */
  408. #ifndef BTM_DEFAULT_DISC_WINDOW
  409. #define BTM_DEFAULT_DISC_WINDOW 0x0012
  410. #endif
  411. /* When automatic inquiry scan is enabled, this sets the inquiry scan interval. */
  412. #ifndef BTM_DEFAULT_DISC_INTERVAL
  413. #define BTM_DEFAULT_DISC_INTERVAL 0x0800
  414. #endif
  415. /*
  416. * {SERVICE_CLASS, MAJOR_CLASS, MINOR_CLASS}
  417. *
  418. * SERVICE_CLASS:0x5A (Bit17 -Networking,Bit19 - Capturing,Bit20 -Object Transfer,Bit22 -Telephony)
  419. * MAJOR_CLASS:0x02 - PHONE
  420. * MINOR_CLASS:0x0C - SMART_PHONE
  421. *
  422. */
  423. #define BTA_DM_COD_SMARTPHONE {0x5A, 0x02, 0x0C}
  424. /*
  425. * {SERVICE_CLASS, MAJOR_CLASS, MINOR_CLASS}
  426. *
  427. * SERVICE_CLASS:0x2C (Bit21 - Audio, Bit19 - Capturing)
  428. * MAJOR_CLASS:0x04 - Audio/Video
  429. * MINOR_CLASS:0x05 - LoudSpeaker
  430. */
  431. #define BTA_DM_COD_LOUDSPEAKER {0x2C, 0x04, 0x14}
  432. /* Default class of device */
  433. #ifndef BTA_DM_COD
  434. #define BTA_DM_COD BTA_DM_COD_LOUDSPEAKER
  435. #endif
  436. /* The number of SCO links. */
  437. #ifndef BTM_MAX_SCO_LINKS
  438. #define BTM_MAX_SCO_LINKS 1 //3
  439. #endif
  440. /* The preferred type of SCO links (2-eSCO, 0-SCO). */
  441. #ifndef BTM_DEFAULT_SCO_MODE
  442. #define BTM_DEFAULT_SCO_MODE 2
  443. #endif
  444. /* The number of security records for peer devices. 100 AS Default*/
  445. #ifndef BTM_SEC_MAX_DEVICE_RECORDS
  446. #define BTM_SEC_MAX_DEVICE_RECORDS 8 // 100
  447. #endif
  448. /* The number of security records for services. 32 AS Default*/
  449. #ifndef BTM_SEC_MAX_SERVICE_RECORDS
  450. #define BTM_SEC_MAX_SERVICE_RECORDS 8 // 32
  451. #endif
  452. /* If True, force a retrieval of remote device name for each bond in case it's changed */
  453. #ifndef BTM_SEC_FORCE_RNR_FOR_DBOND
  454. #define BTM_SEC_FORCE_RNR_FOR_DBOND FALSE
  455. #endif
  456. /* Maximum device name length used in btm database. Up to 248*/
  457. #ifndef BTM_MAX_REM_BD_NAME_LEN
  458. #define BTM_MAX_REM_BD_NAME_LEN 64
  459. #endif
  460. /* Maximum local device name length stored btm database.
  461. '0' disables storage of the local name in BTM */
  462. #ifndef BTM_MAX_LOC_BD_NAME_LEN
  463. #define BTM_MAX_LOC_BD_NAME_LEN 64
  464. #endif
  465. /* Fixed Default String. When this is defined as null string, the device's
  466. * product model name is used as the default local name.
  467. */
  468. #ifndef BTM_DEF_LOCAL_NAME
  469. #define BTM_DEF_LOCAL_NAME ""
  470. #endif
  471. /* Maximum service name stored with security authorization (0 if not needed) */
  472. #ifndef BTM_SEC_SERVICE_NAME_LEN
  473. #define BTM_SEC_SERVICE_NAME_LEN BT_MAX_SERVICE_NAME_LEN
  474. #endif
  475. /* Maximum length of the service name. */
  476. #ifndef BT_MAX_SERVICE_NAME_LEN
  477. #define BT_MAX_SERVICE_NAME_LEN 21
  478. #endif
  479. /* ACL buffer size in HCI Host Buffer Size command. */
  480. #ifndef BTM_ACL_BUF_SIZE
  481. #define BTM_ACL_BUF_SIZE 0
  482. #endif
  483. /* The maximum number of clients that can register with the power manager. */
  484. #ifndef BTM_MAX_PM_RECORDS
  485. #define BTM_MAX_PM_RECORDS 2
  486. #endif
  487. /* This is set to show debug trace messages for the power manager. */
  488. #ifndef BTM_PM_DEBUG
  489. #define BTM_PM_DEBUG FALSE
  490. #endif
  491. /* This is set to TRUE if link is to be unparked due to BTM_CreateSCO API. */
  492. #ifndef BTM_SCO_WAKE_PARKED_LINK
  493. #define BTM_SCO_WAKE_PARKED_LINK TRUE
  494. #endif
  495. /* If the user does not respond to security process requests within this many seconds,
  496. * a negative response would be sent automatically.
  497. * 30 is LMP response timeout value */
  498. #ifndef BTM_SEC_TIMEOUT_VALUE
  499. #define BTM_SEC_TIMEOUT_VALUE 35
  500. #endif
  501. /* Maximum number of callbacks that can be registered using BTM_RegisterForVSEvents */
  502. #ifndef BTM_MAX_VSE_CALLBACKS
  503. #define BTM_MAX_VSE_CALLBACKS 3
  504. #endif
  505. /******************************************
  506. ** Lisbon Features
  507. *******************************************/
  508. /* This is set to TRUE if the FEC is required for EIR packet. */
  509. #ifndef BTM_EIR_DEFAULT_FEC_REQUIRED
  510. #define BTM_EIR_DEFAULT_FEC_REQUIRED TRUE
  511. #endif
  512. /* The IO capability of the local device (for Simple Pairing) */
  513. #ifndef BTM_LOCAL_IO_CAPS
  514. #define BTM_LOCAL_IO_CAPS BTM_IO_CAP_NONE
  515. #endif
  516. #ifndef BTM_LOCAL_IO_CAPS_BLE
  517. #define BTM_LOCAL_IO_CAPS_BLE BTM_IO_CAP_KBDISP
  518. #endif
  519. /* The default MITM Protection Requirement (for Simple Pairing)
  520. * Possible values are BTM_AUTH_SP_YES or BTM_AUTH_SP_NO */
  521. #ifndef BTM_DEFAULT_AUTH_REQ
  522. #define BTM_DEFAULT_AUTH_REQ BTM_AUTH_SP_NO
  523. #endif
  524. /* The default MITM Protection Requirement for dedicated bonding using Simple Pairing
  525. * Possible values are BTM_AUTH_AP_YES or BTM_AUTH_AP_NO */
  526. #ifndef BTM_DEFAULT_DD_AUTH_REQ
  527. #define BTM_DEFAULT_DD_AUTH_REQ BTM_AUTH_AP_YES
  528. #endif
  529. /* Include Out-of-Band implementation for Simple Pairing */
  530. #ifndef BTM_OOB_INCLUDED
  531. #define BTM_OOB_INCLUDED TRUE
  532. #endif
  533. /* TRUE to include Sniff Subrating */
  534. #ifndef BTM_SSR_INCLUDED
  535. #define BTM_SSR_INCLUDED TRUE
  536. #endif
  537. /*************************
  538. ** End of Lisbon Features
  539. **************************/
  540. /* 4.1/4.2 secure connections feature */
  541. #ifndef SC_MODE_INCLUDED
  542. #define SC_MODE_INCLUDED TRUE
  543. #endif
  544. /* Used for conformance testing ONLY */
  545. #ifndef BTM_BLE_CONFORMANCE_TESTING
  546. #define BTM_BLE_CONFORMANCE_TESTING FALSE
  547. #endif
  548. /******************************************************************************
  549. **
  550. ** L2CAP
  551. **
  552. ******************************************************************************/
  553. #ifndef L2CAP_CLIENT_INCLUDED
  554. #define L2CAP_CLIENT_INCLUDED FALSE
  555. #endif
  556. /* The maximum number of simultaneous links that L2CAP can support. Up to 7*/
  557. #ifndef MAX_ACL_CONNECTIONS
  558. #define MAX_L2CAP_LINKS 3
  559. #else
  560. #define MAX_L2CAP_LINKS MAX_ACL_CONNECTIONS
  561. #endif
  562. /* The maximum number of simultaneous channels that L2CAP can support. Up to 16*/
  563. #ifndef MAX_L2CAP_CHANNELS
  564. #define MAX_L2CAP_CHANNELS 8
  565. #endif
  566. /* The maximum number of simultaneous applications that can register with L2CAP. */
  567. #ifndef MAX_L2CAP_CLIENTS
  568. #define MAX_L2CAP_CLIENTS 8
  569. #endif
  570. /* The number of seconds of link inactivity before a link is disconnected. */
  571. #ifndef L2CAP_LINK_INACTIVITY_TOUT
  572. #define L2CAP_LINK_INACTIVITY_TOUT 4
  573. #endif
  574. /* The number of seconds of link inactivity after bonding before a link is disconnected. */
  575. #ifndef L2CAP_BONDING_TIMEOUT
  576. #define L2CAP_BONDING_TIMEOUT 3
  577. #endif
  578. /* The time from the HCI connection complete to disconnect if no channel is established. */
  579. #ifndef L2CAP_LINK_STARTUP_TOUT
  580. #define L2CAP_LINK_STARTUP_TOUT 60
  581. #endif
  582. /* The L2CAP MTU; must be in accord with the HCI ACL pool size. */
  583. #ifndef L2CAP_MTU_SIZE
  584. #define L2CAP_MTU_SIZE 1691
  585. #endif
  586. /* The L2CAP MPS over Bluetooth; must be in accord with the FCR tx pool size and ACL down buffer size. */
  587. #ifndef L2CAP_MPS_OVER_BR_EDR
  588. #define L2CAP_MPS_OVER_BR_EDR 1010
  589. #endif
  590. /* If host flow control enabled, this is the number of buffers the controller can have unacknowledged. */
  591. #ifndef L2CAP_HOST_FC_ACL_BUFS
  592. #define L2CAP_HOST_FC_ACL_BUFS 20
  593. #endif
  594. /* This is set to enable L2CAP to take the ACL link out of park mode when ACL data is to be sent. */
  595. #ifndef L2CAP_WAKE_PARKED_LINK
  596. #define L2CAP_WAKE_PARKED_LINK TRUE
  597. #endif
  598. /* Whether link wants to be the master or the slave. */
  599. #ifndef L2CAP_DESIRED_LINK_ROLE
  600. #define L2CAP_DESIRED_LINK_ROLE HCI_ROLE_SLAVE
  601. #endif
  602. /* Include Non-Flushable Packet Boundary Flag feature of Lisbon */
  603. #ifndef L2CAP_NON_FLUSHABLE_PB_INCLUDED
  604. #define L2CAP_NON_FLUSHABLE_PB_INCLUDED TRUE
  605. #endif
  606. /* Minimum number of ACL credit for high priority link */
  607. #ifndef L2CAP_HIGH_PRI_MIN_XMIT_QUOTA
  608. #define L2CAP_HIGH_PRI_MIN_XMIT_QUOTA 5
  609. #endif
  610. /* used for monitoring HCI ACL credit management */
  611. #ifndef L2CAP_HCI_FLOW_CONTROL_DEBUG
  612. #define L2CAP_HCI_FLOW_CONTROL_DEBUG TRUE
  613. #endif
  614. /* Used for calculating transmit buffers off of */
  615. #ifndef L2CAP_NUM_XMIT_BUFFS
  616. #define L2CAP_NUM_XMIT_BUFFS HCI_ACL_BUF_MAX
  617. #endif
  618. /* Unicast Connectionless Data */
  619. #ifndef L2CAP_UCD_INCLUDED
  620. #define L2CAP_UCD_INCLUDED FALSE
  621. #endif
  622. /* Unicast Connectionless Data MTU */
  623. #ifndef L2CAP_UCD_MTU
  624. #define L2CAP_UCD_MTU L2CAP_MTU_SIZE
  625. #endif
  626. /* Unicast Connectionless Data Idle Timeout */
  627. #ifndef L2CAP_UCD_IDLE_TIMEOUT
  628. #define L2CAP_UCD_IDLE_TIMEOUT 2
  629. #endif
  630. /* Unicast Connectionless Data Idle Timeout */
  631. #ifndef L2CAP_UCD_CH_PRIORITY
  632. #define L2CAP_UCD_CH_PRIORITY L2CAP_CHNL_PRIORITY_MEDIUM
  633. #endif
  634. /* Used for features using fixed channels; set to zero if no fixed channels supported (BLE, etc.) */
  635. /* Excluding L2CAP signaling channel and UCD */
  636. #ifndef L2CAP_NUM_FIXED_CHNLS
  637. #define L2CAP_NUM_FIXED_CHNLS 32
  638. #endif
  639. /* First fixed channel supported */
  640. #ifndef L2CAP_FIRST_FIXED_CHNL
  641. #define L2CAP_FIRST_FIXED_CHNL 4
  642. #endif
  643. #ifndef L2CAP_LAST_FIXED_CHNL
  644. #define L2CAP_LAST_FIXED_CHNL (L2CAP_FIRST_FIXED_CHNL + L2CAP_NUM_FIXED_CHNLS - 1)
  645. #endif
  646. /* Round Robin service channels in link */
  647. #ifndef L2CAP_ROUND_ROBIN_CHANNEL_SERVICE
  648. #define L2CAP_ROUND_ROBIN_CHANNEL_SERVICE TRUE
  649. #endif
  650. /* Used for calculating transmit buffers off of */
  651. #ifndef L2CAP_NUM_XMIT_BUFFS
  652. #define L2CAP_NUM_XMIT_BUFFS HCI_ACL_BUF_MAX
  653. #endif
  654. /* used for monitoring eL2CAP data flow */
  655. #ifndef L2CAP_ERTM_STATS
  656. #define L2CAP_ERTM_STATS FALSE
  657. #endif
  658. /* Used for conformance testing ONLY: When TRUE lets scriptwrapper overwrite info response */
  659. #ifndef L2CAP_CONFORMANCE_TESTING
  660. #define L2CAP_CONFORMANCE_TESTING FALSE
  661. #endif
  662. /*
  663. * Max bytes per connection to buffer locally before dropping the
  664. * connection if local client does not receive it - default is 1MB
  665. */
  666. #ifndef L2CAP_MAX_RX_BUFFER
  667. #define L2CAP_MAX_RX_BUFFER 0x100000
  668. #endif
  669. #ifndef TIMER_PARAM_TYPE
  670. #define TIMER_PARAM_TYPE UINT32
  671. #endif
  672. /******************************************************************************
  673. **
  674. ** BLE
  675. **
  676. ******************************************************************************/
  677. #ifndef BLE_INCLUDED
  678. #define BLE_INCLUDED TRUE
  679. #endif
  680. #ifndef BLE_ANDROID_CONTROLLER_SCAN_FILTER
  681. #define BLE_ANDROID_CONTROLLER_SCAN_FILTER TRUE
  682. #endif
  683. #ifndef LOCAL_BLE_CONTROLLER_ID
  684. #define LOCAL_BLE_CONTROLLER_ID (1)
  685. #endif
  686. /*
  687. * Toggles support for general LE privacy features such as remote address
  688. * resolution, local address rotation etc.
  689. */
  690. #ifndef BLE_PRIVACY_SPT
  691. #define BLE_PRIVACY_SPT TRUE
  692. #endif
  693. /*
  694. * Enables or disables support for local privacy (ex. address rotation)
  695. */
  696. #ifndef BLE_LOCAL_PRIVACY_ENABLED
  697. #define BLE_LOCAL_PRIVACY_ENABLED TRUE
  698. #endif
  699. /*
  700. * Toggles support for vendor specific extensions such as RPA offloading,
  701. * feature discovery, multi-adv etc.
  702. */
  703. #ifndef BLE_VND_INCLUDED
  704. #define BLE_VND_INCLUDED FALSE
  705. #endif
  706. #ifndef BTM_BLE_ADV_TX_POWER
  707. #define BTM_BLE_ADV_TX_POWER {-21, -15, -7, 1, 9}
  708. #endif
  709. #ifndef BLE_BATCH_SCAN_INCLUDED
  710. #define BLE_BATCH_SCAN_INCLUDED TRUE
  711. #endif
  712. /******************************************************************************
  713. **
  714. ** ATT/GATT Protocol/Profile Settings
  715. **
  716. ******************************************************************************/
  717. #ifndef GATT_INCLUDED
  718. #if BLE_INCLUDED == TRUE
  719. #define GATT_INCLUDED TRUE
  720. #else
  721. #define GATT_INCLUDED FALSE
  722. #endif
  723. #endif
  724. #ifndef BTA_GATT_INCLUDED
  725. #if BLE_INCLUDED == TRUE
  726. #define BTA_GATT_INCLUDED TRUE
  727. #else
  728. #define BTA_GATT_INCLUDED FALSE
  729. #endif
  730. #endif
  731. #if BTA_GATT_INCLUDED == TRUE && BLE_INCLUDED == FALSE
  732. #error "can't have GATT without BLE"
  733. #endif
  734. #ifndef BLE_LLT_INCLUDED
  735. #define BLE_LLT_INCLUDED TRUE
  736. #endif
  737. #ifndef ATT_INCLUDED
  738. #define ATT_INCLUDED TRUE
  739. #endif
  740. #ifndef ATT_DEBUG
  741. #define ATT_DEBUG FALSE//TRUE
  742. #endif
  743. #ifndef BLE_PERIPHERAL_MODE_SUPPORT
  744. #define BLE_PERIPHERAL_MODE_SUPPORT TRUE
  745. #endif
  746. #ifndef BLE_DELAY_REQUEST_ENC
  747. /* This flag is to work around IPHONE problem, We need to wait for iPhone ready
  748. before send encryption request to iPhone */
  749. #define BLE_DELAY_REQUEST_ENC FALSE
  750. #endif
  751. #ifndef GAP_TRANSPORT_SUPPORTED
  752. #define GAP_TRANSPORT_SUPPORTED GATT_TRANSPORT_LE_BR_EDR
  753. #endif
  754. #ifndef GATTP_TRANSPORT_SUPPORTED
  755. #define GATTP_TRANSPORT_SUPPORTED GATT_TRANSPORT_LE_BR_EDR
  756. #endif
  757. #ifndef GATT_MAX_SR_PROFILES
  758. #define GATT_MAX_SR_PROFILES 8 /* max is 32 */
  759. #endif
  760. #ifndef GATT_MAX_APPS
  761. #define GATT_MAX_APPS 8 /* MAX is 32 note: 2 apps used internally GATT and GAP */
  762. #endif
  763. #ifndef GATT_MAX_PHY_CHANNEL
  764. #define GATT_MAX_PHY_CHANNEL 7
  765. #endif
  766. /* Used for conformance testing ONLY */
  767. #ifndef GATT_CONFORMANCE_TESTING
  768. #define GATT_CONFORMANCE_TESTING FALSE
  769. #endif
  770. /* number of background connection device allowence, ideally to be the same as WL size
  771. */
  772. #ifndef GATT_MAX_BG_CONN_DEV
  773. #define GATT_MAX_BG_CONN_DEV 8 /*MAX is 32*/
  774. #endif
  775. /******************************************************************************
  776. **
  777. ** GATT
  778. **
  779. ******************************************************************************/
  780. #ifndef GATTC_INCLUDED
  781. #if BLE_INCLUDED == TRUE
  782. #define GATTC_INCLUDED TRUE
  783. #else
  784. #define GATTC_INCLUDED FALSE
  785. #endif
  786. #endif
  787. #ifndef GATTS_INCLUDED
  788. #if BLE_INCLUDED == TRUE
  789. #define GATTS_INCLUDED TRUE
  790. #else
  791. #define GATTS_INCLUDED FALSE
  792. #endif
  793. #endif
  794. #if SMP_INCLUDED == TRUE && BLE_INCLUDED == FALSE
  795. #error "can't have SMP without BLE"
  796. #endif
  797. /******************************************************************************
  798. **
  799. ** SMP
  800. **
  801. ******************************************************************************/
  802. #ifndef SMP_INCLUDED
  803. #if BLE_INCLUDED == TRUE
  804. #define SMP_INCLUDED TRUE
  805. #else
  806. #define SMP_INCLUDED FALSE
  807. #endif
  808. #endif
  809. #if SMP_INCLUDED == TRUE && BLE_INCLUDED == FALSE
  810. #error "can't have SMP without BLE"
  811. #endif
  812. #ifndef SMP_DEBUG
  813. #define SMP_DEBUG FALSE
  814. #endif
  815. #ifndef SMP_DEFAULT_AUTH_REQ
  816. #define SMP_DEFAULT_AUTH_REQ SMP_AUTH_NB_ENC_ONLY
  817. #endif
  818. #ifndef SMP_MAX_ENC_KEY_SIZE
  819. #define SMP_MAX_ENC_KEY_SIZE 16
  820. #endif
  821. #ifndef SMP_MIN_ENC_KEY_SIZE
  822. #define SMP_MIN_ENC_KEY_SIZE 7
  823. #endif
  824. /* minimum link timeout after SMP pairing is done, leave room for key exchange
  825. and racing condition for the following service connection.
  826. Prefer greater than 0 second, and no less than default inactivity link idle
  827. timer(L2CAP_LINK_INACTIVITY_TOUT) in l2cap) */
  828. #ifndef SMP_LINK_TOUT_MIN
  829. #if (L2CAP_LINK_INACTIVITY_TOUT > 0)
  830. #define SMP_LINK_TOUT_MIN L2CAP_LINK_INACTIVITY_TOUT
  831. #else
  832. #define SMP_LINK_TOUT_MIN 2
  833. #endif
  834. #endif
  835. /******************************************************************************
  836. **
  837. ** SDP
  838. **
  839. ******************************************************************************/
  840. #ifndef SDP_INCLUDED
  841. #define SDP_INCLUDED TRUE
  842. #endif
  843. /* This is set to enable SDP server functionality. */
  844. #ifndef SDP_SERVER_ENABLED
  845. #if SDP_INCLUDED == TRUE
  846. #define SDP_SERVER_ENABLED TRUE
  847. #else
  848. #define SDP_SERVER_ENABLED FALSE
  849. #endif
  850. #endif
  851. /* This is set to enable SDP client functionality. */
  852. #ifndef SDP_CLIENT_ENABLED
  853. #if SDP_INCLUDED == TRUE
  854. #define SDP_CLIENT_ENABLED TRUE
  855. #else
  856. #define SDP_CLIENT_ENABLED FALSE
  857. #endif
  858. #endif
  859. /* The maximum number of SDP records the server can support. */
  860. #ifndef SDP_MAX_RECORDS
  861. #define SDP_MAX_RECORDS 6 /*max is 30*/
  862. #endif
  863. /* The maximum number of attributes in each record. */
  864. #ifndef SDP_MAX_REC_ATTR
  865. #define SDP_MAX_REC_ATTR 8
  866. #endif
  867. #ifndef SDP_MAX_PAD_LEN
  868. #define SDP_MAX_PAD_LEN 300
  869. #endif
  870. /* The maximum length, in bytes, of an attribute. */
  871. #ifndef SDP_MAX_ATTR_LEN
  872. #define SDP_MAX_ATTR_LEN 400
  873. #endif
  874. /* The maximum number of attribute filters supported by SDP databases. */
  875. #ifndef SDP_MAX_ATTR_FILTERS
  876. #define SDP_MAX_ATTR_FILTERS 15
  877. #endif
  878. /* The maximum number of UUID filters supported by SDP databases. */
  879. #ifndef SDP_MAX_UUID_FILTERS
  880. #define SDP_MAX_UUID_FILTERS 3
  881. #endif
  882. /* The maximum number of record handles retrieved in a search. */
  883. #ifndef SDP_MAX_DISC_SERVER_RECS
  884. #define SDP_MAX_DISC_SERVER_RECS 21
  885. #endif
  886. /* The size of a scratchpad buffer, in bytes, for storing the response to an attribute request. */
  887. #ifndef SDP_MAX_LIST_BYTE_COUNT
  888. #define SDP_MAX_LIST_BYTE_COUNT 4096
  889. #endif
  890. /* The maximum number of parameters in an SDP protocol element. */
  891. #ifndef SDP_MAX_PROTOCOL_PARAMS
  892. #define SDP_MAX_PROTOCOL_PARAMS 2
  893. #endif
  894. /* The maximum number of simultaneous client and server connections. */
  895. #ifndef SDP_MAX_CONNECTIONS
  896. #define SDP_MAX_CONNECTIONS 2 // 4
  897. #endif
  898. /* The MTU size for the L2CAP configuration. */
  899. #ifndef SDP_MTU_SIZE
  900. #define SDP_MTU_SIZE 672
  901. #endif
  902. /* The flush timeout for the L2CAP configuration. */
  903. #ifndef SDP_FLUSH_TO
  904. #define SDP_FLUSH_TO 0xFFFF
  905. #endif
  906. /* The name for security authorization. */
  907. #ifndef SDP_SERVICE_NAME
  908. #define SDP_SERVICE_NAME "Service Discovery"
  909. #endif
  910. /* The security level for BTM. */
  911. #ifndef SDP_SECURITY_LEVEL
  912. #define SDP_SECURITY_LEVEL BTM_SEC_NONE
  913. #endif
  914. /******************************************************************************
  915. **
  916. ** RFCOMM
  917. **
  918. ******************************************************************************/
  919. #ifndef RFCOMM_INCLUDED
  920. #define RFCOMM_INCLUDED FALSE
  921. #endif
  922. /* The maximum number of ports supported. */
  923. #ifndef MAX_RFC_PORTS
  924. #define MAX_RFC_PORTS 16 /*max is 30*/
  925. #endif
  926. /* The maximum simultaneous links to different devices. */
  927. #ifndef MAX_ACL_CONNECTIONS
  928. #define MAX_BD_CONNECTIONS 3 /*max is 7*/
  929. #else
  930. #define MAX_BD_CONNECTIONS MAX_ACL_CONNECTIONS
  931. #endif
  932. /* The port receive queue low watermark level, in bytes. */
  933. #ifndef PORT_RX_LOW_WM
  934. #define PORT_RX_LOW_WM (BTA_RFC_MTU_SIZE * PORT_RX_BUF_LOW_WM)
  935. #endif
  936. /* The port receive queue high watermark level, in bytes. */
  937. #ifndef PORT_RX_HIGH_WM
  938. #define PORT_RX_HIGH_WM (BTA_RFC_MTU_SIZE * PORT_RX_BUF_HIGH_WM)
  939. #endif
  940. /* The port receive queue critical watermark level, in bytes. */
  941. #ifndef PORT_RX_CRITICAL_WM
  942. #define PORT_RX_CRITICAL_WM (BTA_RFC_MTU_SIZE * PORT_RX_BUF_CRITICAL_WM)
  943. #endif
  944. /* The port receive queue low watermark level, in number of buffers. */
  945. #ifndef PORT_RX_BUF_LOW_WM
  946. #define PORT_RX_BUF_LOW_WM 4
  947. #endif
  948. /* The port receive queue high watermark level, in number of buffers. */
  949. #ifndef PORT_RX_BUF_HIGH_WM
  950. #define PORT_RX_BUF_HIGH_WM 10
  951. #endif
  952. /* The port receive queue critical watermark level, in number of buffers. */
  953. #ifndef PORT_RX_BUF_CRITICAL_WM
  954. #define PORT_RX_BUF_CRITICAL_WM 15
  955. #endif
  956. /* The port transmit queue high watermark level, in bytes. */
  957. #ifndef PORT_TX_HIGH_WM
  958. #define PORT_TX_HIGH_WM (BTA_RFC_MTU_SIZE * PORT_TX_BUF_HIGH_WM)
  959. #endif
  960. /* The port transmit queue critical watermark level, in bytes. */
  961. #ifndef PORT_TX_CRITICAL_WM
  962. #define PORT_TX_CRITICAL_WM (BTA_RFC_MTU_SIZE * PORT_TX_BUF_CRITICAL_WM)
  963. #endif
  964. /* The port transmit queue high watermark level, in number of buffers. */
  965. #ifndef PORT_TX_BUF_HIGH_WM
  966. #define PORT_TX_BUF_HIGH_WM 10
  967. #endif
  968. /* The port transmit queue high watermark level, in number of buffers. */
  969. #ifndef PORT_TX_BUF_CRITICAL_WM
  970. #define PORT_TX_BUF_CRITICAL_WM 15
  971. #endif
  972. /* The RFCOMM multiplexer preferred flow control mechanism. */
  973. #ifndef PORT_FC_DEFAULT
  974. #define PORT_FC_DEFAULT PORT_FC_CREDIT
  975. #endif
  976. /* The maximum number of credits receiver sends to peer when using credit-based flow control. */
  977. #ifndef PORT_CREDIT_RX_MAX
  978. #define PORT_CREDIT_RX_MAX 16
  979. #endif
  980. /* The credit low watermark level. */
  981. #ifndef PORT_CREDIT_RX_LOW
  982. #define PORT_CREDIT_RX_LOW 8
  983. #endif
  984. /* if application like BTA, Java or script test engine is running on other than BTU thread, */
  985. /* PORT_SCHEDULE_LOCK shall be defined as GKI_sched_lock() or GKI_disable() */
  986. #ifndef PORT_SCHEDULE_LOCK
  987. #define PORT_SCHEDULE_LOCK GKI_disable()
  988. #endif
  989. /* if application like BTA, Java or script test engine is running on other than BTU thread, */
  990. /* PORT_SCHEDULE_LOCK shall be defined as GKI_sched_unlock() or GKI_enable() */
  991. #ifndef PORT_SCHEDULE_UNLOCK
  992. #define PORT_SCHEDULE_UNLOCK GKI_enable()
  993. #endif
  994. /******************************************************************************
  995. **
  996. ** OBEX
  997. **
  998. ******************************************************************************/
  999. #define OBX_14_INCLUDED FALSE
  1000. /* The maximum number of registered servers. */
  1001. #ifndef OBX_NUM_SERVERS
  1002. #define OBX_NUM_SERVERS 12
  1003. #endif
  1004. /* The maximum number of active clients. */
  1005. #ifndef OBX_NUM_CLIENTS
  1006. #define OBX_NUM_CLIENTS 8
  1007. #endif
  1008. /* This option is application when OBX_14_INCLUDED=TRUE
  1009. Pool ID where to reassemble the SDU.
  1010. This Pool will allow buffers to be used that are larger than
  1011. the L2CAP_MAX_MTU. */
  1012. #ifndef OBX_USER_RX_POOL_ID
  1013. #define OBX_USER_RX_POOL_ID OBX_LRG_DATA_POOL_ID
  1014. #endif
  1015. /* This option is application when OBX_14_INCLUDED=TRUE
  1016. Pool ID where to hold the SDU.
  1017. This Pool will allow buffers to be used that are larger than
  1018. the L2CAP_MAX_MTU. */
  1019. #ifndef OBX_USER_TX_POOL_ID
  1020. #define OBX_USER_TX_POOL_ID OBX_LRG_DATA_POOL_ID
  1021. #endif
  1022. /* This option is application when OBX_14_INCLUDED=TRUE
  1023. GKI Buffer Pool ID used to hold MPS segments during SDU reassembly
  1024. */
  1025. #ifndef OBX_FCR_RX_POOL_ID
  1026. #define OBX_FCR_RX_POOL_ID HCI_ACL_POOL_ID
  1027. #endif
  1028. /* This option is application when OBX_14_INCLUDED=TRUE
  1029. GKI Buffer Pool ID used to hold MPS segments used in (re)transmissions.
  1030. L2CAP_DEFAULT_ERM_POOL_ID is specified to use the HCI ACL data pool.
  1031. Note: This pool needs to have enough buffers to hold two times the window size negotiated
  1032. in the L2CA_SetFCROptions (2 * tx_win_size) to allow for retransmissions.
  1033. The size of each buffer must be able to hold the maximum MPS segment size passed in
  1034. L2CA_SetFCROptions plus BT_HDR (8) + HCI preamble (4) + L2CAP_MIN_OFFSET (11 - as of BT 2.1 + EDR Spec).
  1035. */
  1036. #ifndef OBX_FCR_TX_POOL_ID
  1037. #define OBX_FCR_TX_POOL_ID HCI_ACL_POOL_ID
  1038. #endif
  1039. /* This option is application when OBX_14_INCLUDED=TRUE
  1040. Size of the transmission window when using enhanced retransmission mode. Not used
  1041. in basic and streaming modes. Range: 1 - 63
  1042. */
  1043. #ifndef OBX_FCR_OPT_TX_WINDOW_SIZE_BR_EDR
  1044. #define OBX_FCR_OPT_TX_WINDOW_SIZE_BR_EDR 20
  1045. #endif
  1046. /* This option is application when OBX_14_INCLUDED=TRUE
  1047. Number of transmission attempts for a single I-Frame before taking
  1048. Down the connection. Used In ERTM mode only. Value is Ignored in basic and
  1049. Streaming modes.
  1050. Range: 0, 1-0xFF
  1051. 0 - infinite retransmissions
  1052. 1 - single transmission
  1053. */
  1054. #ifndef OBX_FCR_OPT_MAX_TX_B4_DISCNT
  1055. #define OBX_FCR_OPT_MAX_TX_B4_DISCNT 20
  1056. #endif
  1057. /* This option is application when OBX_14_INCLUDED=TRUE
  1058. Retransmission Timeout
  1059. Range: Minimum 2000 (2 secs) on BR/EDR when supporting PBF.
  1060. */
  1061. #ifndef OBX_FCR_OPT_RETX_TOUT
  1062. #define OBX_FCR_OPT_RETX_TOUT 2000
  1063. #endif
  1064. /* This option is application when OBX_14_INCLUDED=TRUE
  1065. Monitor Timeout
  1066. Range: Minimum 12000 (12 secs) on BR/EDR when supporting PBF.
  1067. */
  1068. #ifndef OBX_FCR_OPT_MONITOR_TOUT
  1069. #define OBX_FCR_OPT_MONITOR_TOUT 12000
  1070. #endif
  1071. /* This option is application when OBX_14_INCLUDED=TRUE
  1072. Maximum PDU payload size.
  1073. Suggestion: The maximum amount of data that will fit into a 3-DH5 packet.
  1074. Range: 2 octets
  1075. */
  1076. #ifndef OBX_FCR_OPT_MAX_PDU_SIZE
  1077. #define OBX_FCR_OPT_MAX_PDU_SIZE L2CAP_MPS_OVER_BR_EDR
  1078. #endif
  1079. /******************************************************************************
  1080. **
  1081. ** BNEP
  1082. **
  1083. ******************************************************************************/
  1084. #ifndef BNEP_INCLUDED
  1085. #define BNEP_INCLUDED FALSE//TRUE
  1086. #endif
  1087. /* BNEP status API call is used mainly to get the L2CAP handle */
  1088. #ifndef BNEP_SUPPORTS_STATUS_API
  1089. #define BNEP_SUPPORTS_STATUS_API FALSE//TRUE
  1090. #endif
  1091. /*
  1092. ** When BNEP connection changes roles after the connection is established
  1093. ** we will do an authentication check again on the new role
  1094. */
  1095. #ifndef BNEP_DO_AUTH_FOR_ROLE_SWITCH
  1096. #define BNEP_DO_AUTH_FOR_ROLE_SWITCH FALSE//TRUE
  1097. #endif
  1098. /* Maximum number of protocol filters supported. */
  1099. #ifndef BNEP_MAX_PROT_FILTERS
  1100. #define BNEP_MAX_PROT_FILTERS 5
  1101. #endif
  1102. /* Maximum number of multicast filters supported. */
  1103. #ifndef BNEP_MAX_MULTI_FILTERS
  1104. #define BNEP_MAX_MULTI_FILTERS 5
  1105. #endif
  1106. /* Minimum MTU size. */
  1107. #ifndef BNEP_MIN_MTU_SIZE
  1108. #define BNEP_MIN_MTU_SIZE L2CAP_MTU_SIZE
  1109. #endif
  1110. /* Preferred MTU size. */
  1111. #ifndef BNEP_MTU_SIZE
  1112. #define BNEP_MTU_SIZE BNEP_MIN_MTU_SIZE
  1113. #endif
  1114. /* Maximum number of buffers allowed in transmit data queue. */
  1115. #ifndef BNEP_MAX_XMITQ_DEPTH
  1116. #define BNEP_MAX_XMITQ_DEPTH 20
  1117. #endif
  1118. /* Maximum number BNEP of connections supported. */
  1119. #ifndef BNEP_MAX_CONNECTIONS
  1120. #define BNEP_MAX_CONNECTIONS 7
  1121. #endif
  1122. /******************************************************************************
  1123. **
  1124. ** AVDTP
  1125. **
  1126. ******************************************************************************/
  1127. #ifndef AVDT_INCLUDED
  1128. #define AVDT_INCLUDED TRUE
  1129. #endif
  1130. /* Include reporting capability in AVDTP */
  1131. #ifndef AVDT_REPORTING
  1132. #define AVDT_REPORTING TRUE
  1133. #endif
  1134. /* Include multiplexing capability in AVDTP */
  1135. #ifndef AVDT_MULTIPLEXING
  1136. #define AVDT_MULTIPLEXING TRUE
  1137. #endif
  1138. /* Number of simultaneous links to different peer devices. */
  1139. #ifndef AVDT_NUM_LINKS
  1140. #define AVDT_NUM_LINKS 2
  1141. #endif
  1142. /* Number of simultaneous stream endpoints. */
  1143. #ifndef AVDT_NUM_SEPS
  1144. #define AVDT_NUM_SEPS 3
  1145. #endif
  1146. /* Number of transport channels setup per media stream(audio or video) */
  1147. #ifndef AVDT_NUM_CHANNELS
  1148. #if AVDT_REPORTING == TRUE
  1149. /* signaling, media and reporting channels */
  1150. #define AVDT_NUM_CHANNELS 3
  1151. #else
  1152. /* signaling and media channels */
  1153. #define AVDT_NUM_CHANNELS 2
  1154. #endif // AVDT_REPORTING
  1155. #endif // AVDT_NUM_CHANNELS
  1156. /* Number of transport channels setup by AVDT for all media streams
  1157. * AVDT_NUM_CHANNELS * Number of simultaneous streams.
  1158. */
  1159. #ifndef AVDT_NUM_TC_TBL
  1160. #define AVDT_NUM_TC_TBL 6
  1161. #endif
  1162. /* Maximum size in bytes of the codec capabilities information element. */
  1163. #ifndef AVDT_CODEC_SIZE
  1164. #define AVDT_CODEC_SIZE 10
  1165. #endif
  1166. /* Maximum size in bytes of the content protection information element. */
  1167. #ifndef AVDT_PROTECT_SIZE
  1168. #define AVDT_PROTECT_SIZE 90
  1169. #endif
  1170. /* Maximum number of GKI buffers in the fragment queue (for video frames).
  1171. * Must be less than the number of buffers in the buffer pool of size AVDT_DATA_POOL_SIZE */
  1172. #ifndef AVDT_MAX_FRAG_COUNT
  1173. #define AVDT_MAX_FRAG_COUNT 15
  1174. #endif
  1175. /******************************************************************************
  1176. **
  1177. ** PAN
  1178. **
  1179. ******************************************************************************/
  1180. #ifndef PAN_INCLUDED
  1181. #define PAN_INCLUDED FALSE//TRUE
  1182. #endif
  1183. /* This will enable the PANU role */
  1184. #ifndef PAN_SUPPORTS_ROLE_PANU
  1185. #define PAN_SUPPORTS_ROLE_PANU FALSE//TRUE
  1186. #endif
  1187. /* This will enable the GN role */
  1188. #ifndef PAN_SUPPORTS_ROLE_GN
  1189. #define PAN_SUPPORTS_ROLE_GN FALSE//TRUE
  1190. #endif
  1191. /* This will enable the NAP role */
  1192. #ifndef PAN_SUPPORTS_ROLE_NAP
  1193. #define PAN_SUPPORTS_ROLE_NAP FALSE//TRUE
  1194. #endif
  1195. /* This is just for debugging purposes */
  1196. #ifndef PAN_SUPPORTS_DEBUG_DUMP
  1197. #define PAN_SUPPORTS_DEBUG_DUMP FALSE//TRUE
  1198. #endif
  1199. /* Maximum number of PAN connections allowed */
  1200. #ifndef MAX_PAN_CONNS
  1201. #define MAX_PAN_CONNS 7
  1202. #endif
  1203. /* Default service name for NAP role */
  1204. #ifndef PAN_NAP_DEFAULT_SERVICE_NAME
  1205. #define PAN_NAP_DEFAULT_SERVICE_NAME "Network Access Point Service"
  1206. #endif
  1207. /* Default service name for GN role */
  1208. #ifndef PAN_GN_DEFAULT_SERVICE_NAME
  1209. #define PAN_GN_DEFAULT_SERVICE_NAME "Group Network Service"
  1210. #endif
  1211. /* Default service name for PANU role */
  1212. #ifndef PAN_PANU_DEFAULT_SERVICE_NAME
  1213. #define PAN_PANU_DEFAULT_SERVICE_NAME "PAN User Service"
  1214. #endif
  1215. /* Default description for NAP role service */
  1216. #ifndef PAN_NAP_DEFAULT_DESCRIPTION
  1217. #define PAN_NAP_DEFAULT_DESCRIPTION "NAP"
  1218. #endif
  1219. /* Default description for GN role service */
  1220. #ifndef PAN_GN_DEFAULT_DESCRIPTION
  1221. #define PAN_GN_DEFAULT_DESCRIPTION "GN"
  1222. #endif
  1223. /* Default description for PANU role service */
  1224. #ifndef PAN_PANU_DEFAULT_DESCRIPTION
  1225. #define PAN_PANU_DEFAULT_DESCRIPTION "PANU"
  1226. #endif
  1227. /* Default Security level for PANU role. */
  1228. #ifndef PAN_PANU_SECURITY_LEVEL
  1229. #define PAN_PANU_SECURITY_LEVEL 0
  1230. #endif
  1231. /* Default Security level for GN role. */
  1232. #ifndef PAN_GN_SECURITY_LEVEL
  1233. #define PAN_GN_SECURITY_LEVEL 0
  1234. #endif
  1235. /* Default Security level for NAP role. */
  1236. #ifndef PAN_NAP_SECURITY_LEVEL
  1237. #define PAN_NAP_SECURITY_LEVEL 0
  1238. #endif
  1239. /******************************************************************************
  1240. **
  1241. ** GAP
  1242. **
  1243. ******************************************************************************/
  1244. #ifndef GAP_INCLUDED
  1245. #define GAP_INCLUDED TRUE
  1246. #endif
  1247. /* This is set to enable use of GAP L2CAP connections. */
  1248. #ifndef GAP_CONN_INCLUDED
  1249. #if GAP_INCLUDED == TRUE
  1250. #define GAP_CONN_INCLUDED TRUE
  1251. #else
  1252. #define GAP_CONN_INCLUDED FALSE
  1253. #endif
  1254. #endif
  1255. /* This is set to enable posting event for data write */
  1256. #ifndef GAP_CONN_POST_EVT_INCLUDED
  1257. #define GAP_CONN_POST_EVT_INCLUDED FALSE
  1258. #endif
  1259. /* The maximum number of simultaneous GAP L2CAP connections. */
  1260. #ifndef GAP_MAX_CONNECTIONS
  1261. #define GAP_MAX_CONNECTIONS 10 // 30
  1262. #endif
  1263. /* keep the raw data received from SDP server in database. */
  1264. #ifndef SDP_RAW_DATA_INCLUDED
  1265. #define SDP_RAW_DATA_INCLUDED TRUE
  1266. #endif
  1267. /* Inquiry duration in 1.28 second units. */
  1268. #ifndef SDP_DEBUG
  1269. #define SDP_DEBUG TRUE
  1270. #endif
  1271. /******************************************************************************
  1272. **
  1273. ** HID
  1274. **
  1275. ******************************************************************************/
  1276. #ifndef HID_DEV_SUBCLASS
  1277. #define HID_DEV_SUBCLASS COD_MINOR_POINTING
  1278. #endif
  1279. #ifndef HID_CONTROL_POOL_ID
  1280. #define HID_CONTROL_POOL_ID 2
  1281. #endif
  1282. #ifndef HID_INTERRUPT_POOL_ID
  1283. #define HID_INTERRUPT_POOL_ID 2
  1284. #endif
  1285. /*************************************************************************
  1286. ** Definitions for Both HID-Host & Device
  1287. */
  1288. #ifndef HID_MAX_SVC_NAME_LEN
  1289. #define HID_MAX_SVC_NAME_LEN 32
  1290. #endif
  1291. #ifndef HID_MAX_SVC_DESCR_LEN
  1292. #define HID_MAX_SVC_DESCR_LEN 32
  1293. #endif
  1294. #ifndef HID_MAX_PROV_NAME_LEN
  1295. #define HID_MAX_PROV_NAME_LEN 32
  1296. #endif
  1297. /*************************************************************************
  1298. ** Definitions for HID-Host
  1299. */
  1300. #ifndef HID_HOST_INCLUDED
  1301. #define HID_HOST_INCLUDED FALSE//TRUE
  1302. #endif
  1303. #ifndef HID_HOST_MAX_DEVICES
  1304. #define HID_HOST_MAX_DEVICES 7
  1305. #endif
  1306. #ifndef HID_HOST_MTU
  1307. #define HID_HOST_MTU 640
  1308. #endif
  1309. #ifndef HID_HOST_FLUSH_TO
  1310. #define HID_HOST_FLUSH_TO 0xffff
  1311. #endif
  1312. #ifndef HID_HOST_MAX_CONN_RETRY
  1313. #define HID_HOST_MAX_CONN_RETRY (3)
  1314. #endif
  1315. #ifndef HID_HOST_REPAGE_WIN
  1316. #define HID_HOST_REPAGE_WIN (2)
  1317. #endif
  1318. /*************************************************************************
  1319. * A2DP Definitions
  1320. */
  1321. #ifndef A2D_INCLUDED
  1322. #define A2D_INCLUDED FALSE//TRUE
  1323. #endif
  1324. /******************************************************************************
  1325. **
  1326. ** AVCTP
  1327. **
  1328. ******************************************************************************/
  1329. /* Number of simultaneous ACL links to different peer devices. */
  1330. #ifndef AVCT_NUM_LINKS
  1331. #define AVCT_NUM_LINKS 2
  1332. #endif
  1333. /* Number of simultaneous AVCTP connections. */
  1334. #ifndef AVCT_NUM_CONN
  1335. #define AVCT_NUM_CONN 3
  1336. #endif
  1337. /******************************************************************************
  1338. **
  1339. ** AVRCP
  1340. **
  1341. ******************************************************************************/
  1342. #ifndef AVRC_INCLUDED
  1343. #define AVRC_INCLUDED TRUE
  1344. #endif
  1345. #ifndef AVRC_METADATA_INCLUDED
  1346. #if AVRC_INCLUDED == TRUE
  1347. #define AVRC_METADATA_INCLUDED TRUE
  1348. #else
  1349. #define AVRC_METADATA_INCLUDED FALSE
  1350. #endif
  1351. #endif
  1352. #ifndef AVRC_ADV_CTRL_INCLUDED
  1353. #if AVRC_INCLUDED == TRUE
  1354. #define AVRC_ADV_CTRL_INCLUDED TRUE
  1355. #else
  1356. #define AVRC_ADV_CTRL_INCLUDED FALSE
  1357. #endif
  1358. #endif
  1359. #ifndef AVRC_CTLR_INCLUDED
  1360. #if AVRC_INCLUDED == TRUE
  1361. #define AVRC_CTLR_INCLUDED TRUE
  1362. #else
  1363. #define AVRC_CTLR_INCLUDED FALSE
  1364. #endif
  1365. #endif
  1366. /******************************************************************************
  1367. **
  1368. ** MCAP
  1369. **
  1370. ******************************************************************************/
  1371. #ifndef MCA_INCLUDED
  1372. #define MCA_INCLUDED FALSE
  1373. #endif
  1374. /* The MTU size for the L2CAP configuration on control channel. 48 is the minimal */
  1375. #ifndef MCA_CTRL_MTU
  1376. #define MCA_CTRL_MTU 60
  1377. #endif
  1378. /* The maximum number of registered MCAP instances. */
  1379. #ifndef MCA_NUM_REGS
  1380. #define MCA_NUM_REGS 12
  1381. #endif
  1382. /* The maximum number of control channels (to difference devices) per registered MCAP instances. */
  1383. #ifndef MCA_NUM_LINKS
  1384. #define MCA_NUM_LINKS 3
  1385. #endif
  1386. /* The maximum number of MDEP (including HDP echo) per registered MCAP instances. */
  1387. #ifndef MCA_NUM_DEPS
  1388. #define MCA_NUM_DEPS 13
  1389. #endif
  1390. /* The maximum number of MDL link per control channel. */
  1391. #ifndef MCA_NUM_MDLS
  1392. #define MCA_NUM_MDLS 4
  1393. #endif
  1394. /* Pool ID where to reassemble the SDU. */
  1395. #ifndef MCA_USER_RX_POOL_ID
  1396. #define MCA_USER_RX_POOL_ID HCI_ACL_POOL_ID
  1397. #endif
  1398. /* Pool ID where to hold the SDU. */
  1399. #ifndef MCA_USER_TX_POOL_ID
  1400. #define MCA_USER_TX_POOL_ID HCI_ACL_POOL_ID
  1401. #endif
  1402. /*
  1403. GKI Buffer Pool ID used to hold MPS segments during SDU reassembly
  1404. */
  1405. #ifndef MCA_FCR_RX_POOL_ID
  1406. #define MCA_FCR_RX_POOL_ID HCI_ACL_POOL_ID
  1407. #endif
  1408. /*
  1409. GKI Buffer Pool ID used to hold MPS segments used in (re)transmissions.
  1410. L2CAP_DEFAULT_ERM_POOL_ID is specified to use the HCI ACL data pool.
  1411. Note: This pool needs to have enough buffers to hold two times the window size negotiated
  1412. in the tL2CAP_FCR_OPTIONS (2 * tx_win_size) to allow for retransmissions.
  1413. The size of each buffer must be able to hold the maximum MPS segment size passed in
  1414. tL2CAP_FCR_OPTIONS plus BT_HDR (8) + HCI preamble (4) + L2CAP_MIN_OFFSET (11 - as of BT 2.1 + EDR Spec).
  1415. */
  1416. #ifndef MCA_FCR_TX_POOL_ID
  1417. #define MCA_FCR_TX_POOL_ID HCI_ACL_POOL_ID
  1418. #endif
  1419. /* MCAP control channel FCR Option:
  1420. Size of the transmission window when using enhanced retransmission mode.
  1421. 1 is defined by HDP specification for control channel.
  1422. */
  1423. #ifndef MCA_FCR_OPT_TX_WINDOW_SIZE
  1424. #define MCA_FCR_OPT_TX_WINDOW_SIZE 1
  1425. #endif
  1426. /* MCAP control channel FCR Option:
  1427. Number of transmission attempts for a single I-Frame before taking
  1428. Down the connection. Used In ERTM mode only. Value is Ignored in basic and
  1429. Streaming modes.
  1430. Range: 0, 1-0xFF
  1431. 0 - infinite retransmissions
  1432. 1 - single transmission
  1433. */
  1434. #ifndef MCA_FCR_OPT_MAX_TX_B4_DISCNT
  1435. #define MCA_FCR_OPT_MAX_TX_B4_DISCNT 20
  1436. #endif
  1437. /* MCAP control channel FCR Option: Retransmission Timeout
  1438. The AVRCP specification set a value in the range of 300 - 2000 ms
  1439. Timeout (in msecs) to detect Lost I-Frames. Only used in Enhanced retransmission mode.
  1440. Range: Minimum 2000 (2 secs) when supporting PBF.
  1441. */
  1442. #ifndef MCA_FCR_OPT_RETX_TOUT
  1443. #define MCA_FCR_OPT_RETX_TOUT 2000
  1444. #endif
  1445. /* MCAP control channel FCR Option: Monitor Timeout
  1446. The AVRCP specification set a value in the range of 300 - 2000 ms
  1447. Timeout (in msecs) to detect Lost S-Frames. Only used in Enhanced retransmission mode.
  1448. Range: Minimum 12000 (12 secs) when supporting PBF.
  1449. */
  1450. #ifndef MCA_FCR_OPT_MONITOR_TOUT
  1451. #define MCA_FCR_OPT_MONITOR_TOUT 12000
  1452. #endif
  1453. /* MCAP control channel FCR Option: Maximum PDU payload size.
  1454. The maximum number of payload octets that the local device can receive in a single PDU.
  1455. */
  1456. #ifndef MCA_FCR_OPT_MPS_SIZE
  1457. #define MCA_FCR_OPT_MPS_SIZE 1000
  1458. #endif
  1459. /* Shared transport */
  1460. #ifndef NFC_SHARED_TRANSPORT_ENABLED
  1461. #define NFC_SHARED_TRANSPORT_ENABLED FALSE
  1462. #endif
  1463. /******************************************************************************
  1464. **
  1465. ** Sleep Mode (Low Power Mode)
  1466. **
  1467. ******************************************************************************/
  1468. #ifndef HCILP_INCLUDED
  1469. #define HCILP_INCLUDED FALSE//TRUE
  1470. #endif
  1471. /******************************************************************************
  1472. **
  1473. ** APPL - Application Task
  1474. **
  1475. ******************************************************************************/
  1476. #define L2CAP_FEATURE_REQ_ID 73
  1477. #define L2CAP_FEATURE_RSP_ID 173
  1478. /******************************************************************************
  1479. **
  1480. ** BTA
  1481. **
  1482. ******************************************************************************/
  1483. /* BTA EIR canned UUID list (default is dynamic) */
  1484. #ifndef BTA_EIR_CANNED_UUID_LIST
  1485. #define BTA_EIR_CANNED_UUID_LIST FALSE
  1486. #endif
  1487. /* Number of supported customer UUID in EIR */
  1488. #ifndef BTA_EIR_SERVER_NUM_CUSTOM_UUID
  1489. #define BTA_EIR_SERVER_NUM_CUSTOM_UUID 8
  1490. #endif
  1491. /* CHLD override for bluedroid */
  1492. #ifndef BTA_AG_CHLD_VAL_ECC
  1493. #define BTA_AG_CHLD_VAL_ECC "(0,1,1x,2,2x,3)"
  1494. #endif
  1495. #ifndef BTA_AG_CHLD_VAL
  1496. #define BTA_AG_CHLD_VAL "(0,1,2,3)"
  1497. #endif
  1498. /* Set the CIND to match HFP 1.5 */
  1499. #ifndef BTA_AG_CIND_INFO
  1500. #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))"
  1501. #endif
  1502. #ifndef BTA_DM_AVOID_A2DP_ROLESWITCH_ON_INQUIRY
  1503. #define BTA_DM_AVOID_A2DP_ROLESWITCH_ON_INQUIRY FALSE//TRUE
  1504. #endif
  1505. /******************************************************************************
  1506. **
  1507. ** Tracing: Include trace header file here.
  1508. **
  1509. ******************************************************************************/
  1510. /* Enable/disable BTSnoop memory logging */
  1511. #ifndef BTSNOOP_MEM
  1512. #define BTSNOOP_MEM FALSE//TRUE
  1513. #endif
  1514. #include "bt_trace.h"
  1515. #endif /* BT_TARGET_H */