| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859 |
- /******************************************************************************
- *
- * Copyright (c) 2014 The Android Open Source Project
- * Copyright (C) 1999-2012 Broadcom Corporation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at:
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ******************************************************************************/
- #ifndef BT_TARGET_H
- #define BT_TARGET_H
- #ifndef BUILDCFG
- #define BUILDCFG
- #endif
- /*
- #if !defined(HAS_BDROID_BUILDCFG) && !defined(HAS_NO_BDROID_BUILDCFG)
- #error "An Android.mk file did not include bdroid_CFLAGS and possibly not bdorid_C_INCLUDES"
- #endif
- */
- #ifdef HAS_BDROID_BUILDCFG
- #include "bdroid_buildcfg.h"
- #endif
- #include "sdkconfig.h"
- #include "bt_types.h" /* This must be defined AFTER buildcfg.h */
- /* Include common GKI definitions used by this platform */
- #include "gki_target.h"
- #include "dyn_mem.h" /* defines static and/or dynamic memory for components */
- #if CONFIG_CLASSIC_BT_ENABLED
- #define BTA_SDP_INCLUDED TRUE
- #define BTA_PAN_INCLUDED FALSE
- #define BTA_HH_INCLUDED FALSE
- #define BTA_AR_INCLUDED TRUE
- #define BTA_AV_INCLUDED TRUE
- #define BTA_AV_SINK_INCLUDED TRUE
- #define SDP_INCLUDED TRUE
- #define RFCOMM_INCLUDED FALSE
- #define PAN_INCLUDED FALSE
- #define HID_HOST_INCLUDED FALSE
- #define AVDT_INCLUDED TRUE
- #define A2D_INCLUDED TRUE
- #define AVCT_INCLUDED TRUE
- #define AVRC_INCLUDED TRUE
- #define SBC_DEC_INCLUDED TRUE
- #define SBC_ENC_INCLUDED FALSE
- #define MCA_INCLUDED FALSE
- #define BTC_SM_INCLUDED TRUE
- #define BTC_PRF_QUEUE_INCLUDED TRUE
- #define BTC_GAP_BT_INCLUDED TRUE
- #define BTC_AV_INCLUDED TRUE
- #else /* #if CONFIG_CLASSIC_BT_ENABLED */
- #define BTA_SDP_INCLUDED FALSE
- #define BTA_PAN_INCLUDED FALSE
- #define BTA_HH_INCLUDED FALSE
- #define BTA_AR_INCLUDED FALSE
- #define BTA_AV_INCLUDED FALSE
- #define BTA_AV_SINK_INCLUDED FALSE
- #define SDP_INCLUDED FALSE
- #define RFCOMM_INCLUDED FALSE
- #define PAN_INCLUDED FALSE
- #define HID_HOST_INCLUDED FALSE
- #define AVDT_INCLUDED FALSE
- #define A2D_INCLUDED FALSE
- #define AVCT_INCLUDED FALSE
- #define AVRC_INCLUDED FALSE
- #define SBC_DEC_INCLUDED FALSE
- #define SBC_ENC_INCLUDED FALSE
- #define MCA_INCLUDED FALSE
- #define BTC_SM_INCLUDED FALSE
- #define BTC_PRF_QUEUE_INCLUDED FALSE
- #define BTC_GAP_BT_INCLUDED FALSE
- #define BTC_AV_INCLUDED FALSE
- #endif /* #if CONFIG_CLASSIC_BT_ENABLED */
- //------------------Added from bdroid_buildcfg.h---------------------
- #ifndef L2CAP_EXTFEA_SUPPORTED_MASK
- #define L2CAP_EXTFEA_SUPPORTED_MASK (L2CAP_EXTFEA_ENH_RETRANS | L2CAP_EXTFEA_STREAM_MODE | L2CAP_EXTFEA_NO_CRC | L2CAP_EXTFEA_FIXED_CHNLS)
- #endif
- #ifndef BTUI_OPS_FORMATS
- #define BTUI_OPS_FORMATS (BTA_OP_VCARD21_MASK | BTA_OP_ANY_MASK)
- #endif
- #ifndef BTA_RFC_MTU_SIZE
- #define BTA_RFC_MTU_SIZE (L2CAP_MTU_SIZE-L2CAP_MIN_OFFSET-RFCOMM_DATA_OVERHEAD)
- #endif
- #ifndef SBC_NO_PCM_CPY_OPTION
- #define SBC_NO_PCM_CPY_OPTION FALSE
- #endif
- #ifndef BT_APP_DEMO
- #define BT_APP_DEMO TRUE
- #endif
- #ifndef BTIF_INCLUDED
- #define BTIF_INCLUDED FALSE
- #endif
- #ifndef BTA_INCLUDED
- #define BTA_INCLUDED TRUE
- #endif
- #ifndef BTA_PAN_INCLUDED
- #define BTA_PAN_INCLUDED FALSE//TRUE
- #endif
- #ifndef BTA_HH_INCLUDED
- #define BTA_HH_INCLUDED FALSE//TRUE
- #endif
- #ifndef BTA_HH_ROLE
- #define BTA_HH_ROLE BTA_MASTER_ROLE_PREF
- #endif
- #ifndef BTA_HH_LE_INCLUDED
- #define BTA_HH_LE_INCLUDED FALSE//TRUE
- #endif
- #ifndef BTA_AR_INCLUDED
- #define BTA_AR_INCLUDED TRUE//TRUE
- #endif
- #ifndef BTA_AV_INCLUDED
- #define BTA_AV_INCLUDED TRUE//TRUE
- #endif
- #ifndef BTA_AV_SINK_INCLUDED
- #define BTA_AV_SINK_INCLUDED TRUE//FALSE
- #endif
- #ifndef BTA_DISABLE_DELAY
- #define BTA_DISABLE_DELAY 200 /* in milliseconds */
- #endif
- // If the next wakeup time is less than this threshold, we should acquire
- // a wakelock instead of setting a wake alarm so we're not bouncing in
- // and out of suspend frequently.
- // in millisecond
- // TODO(zachoverflow): reinstate in alarm code
- #ifndef GKI_TIMER_INTERVAL_FOR_WAKELOCK
- #define GKI_TIMER_INTERVAL_FOR_WAKELOCK 3000
- #endif
- #ifndef BTA_SYS_TIMER_PERIOD
- #define BTA_SYS_TIMER_PERIOD 100
- #endif
- #ifndef SBC_FOR_EMBEDDED_LINUX
- #define SBC_FOR_EMBEDDED_LINUX TRUE
- #endif
- #ifndef AVDT_VERSION
- #define AVDT_VERSION 0x0102
- #endif
- #ifndef BTA_AG_AT_MAX_LEN
- #define BTA_AG_AT_MAX_LEN 512
- #endif
- #ifndef BTA_AVRCP_FF_RW_SUPPORT
- #define BTA_AVRCP_FF_RW_SUPPORT FALSE//TRUE
- #endif
- #ifndef BTA_AG_SCO_PKT_TYPES
- #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)
- #endif
- #ifndef BTA_AV_RET_TOUT
- #define BTA_AV_RET_TOUT 15
- #endif
- #ifndef PORCHE_PAIRING_CONFLICT
- #define PORCHE_PAIRING_CONFLICT TRUE
- #endif
- #ifndef BTA_AV_CO_CP_SCMS_T
- #define BTA_AV_CO_CP_SCMS_T FALSE//FALSE
- #endif
- /* This feature is used to eanble interleaved scan*/
- #ifndef BTA_HOST_INTERLEAVE_SEARCH
- #define BTA_HOST_INTERLEAVE_SEARCH FALSE//FALSE
- #endif
- #ifndef BT_USE_TRACES
- #define BT_USE_TRACES TRUE
- #endif
- #ifndef BT_TRACE_BTIF
- #define BT_TRACE_BTIF TRUE
- #endif
- #ifndef BT_TRACE_VERBOSE
- #define BT_TRACE_VERBOSE FALSE
- #endif
- #ifndef BTA_DM_SDP_DB_SIZE
- #define BTA_DM_SDP_DB_SIZE 8000
- #endif
- #ifndef HL_INCLUDED
- #define HL_INCLUDED TRUE
- #endif
- #ifndef AG_VOICE_SETTINGS
- #define AG_VOICE_SETTINGS HCI_DEFAULT_VOICE_SETTINGS
- #endif
- #ifndef BTIF_DM_OOB_TEST
- #define BTIF_DM_OOB_TEST FALSE//TRUE
- #endif
- // How long to wait before activating sniff mode after entering the
- // idle state for FTS, OPS connections
- #ifndef BTA_FTS_OPS_IDLE_TO_SNIFF_DELAY_MS
- #define BTA_FTS_OPS_IDLE_TO_SNIFF_DELAY_MS 7000
- #endif
- //------------------End added from bdroid_buildcfg.h---------------------
- /******************************************************************************
- **
- ** GKI Buffer Pools
- **
- ******************************************************************************/
- /* Receives HCI events from the lower-layer. */
- #ifndef HCI_CMD_POOL_ID
- #define HCI_CMD_POOL_ID GKI_POOL_ID_2
- #endif
- #ifndef HCI_CMD_POOL_BUF_SIZE
- #define HCI_CMD_POOL_BUF_SIZE GKI_BUF2_SIZE
- #endif
- /* Receives ACL data packets from thelower-layer. */
- #ifndef HCI_ACL_POOL_ID
- #define HCI_ACL_POOL_ID GKI_POOL_ID_3
- #endif
- /* Maximum number of buffers available for ACL receive data. */
- #ifndef HCI_ACL_BUF_MAX
- #define HCI_ACL_BUF_MAX GKI_BUF3_MAX
- #endif
- /* Receives SCO data packets from the lower-layer. */
- #ifndef HCI_SCO_POOL_ID
- #define HCI_SCO_POOL_ID GKI_POOL_ID_6
- #endif
- /* Sends SDP data packets. */
- #ifndef SDP_POOL_ID
- #define SDP_POOL_ID 3
- #endif
- /* Sends RFCOMM command packets. */
- #ifndef RFCOMM_CMD_POOL_ID
- #define RFCOMM_CMD_POOL_ID GKI_POOL_ID_2
- #endif
- /* Sends RFCOMM data packets. */
- #ifndef RFCOMM_DATA_POOL_ID
- #define RFCOMM_DATA_POOL_ID GKI_POOL_ID_3
- #endif
- #ifndef RFCOMM_DATA_POOL_BUF_SIZE
- #define RFCOMM_DATA_POOL_BUF_SIZE GKI_BUF3_SIZE
- #endif
- /* Sends L2CAP packets to the peer and HCI messages to the controller. */
- #ifndef L2CAP_CMD_POOL_ID
- #define L2CAP_CMD_POOL_ID GKI_POOL_ID_2
- #endif
- /* Sends L2CAP segmented packets in ERTM mode */
- #ifndef L2CAP_FCR_TX_POOL_ID
- #define L2CAP_FCR_TX_POOL_ID HCI_ACL_POOL_ID
- #endif
- /* Receives L2CAP segmented packets in ERTM mode */
- #ifndef L2CAP_FCR_RX_POOL_ID
- #define L2CAP_FCR_RX_POOL_ID HCI_ACL_POOL_ID
- #endif
- /* Number of ACL buffers to assign to LE
- if the HCI buffer pool is shared with BR/EDR */
- #ifndef L2C_DEF_NUM_BLE_BUF_SHARED
- #define L2C_DEF_NUM_BLE_BUF_SHARED 1
- #endif
- /* Used by BTM when it sends HCI commands to the controller. */
- #ifndef BTM_CMD_POOL_ID
- #define BTM_CMD_POOL_ID GKI_POOL_ID_2
- #endif
- #ifndef OBX_LRG_DATA_POOL_SIZE
- #define OBX_LRG_DATA_POOL_SIZE GKI_BUF4_SIZE
- #endif
- #ifndef OBX_LRG_DATA_POOL_ID
- #define OBX_LRG_DATA_POOL_ID GKI_POOL_ID_4
- #endif
- /* Used to send data to L2CAP. */
- #ifndef GAP_DATA_POOL_ID
- #define GAP_DATA_POOL_ID GKI_POOL_ID_3
- #endif
- #ifndef SPP_DB_SIZE
- #define SPP_DB_SIZE GKI_BUF3_SIZE
- #endif
- /* BNEP data and protocol messages. */
- #ifndef BNEP_POOL_ID
- #define BNEP_POOL_ID GKI_POOL_ID_3
- #endif
- /* RPC pool for temporary trace message buffers. */
- #ifndef RPC_SCRATCH_POOL_ID
- #define RPC_SCRATCH_POOL_ID GKI_POOL_ID_2
- #endif
- /* AVDTP pool for protocol messages */
- #ifndef AVDT_CMD_POOL_ID
- #define AVDT_CMD_POOL_ID GKI_POOL_ID_2
- #endif
- /* AVDTP pool size for media packets in case of fragmentation */
- #ifndef AVDT_DATA_POOL_SIZE
- #define AVDT_DATA_POOL_SIZE GKI_BUF3_SIZE
- #endif
- #ifndef PAN_POOL_ID
- #define PAN_POOL_ID GKI_POOL_ID_3
- /* Maximum amount of the shared buffer to allocate for PAN */
- #define PAN_POOL_MAX (GKI_BUF3_MAX / 4)
- #endif
- /* AVCTP pool for protocol messages */
- #ifndef AVCT_CMD_POOL_ID
- #define AVCT_CMD_POOL_ID GKI_POOL_ID_1
- #endif
- /* AVRCP pool for protocol messages */
- #ifndef AVRC_CMD_POOL_ID
- #define AVRC_CMD_POOL_ID GKI_POOL_ID_1
- #endif
- /* AVRCP pool size for protocol messages */
- #ifndef AVRC_CMD_POOL_SIZE
- #define AVRC_CMD_POOL_SIZE GKI_BUF1_SIZE
- #endif
- /* AVRCP Metadata pool for protocol messages */
- #ifndef AVRC_META_CMD_POOL_ID
- #define AVRC_META_CMD_POOL_ID GKI_POOL_ID_2
- #endif
- /* AVRCP Metadata pool size for protocol messages */
- #ifndef AVRC_META_CMD_POOL_SIZE
- #define AVRC_META_CMD_POOL_SIZE GKI_BUF2_SIZE
- #endif
- /* AVRCP buffer size for browsing channel messages */
- #ifndef AVRC_BROWSE_POOL_SIZE
- #define AVRC_BROWSE_POOL_SIZE GKI_MAX_BUF_SIZE
- #endif
- #ifndef BTA_HL_LRG_DATA_POOL_ID
- #define BTA_HL_LRG_DATA_POOL_ID GKI_POOL_ID_7
- #endif
- /* GATT Server Database pool ID */
- #ifndef GATT_DB_POOL_ID
- #define GATT_DB_POOL_ID GKI_POOL_ID_8
- #endif
- /* GATT Data sending buffer pool ID, use default ACL pool for fix channel data */
- #ifndef GATT_BUF_POOL_ID
- #define GATT_BUF_POOL_ID HCI_ACL_POOL_ID
- #endif
- /******************************************************************************
- **
- ** Lower Layer Interface
- **
- ******************************************************************************/
- /* Macro for allocating buffer for HCI commands */
- #ifndef HCI_GET_CMD_BUF
- #if (!defined(HCI_USE_VARIABLE_SIZE_CMD_BUF) || (HCI_USE_VARIABLE_SIZE_CMD_BUF == FALSE))
- /* Allocate fixed-size buffer from HCI_CMD_POOL (default case) */
- #define HCI_GET_CMD_BUF(paramlen) ((BT_HDR *)GKI_getpoolbuf (HCI_CMD_POOL_ID))
- #else
- /* Allocate smallest possible buffer (for platforms with limited RAM) */
- #define HCI_GET_CMD_BUF(paramlen) ((BT_HDR *)GKI_getbuf ((UINT16)(BT_HDR_SIZE + HCIC_PREAMBLE_SIZE + (paramlen))))
- #endif
- #endif /* HCI_GET_CMD_BUF */
- /******************************************************************************
- **
- ** HCI Services (H4)
- **
- ******************************************************************************/
- /* Use 2 second for low-resolution systems, override to 1 for high-resolution systems */
- #ifndef BT_1SEC_TIMEOUT
- #define BT_1SEC_TIMEOUT (2)
- #endif
- /* Quick Timer */
- /* if L2CAP_FCR_INCLUDED is TRUE then it should have 100 millisecond resolution */
- /* if none of them is included then QUICK_TIMER_TICKS_PER_SEC is set to 0 to exclude quick timer */
- #ifndef QUICK_TIMER_TICKS_PER_SEC
- #define QUICK_TIMER_TICKS_PER_SEC 10 /* 100ms timer */
- #endif
- /******************************************************************************
- **
- ** BTM
- **
- ******************************************************************************/
- /* Cancel Inquiry on incoming SSP */
- #ifndef BTM_NO_SSP_ON_INQUIRY
- #define BTM_NO_SSP_ON_INQUIRY FALSE
- #endif
- /* Includes SCO if TRUE */
- #ifndef BTM_SCO_INCLUDED
- #define BTM_SCO_INCLUDED FALSE //TRUE /* TRUE includes SCO code */
- #endif
- /* Includes SCO if TRUE */
- #ifndef BTM_SCO_HCI_INCLUDED
- #define BTM_SCO_HCI_INCLUDED FALSE /* TRUE includes SCO over HCI code */
- #endif
- /* Includes WBS if TRUE */
- #ifndef BTM_WBS_INCLUDED
- #define BTM_WBS_INCLUDED FALSE /* TRUE includes WBS code */
- #endif
- /* This is used to work around a controller bug that doesn't like Disconnect
- ** issued while there is a role switch in progress
- */
- #ifndef BTM_DISC_DURING_RS
- #define BTM_DISC_DURING_RS TRUE
- #endif
- /**************************
- ** Initial SCO TX credit
- *************************/
- /* max TX SCO data packet size */
- #ifndef BTM_SCO_DATA_SIZE_MAX
- #define BTM_SCO_DATA_SIZE_MAX 240
- #endif
- /* The size in bytes of the BTM inquiry database. 40 As Default */
- #ifndef BTM_INQ_DB_SIZE
- #define BTM_INQ_DB_SIZE 32
- #endif
- /* The default scan mode */
- #ifndef BTM_DEFAULT_SCAN_TYPE
- #define BTM_DEFAULT_SCAN_TYPE BTM_SCAN_TYPE_INTERLACED
- #endif
- /* Should connections to unknown devices be allowed when not discoverable? */
- #ifndef BTM_ALLOW_CONN_IF_NONDISCOVER
- #define BTM_ALLOW_CONN_IF_NONDISCOVER TRUE
- #endif
- /* Sets the Page_Scan_Window: the length of time that the device is performing a page scan. */
- #ifndef BTM_DEFAULT_CONN_WINDOW
- #define BTM_DEFAULT_CONN_WINDOW 0x0012
- #endif
- /* Sets the Page_Scan_Activity: the interval between the start of two consecutive page scans. */
- #ifndef BTM_DEFAULT_CONN_INTERVAL
- #define BTM_DEFAULT_CONN_INTERVAL 0x0800
- #endif
- /* When automatic inquiry scan is enabled, this sets the inquiry scan window. */
- #ifndef BTM_DEFAULT_DISC_WINDOW
- #define BTM_DEFAULT_DISC_WINDOW 0x0012
- #endif
- /* When automatic inquiry scan is enabled, this sets the inquiry scan interval. */
- #ifndef BTM_DEFAULT_DISC_INTERVAL
- #define BTM_DEFAULT_DISC_INTERVAL 0x0800
- #endif
- /*
- * {SERVICE_CLASS, MAJOR_CLASS, MINOR_CLASS}
- *
- * SERVICE_CLASS:0x5A (Bit17 -Networking,Bit19 - Capturing,Bit20 -Object Transfer,Bit22 -Telephony)
- * MAJOR_CLASS:0x02 - PHONE
- * MINOR_CLASS:0x0C - SMART_PHONE
- *
- */
- #define BTA_DM_COD_SMARTPHONE {0x5A, 0x02, 0x0C}
- /*
- * {SERVICE_CLASS, MAJOR_CLASS, MINOR_CLASS}
- *
- * SERVICE_CLASS:0x2C (Bit21 - Audio, Bit19 - Capturing)
- * MAJOR_CLASS:0x04 - Audio/Video
- * MINOR_CLASS:0x05 - LoudSpeaker
- */
- #define BTA_DM_COD_LOUDSPEAKER {0x2C, 0x04, 0x14}
- /* Default class of device */
- #ifndef BTA_DM_COD
- #define BTA_DM_COD BTA_DM_COD_LOUDSPEAKER
- #endif
- /* The number of SCO links. */
- #ifndef BTM_MAX_SCO_LINKS
- #define BTM_MAX_SCO_LINKS 1 //3
- #endif
- /* The preferred type of SCO links (2-eSCO, 0-SCO). */
- #ifndef BTM_DEFAULT_SCO_MODE
- #define BTM_DEFAULT_SCO_MODE 2
- #endif
- /* The number of security records for peer devices. 100 AS Default*/
- #ifndef BTM_SEC_MAX_DEVICE_RECORDS
- #define BTM_SEC_MAX_DEVICE_RECORDS 8 // 100
- #endif
- /* The number of security records for services. 32 AS Default*/
- #ifndef BTM_SEC_MAX_SERVICE_RECORDS
- #define BTM_SEC_MAX_SERVICE_RECORDS 8 // 32
- #endif
- /* If True, force a retrieval of remote device name for each bond in case it's changed */
- #ifndef BTM_SEC_FORCE_RNR_FOR_DBOND
- #define BTM_SEC_FORCE_RNR_FOR_DBOND FALSE
- #endif
- /* Maximum device name length used in btm database. Up to 248*/
- #ifndef BTM_MAX_REM_BD_NAME_LEN
- #define BTM_MAX_REM_BD_NAME_LEN 64
- #endif
- /* Maximum local device name length stored btm database.
- '0' disables storage of the local name in BTM */
- #ifndef BTM_MAX_LOC_BD_NAME_LEN
- #define BTM_MAX_LOC_BD_NAME_LEN 64
- #endif
- /* Fixed Default String. When this is defined as null string, the device's
- * product model name is used as the default local name.
- */
- #ifndef BTM_DEF_LOCAL_NAME
- #define BTM_DEF_LOCAL_NAME ""
- #endif
- /* Maximum service name stored with security authorization (0 if not needed) */
- #ifndef BTM_SEC_SERVICE_NAME_LEN
- #define BTM_SEC_SERVICE_NAME_LEN BT_MAX_SERVICE_NAME_LEN
- #endif
- /* Maximum length of the service name. */
- #ifndef BT_MAX_SERVICE_NAME_LEN
- #define BT_MAX_SERVICE_NAME_LEN 21
- #endif
- /* ACL buffer size in HCI Host Buffer Size command. */
- #ifndef BTM_ACL_BUF_SIZE
- #define BTM_ACL_BUF_SIZE 0
- #endif
- /* The maximum number of clients that can register with the power manager. */
- #ifndef BTM_MAX_PM_RECORDS
- #define BTM_MAX_PM_RECORDS 2
- #endif
- /* This is set to show debug trace messages for the power manager. */
- #ifndef BTM_PM_DEBUG
- #define BTM_PM_DEBUG FALSE
- #endif
- /* This is set to TRUE if link is to be unparked due to BTM_CreateSCO API. */
- #ifndef BTM_SCO_WAKE_PARKED_LINK
- #define BTM_SCO_WAKE_PARKED_LINK TRUE
- #endif
- /* If the user does not respond to security process requests within this many seconds,
- * a negative response would be sent automatically.
- * 30 is LMP response timeout value */
- #ifndef BTM_SEC_TIMEOUT_VALUE
- #define BTM_SEC_TIMEOUT_VALUE 35
- #endif
- /* Maximum number of callbacks that can be registered using BTM_RegisterForVSEvents */
- #ifndef BTM_MAX_VSE_CALLBACKS
- #define BTM_MAX_VSE_CALLBACKS 3
- #endif
- /******************************************
- ** Lisbon Features
- *******************************************/
- /* This is set to TRUE if the FEC is required for EIR packet. */
- #ifndef BTM_EIR_DEFAULT_FEC_REQUIRED
- #define BTM_EIR_DEFAULT_FEC_REQUIRED TRUE
- #endif
- /* The IO capability of the local device (for Simple Pairing) */
- #ifndef BTM_LOCAL_IO_CAPS
- #define BTM_LOCAL_IO_CAPS BTM_IO_CAP_NONE
- #endif
- #ifndef BTM_LOCAL_IO_CAPS_BLE
- #define BTM_LOCAL_IO_CAPS_BLE BTM_IO_CAP_KBDISP
- #endif
- /* The default MITM Protection Requirement (for Simple Pairing)
- * Possible values are BTM_AUTH_SP_YES or BTM_AUTH_SP_NO */
- #ifndef BTM_DEFAULT_AUTH_REQ
- #define BTM_DEFAULT_AUTH_REQ BTM_AUTH_SP_NO
- #endif
- /* The default MITM Protection Requirement for dedicated bonding using Simple Pairing
- * Possible values are BTM_AUTH_AP_YES or BTM_AUTH_AP_NO */
- #ifndef BTM_DEFAULT_DD_AUTH_REQ
- #define BTM_DEFAULT_DD_AUTH_REQ BTM_AUTH_AP_YES
- #endif
- /* Include Out-of-Band implementation for Simple Pairing */
- #ifndef BTM_OOB_INCLUDED
- #define BTM_OOB_INCLUDED TRUE
- #endif
- /* TRUE to include Sniff Subrating */
- #ifndef BTM_SSR_INCLUDED
- #define BTM_SSR_INCLUDED TRUE
- #endif
- /*************************
- ** End of Lisbon Features
- **************************/
- /* 4.1/4.2 secure connections feature */
- #ifndef SC_MODE_INCLUDED
- #define SC_MODE_INCLUDED TRUE
- #endif
- /* Used for conformance testing ONLY */
- #ifndef BTM_BLE_CONFORMANCE_TESTING
- #define BTM_BLE_CONFORMANCE_TESTING FALSE
- #endif
- /******************************************************************************
- **
- ** L2CAP
- **
- ******************************************************************************/
- #ifndef L2CAP_CLIENT_INCLUDED
- #define L2CAP_CLIENT_INCLUDED FALSE
- #endif
- /* The maximum number of simultaneous links that L2CAP can support. Up to 7*/
- #ifndef MAX_ACL_CONNECTIONS
- #define MAX_L2CAP_LINKS 3
- #else
- #define MAX_L2CAP_LINKS MAX_ACL_CONNECTIONS
- #endif
- /* The maximum number of simultaneous channels that L2CAP can support. Up to 16*/
- #ifndef MAX_L2CAP_CHANNELS
- #define MAX_L2CAP_CHANNELS 8
- #endif
- /* The maximum number of simultaneous applications that can register with L2CAP. */
- #ifndef MAX_L2CAP_CLIENTS
- #define MAX_L2CAP_CLIENTS 8
- #endif
- /* The number of seconds of link inactivity before a link is disconnected. */
- #ifndef L2CAP_LINK_INACTIVITY_TOUT
- #define L2CAP_LINK_INACTIVITY_TOUT 4
- #endif
- /* The number of seconds of link inactivity after bonding before a link is disconnected. */
- #ifndef L2CAP_BONDING_TIMEOUT
- #define L2CAP_BONDING_TIMEOUT 3
- #endif
- /* The time from the HCI connection complete to disconnect if no channel is established. */
- #ifndef L2CAP_LINK_STARTUP_TOUT
- #define L2CAP_LINK_STARTUP_TOUT 60
- #endif
- /* The L2CAP MTU; must be in accord with the HCI ACL pool size. */
- #ifndef L2CAP_MTU_SIZE
- #define L2CAP_MTU_SIZE 1691
- #endif
- /* The L2CAP MPS over Bluetooth; must be in accord with the FCR tx pool size and ACL down buffer size. */
- #ifndef L2CAP_MPS_OVER_BR_EDR
- #define L2CAP_MPS_OVER_BR_EDR 1010
- #endif
- /* If host flow control enabled, this is the number of buffers the controller can have unacknowledged. */
- #ifndef L2CAP_HOST_FC_ACL_BUFS
- #define L2CAP_HOST_FC_ACL_BUFS 20
- #endif
- /* This is set to enable L2CAP to take the ACL link out of park mode when ACL data is to be sent. */
- #ifndef L2CAP_WAKE_PARKED_LINK
- #define L2CAP_WAKE_PARKED_LINK TRUE
- #endif
- /* Whether link wants to be the master or the slave. */
- #ifndef L2CAP_DESIRED_LINK_ROLE
- #define L2CAP_DESIRED_LINK_ROLE HCI_ROLE_SLAVE
- #endif
- /* Include Non-Flushable Packet Boundary Flag feature of Lisbon */
- #ifndef L2CAP_NON_FLUSHABLE_PB_INCLUDED
- #define L2CAP_NON_FLUSHABLE_PB_INCLUDED TRUE
- #endif
- /* Minimum number of ACL credit for high priority link */
- #ifndef L2CAP_HIGH_PRI_MIN_XMIT_QUOTA
- #define L2CAP_HIGH_PRI_MIN_XMIT_QUOTA 5
- #endif
- /* used for monitoring HCI ACL credit management */
- #ifndef L2CAP_HCI_FLOW_CONTROL_DEBUG
- #define L2CAP_HCI_FLOW_CONTROL_DEBUG TRUE
- #endif
- /* Used for calculating transmit buffers off of */
- #ifndef L2CAP_NUM_XMIT_BUFFS
- #define L2CAP_NUM_XMIT_BUFFS HCI_ACL_BUF_MAX
- #endif
- /* Unicast Connectionless Data */
- #ifndef L2CAP_UCD_INCLUDED
- #define L2CAP_UCD_INCLUDED FALSE
- #endif
- /* Unicast Connectionless Data MTU */
- #ifndef L2CAP_UCD_MTU
- #define L2CAP_UCD_MTU L2CAP_MTU_SIZE
- #endif
- /* Unicast Connectionless Data Idle Timeout */
- #ifndef L2CAP_UCD_IDLE_TIMEOUT
- #define L2CAP_UCD_IDLE_TIMEOUT 2
- #endif
- /* Unicast Connectionless Data Idle Timeout */
- #ifndef L2CAP_UCD_CH_PRIORITY
- #define L2CAP_UCD_CH_PRIORITY L2CAP_CHNL_PRIORITY_MEDIUM
- #endif
- /* Used for features using fixed channels; set to zero if no fixed channels supported (BLE, etc.) */
- /* Excluding L2CAP signaling channel and UCD */
- #ifndef L2CAP_NUM_FIXED_CHNLS
- #define L2CAP_NUM_FIXED_CHNLS 32
- #endif
- /* First fixed channel supported */
- #ifndef L2CAP_FIRST_FIXED_CHNL
- #define L2CAP_FIRST_FIXED_CHNL 4
- #endif
- #ifndef L2CAP_LAST_FIXED_CHNL
- #define L2CAP_LAST_FIXED_CHNL (L2CAP_FIRST_FIXED_CHNL + L2CAP_NUM_FIXED_CHNLS - 1)
- #endif
- /* Round Robin service channels in link */
- #ifndef L2CAP_ROUND_ROBIN_CHANNEL_SERVICE
- #define L2CAP_ROUND_ROBIN_CHANNEL_SERVICE TRUE
- #endif
- /* Used for calculating transmit buffers off of */
- #ifndef L2CAP_NUM_XMIT_BUFFS
- #define L2CAP_NUM_XMIT_BUFFS HCI_ACL_BUF_MAX
- #endif
- /* used for monitoring eL2CAP data flow */
- #ifndef L2CAP_ERTM_STATS
- #define L2CAP_ERTM_STATS FALSE
- #endif
- /* Used for conformance testing ONLY: When TRUE lets scriptwrapper overwrite info response */
- #ifndef L2CAP_CONFORMANCE_TESTING
- #define L2CAP_CONFORMANCE_TESTING FALSE
- #endif
- /*
- * Max bytes per connection to buffer locally before dropping the
- * connection if local client does not receive it - default is 1MB
- */
- #ifndef L2CAP_MAX_RX_BUFFER
- #define L2CAP_MAX_RX_BUFFER 0x100000
- #endif
- #ifndef TIMER_PARAM_TYPE
- #define TIMER_PARAM_TYPE UINT32
- #endif
- /******************************************************************************
- **
- ** BLE
- **
- ******************************************************************************/
- #ifndef BLE_INCLUDED
- #define BLE_INCLUDED TRUE
- #endif
- #ifndef BLE_ANDROID_CONTROLLER_SCAN_FILTER
- #define BLE_ANDROID_CONTROLLER_SCAN_FILTER TRUE
- #endif
- #ifndef LOCAL_BLE_CONTROLLER_ID
- #define LOCAL_BLE_CONTROLLER_ID (1)
- #endif
- /*
- * Toggles support for general LE privacy features such as remote address
- * resolution, local address rotation etc.
- */
- #ifndef BLE_PRIVACY_SPT
- #define BLE_PRIVACY_SPT TRUE
- #endif
- /*
- * Enables or disables support for local privacy (ex. address rotation)
- */
- #ifndef BLE_LOCAL_PRIVACY_ENABLED
- #define BLE_LOCAL_PRIVACY_ENABLED TRUE
- #endif
- /*
- * Toggles support for vendor specific extensions such as RPA offloading,
- * feature discovery, multi-adv etc.
- */
- #ifndef BLE_VND_INCLUDED
- #define BLE_VND_INCLUDED FALSE
- #endif
- #ifndef BTM_BLE_ADV_TX_POWER
- #define BTM_BLE_ADV_TX_POWER {-21, -15, -7, 1, 9}
- #endif
- #ifndef BLE_BATCH_SCAN_INCLUDED
- #define BLE_BATCH_SCAN_INCLUDED TRUE
- #endif
- /******************************************************************************
- **
- ** ATT/GATT Protocol/Profile Settings
- **
- ******************************************************************************/
- #ifndef GATT_INCLUDED
- #if BLE_INCLUDED == TRUE
- #define GATT_INCLUDED TRUE
- #else
- #define GATT_INCLUDED FALSE
- #endif
- #endif
- #ifndef BTA_GATT_INCLUDED
- #if BLE_INCLUDED == TRUE
- #define BTA_GATT_INCLUDED TRUE
- #else
- #define BTA_GATT_INCLUDED FALSE
- #endif
- #endif
- #if BTA_GATT_INCLUDED == TRUE && BLE_INCLUDED == FALSE
- #error "can't have GATT without BLE"
- #endif
- #ifndef BLE_LLT_INCLUDED
- #define BLE_LLT_INCLUDED TRUE
- #endif
- #ifndef ATT_INCLUDED
- #define ATT_INCLUDED TRUE
- #endif
- #ifndef ATT_DEBUG
- #define ATT_DEBUG FALSE//TRUE
- #endif
- #ifndef BLE_PERIPHERAL_MODE_SUPPORT
- #define BLE_PERIPHERAL_MODE_SUPPORT TRUE
- #endif
- #ifndef BLE_DELAY_REQUEST_ENC
- /* This flag is to work around IPHONE problem, We need to wait for iPhone ready
- before send encryption request to iPhone */
- #define BLE_DELAY_REQUEST_ENC FALSE
- #endif
- #ifndef GAP_TRANSPORT_SUPPORTED
- #define GAP_TRANSPORT_SUPPORTED GATT_TRANSPORT_LE_BR_EDR
- #endif
- #ifndef GATTP_TRANSPORT_SUPPORTED
- #define GATTP_TRANSPORT_SUPPORTED GATT_TRANSPORT_LE_BR_EDR
- #endif
- #ifndef GATT_MAX_SR_PROFILES
- #define GATT_MAX_SR_PROFILES 8 /* max is 32 */
- #endif
- #ifndef GATT_MAX_APPS
- #define GATT_MAX_APPS 8 /* MAX is 32 note: 2 apps used internally GATT and GAP */
- #endif
- #ifndef GATT_MAX_PHY_CHANNEL
- #define GATT_MAX_PHY_CHANNEL 7
- #endif
- /* Used for conformance testing ONLY */
- #ifndef GATT_CONFORMANCE_TESTING
- #define GATT_CONFORMANCE_TESTING FALSE
- #endif
- /* number of background connection device allowence, ideally to be the same as WL size
- */
- #ifndef GATT_MAX_BG_CONN_DEV
- #define GATT_MAX_BG_CONN_DEV 8 /*MAX is 32*/
- #endif
- /******************************************************************************
- **
- ** GATT
- **
- ******************************************************************************/
- #ifndef GATTC_INCLUDED
- #if BLE_INCLUDED == TRUE
- #define GATTC_INCLUDED TRUE
- #else
- #define GATTC_INCLUDED FALSE
- #endif
- #endif
- #ifndef GATTS_INCLUDED
- #if BLE_INCLUDED == TRUE
- #define GATTS_INCLUDED TRUE
- #else
- #define GATTS_INCLUDED FALSE
- #endif
- #endif
- #if SMP_INCLUDED == TRUE && BLE_INCLUDED == FALSE
- #error "can't have SMP without BLE"
- #endif
- /******************************************************************************
- **
- ** SMP
- **
- ******************************************************************************/
- #ifndef SMP_INCLUDED
- #if BLE_INCLUDED == TRUE
- #define SMP_INCLUDED TRUE
- #else
- #define SMP_INCLUDED FALSE
- #endif
- #endif
- #if SMP_INCLUDED == TRUE && BLE_INCLUDED == FALSE
- #error "can't have SMP without BLE"
- #endif
- #ifndef SMP_DEBUG
- #define SMP_DEBUG FALSE
- #endif
- #ifndef SMP_DEFAULT_AUTH_REQ
- #define SMP_DEFAULT_AUTH_REQ SMP_AUTH_NB_ENC_ONLY
- #endif
- #ifndef SMP_MAX_ENC_KEY_SIZE
- #define SMP_MAX_ENC_KEY_SIZE 16
- #endif
- #ifndef SMP_MIN_ENC_KEY_SIZE
- #define SMP_MIN_ENC_KEY_SIZE 7
- #endif
- /* minimum link timeout after SMP pairing is done, leave room for key exchange
- and racing condition for the following service connection.
- Prefer greater than 0 second, and no less than default inactivity link idle
- timer(L2CAP_LINK_INACTIVITY_TOUT) in l2cap) */
- #ifndef SMP_LINK_TOUT_MIN
- #if (L2CAP_LINK_INACTIVITY_TOUT > 0)
- #define SMP_LINK_TOUT_MIN L2CAP_LINK_INACTIVITY_TOUT
- #else
- #define SMP_LINK_TOUT_MIN 2
- #endif
- #endif
- /******************************************************************************
- **
- ** SDP
- **
- ******************************************************************************/
- #ifndef SDP_INCLUDED
- #define SDP_INCLUDED TRUE
- #endif
- /* This is set to enable SDP server functionality. */
- #ifndef SDP_SERVER_ENABLED
- #if SDP_INCLUDED == TRUE
- #define SDP_SERVER_ENABLED TRUE
- #else
- #define SDP_SERVER_ENABLED FALSE
- #endif
- #endif
- /* This is set to enable SDP client functionality. */
- #ifndef SDP_CLIENT_ENABLED
- #if SDP_INCLUDED == TRUE
- #define SDP_CLIENT_ENABLED TRUE
- #else
- #define SDP_CLIENT_ENABLED FALSE
- #endif
- #endif
- /* The maximum number of SDP records the server can support. */
- #ifndef SDP_MAX_RECORDS
- #define SDP_MAX_RECORDS 6 /*max is 30*/
- #endif
- /* The maximum number of attributes in each record. */
- #ifndef SDP_MAX_REC_ATTR
- #define SDP_MAX_REC_ATTR 8
- #endif
- #ifndef SDP_MAX_PAD_LEN
- #define SDP_MAX_PAD_LEN 300
- #endif
- /* The maximum length, in bytes, of an attribute. */
- #ifndef SDP_MAX_ATTR_LEN
- #define SDP_MAX_ATTR_LEN 400
- #endif
- /* The maximum number of attribute filters supported by SDP databases. */
- #ifndef SDP_MAX_ATTR_FILTERS
- #define SDP_MAX_ATTR_FILTERS 15
- #endif
- /* The maximum number of UUID filters supported by SDP databases. */
- #ifndef SDP_MAX_UUID_FILTERS
- #define SDP_MAX_UUID_FILTERS 3
- #endif
- /* The maximum number of record handles retrieved in a search. */
- #ifndef SDP_MAX_DISC_SERVER_RECS
- #define SDP_MAX_DISC_SERVER_RECS 21
- #endif
- /* The size of a scratchpad buffer, in bytes, for storing the response to an attribute request. */
- #ifndef SDP_MAX_LIST_BYTE_COUNT
- #define SDP_MAX_LIST_BYTE_COUNT 4096
- #endif
- /* The maximum number of parameters in an SDP protocol element. */
- #ifndef SDP_MAX_PROTOCOL_PARAMS
- #define SDP_MAX_PROTOCOL_PARAMS 2
- #endif
- /* The maximum number of simultaneous client and server connections. */
- #ifndef SDP_MAX_CONNECTIONS
- #define SDP_MAX_CONNECTIONS 2 // 4
- #endif
- /* The MTU size for the L2CAP configuration. */
- #ifndef SDP_MTU_SIZE
- #define SDP_MTU_SIZE 672
- #endif
- /* The flush timeout for the L2CAP configuration. */
- #ifndef SDP_FLUSH_TO
- #define SDP_FLUSH_TO 0xFFFF
- #endif
- /* The name for security authorization. */
- #ifndef SDP_SERVICE_NAME
- #define SDP_SERVICE_NAME "Service Discovery"
- #endif
- /* The security level for BTM. */
- #ifndef SDP_SECURITY_LEVEL
- #define SDP_SECURITY_LEVEL BTM_SEC_NONE
- #endif
- /******************************************************************************
- **
- ** RFCOMM
- **
- ******************************************************************************/
- #ifndef RFCOMM_INCLUDED
- #define RFCOMM_INCLUDED FALSE
- #endif
- /* The maximum number of ports supported. */
- #ifndef MAX_RFC_PORTS
- #define MAX_RFC_PORTS 16 /*max is 30*/
- #endif
- /* The maximum simultaneous links to different devices. */
- #ifndef MAX_ACL_CONNECTIONS
- #define MAX_BD_CONNECTIONS 3 /*max is 7*/
- #else
- #define MAX_BD_CONNECTIONS MAX_ACL_CONNECTIONS
- #endif
- /* The port receive queue low watermark level, in bytes. */
- #ifndef PORT_RX_LOW_WM
- #define PORT_RX_LOW_WM (BTA_RFC_MTU_SIZE * PORT_RX_BUF_LOW_WM)
- #endif
- /* The port receive queue high watermark level, in bytes. */
- #ifndef PORT_RX_HIGH_WM
- #define PORT_RX_HIGH_WM (BTA_RFC_MTU_SIZE * PORT_RX_BUF_HIGH_WM)
- #endif
- /* The port receive queue critical watermark level, in bytes. */
- #ifndef PORT_RX_CRITICAL_WM
- #define PORT_RX_CRITICAL_WM (BTA_RFC_MTU_SIZE * PORT_RX_BUF_CRITICAL_WM)
- #endif
- /* The port receive queue low watermark level, in number of buffers. */
- #ifndef PORT_RX_BUF_LOW_WM
- #define PORT_RX_BUF_LOW_WM 4
- #endif
- /* The port receive queue high watermark level, in number of buffers. */
- #ifndef PORT_RX_BUF_HIGH_WM
- #define PORT_RX_BUF_HIGH_WM 10
- #endif
- /* The port receive queue critical watermark level, in number of buffers. */
- #ifndef PORT_RX_BUF_CRITICAL_WM
- #define PORT_RX_BUF_CRITICAL_WM 15
- #endif
- /* The port transmit queue high watermark level, in bytes. */
- #ifndef PORT_TX_HIGH_WM
- #define PORT_TX_HIGH_WM (BTA_RFC_MTU_SIZE * PORT_TX_BUF_HIGH_WM)
- #endif
- /* The port transmit queue critical watermark level, in bytes. */
- #ifndef PORT_TX_CRITICAL_WM
- #define PORT_TX_CRITICAL_WM (BTA_RFC_MTU_SIZE * PORT_TX_BUF_CRITICAL_WM)
- #endif
- /* The port transmit queue high watermark level, in number of buffers. */
- #ifndef PORT_TX_BUF_HIGH_WM
- #define PORT_TX_BUF_HIGH_WM 10
- #endif
- /* The port transmit queue high watermark level, in number of buffers. */
- #ifndef PORT_TX_BUF_CRITICAL_WM
- #define PORT_TX_BUF_CRITICAL_WM 15
- #endif
- /* The RFCOMM multiplexer preferred flow control mechanism. */
- #ifndef PORT_FC_DEFAULT
- #define PORT_FC_DEFAULT PORT_FC_CREDIT
- #endif
- /* The maximum number of credits receiver sends to peer when using credit-based flow control. */
- #ifndef PORT_CREDIT_RX_MAX
- #define PORT_CREDIT_RX_MAX 16
- #endif
- /* The credit low watermark level. */
- #ifndef PORT_CREDIT_RX_LOW
- #define PORT_CREDIT_RX_LOW 8
- #endif
- /* if application like BTA, Java or script test engine is running on other than BTU thread, */
- /* PORT_SCHEDULE_LOCK shall be defined as GKI_sched_lock() or GKI_disable() */
- #ifndef PORT_SCHEDULE_LOCK
- #define PORT_SCHEDULE_LOCK GKI_disable()
- #endif
- /* if application like BTA, Java or script test engine is running on other than BTU thread, */
- /* PORT_SCHEDULE_LOCK shall be defined as GKI_sched_unlock() or GKI_enable() */
- #ifndef PORT_SCHEDULE_UNLOCK
- #define PORT_SCHEDULE_UNLOCK GKI_enable()
- #endif
- /******************************************************************************
- **
- ** OBEX
- **
- ******************************************************************************/
- #define OBX_14_INCLUDED FALSE
- /* The maximum number of registered servers. */
- #ifndef OBX_NUM_SERVERS
- #define OBX_NUM_SERVERS 12
- #endif
- /* The maximum number of active clients. */
- #ifndef OBX_NUM_CLIENTS
- #define OBX_NUM_CLIENTS 8
- #endif
- /* This option is application when OBX_14_INCLUDED=TRUE
- Pool ID where to reassemble the SDU.
- This Pool will allow buffers to be used that are larger than
- the L2CAP_MAX_MTU. */
- #ifndef OBX_USER_RX_POOL_ID
- #define OBX_USER_RX_POOL_ID OBX_LRG_DATA_POOL_ID
- #endif
- /* This option is application when OBX_14_INCLUDED=TRUE
- Pool ID where to hold the SDU.
- This Pool will allow buffers to be used that are larger than
- the L2CAP_MAX_MTU. */
- #ifndef OBX_USER_TX_POOL_ID
- #define OBX_USER_TX_POOL_ID OBX_LRG_DATA_POOL_ID
- #endif
- /* This option is application when OBX_14_INCLUDED=TRUE
- GKI Buffer Pool ID used to hold MPS segments during SDU reassembly
- */
- #ifndef OBX_FCR_RX_POOL_ID
- #define OBX_FCR_RX_POOL_ID HCI_ACL_POOL_ID
- #endif
- /* This option is application when OBX_14_INCLUDED=TRUE
- GKI Buffer Pool ID used to hold MPS segments used in (re)transmissions.
- L2CAP_DEFAULT_ERM_POOL_ID is specified to use the HCI ACL data pool.
- Note: This pool needs to have enough buffers to hold two times the window size negotiated
- in the L2CA_SetFCROptions (2 * tx_win_size) to allow for retransmissions.
- The size of each buffer must be able to hold the maximum MPS segment size passed in
- L2CA_SetFCROptions plus BT_HDR (8) + HCI preamble (4) + L2CAP_MIN_OFFSET (11 - as of BT 2.1 + EDR Spec).
- */
- #ifndef OBX_FCR_TX_POOL_ID
- #define OBX_FCR_TX_POOL_ID HCI_ACL_POOL_ID
- #endif
- /* This option is application when OBX_14_INCLUDED=TRUE
- Size of the transmission window when using enhanced retransmission mode. Not used
- in basic and streaming modes. Range: 1 - 63
- */
- #ifndef OBX_FCR_OPT_TX_WINDOW_SIZE_BR_EDR
- #define OBX_FCR_OPT_TX_WINDOW_SIZE_BR_EDR 20
- #endif
- /* This option is application when OBX_14_INCLUDED=TRUE
- Number of transmission attempts for a single I-Frame before taking
- Down the connection. Used In ERTM mode only. Value is Ignored in basic and
- Streaming modes.
- Range: 0, 1-0xFF
- 0 - infinite retransmissions
- 1 - single transmission
- */
- #ifndef OBX_FCR_OPT_MAX_TX_B4_DISCNT
- #define OBX_FCR_OPT_MAX_TX_B4_DISCNT 20
- #endif
- /* This option is application when OBX_14_INCLUDED=TRUE
- Retransmission Timeout
- Range: Minimum 2000 (2 secs) on BR/EDR when supporting PBF.
- */
- #ifndef OBX_FCR_OPT_RETX_TOUT
- #define OBX_FCR_OPT_RETX_TOUT 2000
- #endif
- /* This option is application when OBX_14_INCLUDED=TRUE
- Monitor Timeout
- Range: Minimum 12000 (12 secs) on BR/EDR when supporting PBF.
- */
- #ifndef OBX_FCR_OPT_MONITOR_TOUT
- #define OBX_FCR_OPT_MONITOR_TOUT 12000
- #endif
- /* This option is application when OBX_14_INCLUDED=TRUE
- Maximum PDU payload size.
- Suggestion: The maximum amount of data that will fit into a 3-DH5 packet.
- Range: 2 octets
- */
- #ifndef OBX_FCR_OPT_MAX_PDU_SIZE
- #define OBX_FCR_OPT_MAX_PDU_SIZE L2CAP_MPS_OVER_BR_EDR
- #endif
- /******************************************************************************
- **
- ** BNEP
- **
- ******************************************************************************/
- #ifndef BNEP_INCLUDED
- #define BNEP_INCLUDED FALSE//TRUE
- #endif
- /* BNEP status API call is used mainly to get the L2CAP handle */
- #ifndef BNEP_SUPPORTS_STATUS_API
- #define BNEP_SUPPORTS_STATUS_API FALSE//TRUE
- #endif
- /*
- ** When BNEP connection changes roles after the connection is established
- ** we will do an authentication check again on the new role
- */
- #ifndef BNEP_DO_AUTH_FOR_ROLE_SWITCH
- #define BNEP_DO_AUTH_FOR_ROLE_SWITCH FALSE//TRUE
- #endif
- /* Maximum number of protocol filters supported. */
- #ifndef BNEP_MAX_PROT_FILTERS
- #define BNEP_MAX_PROT_FILTERS 5
- #endif
- /* Maximum number of multicast filters supported. */
- #ifndef BNEP_MAX_MULTI_FILTERS
- #define BNEP_MAX_MULTI_FILTERS 5
- #endif
- /* Minimum MTU size. */
- #ifndef BNEP_MIN_MTU_SIZE
- #define BNEP_MIN_MTU_SIZE L2CAP_MTU_SIZE
- #endif
- /* Preferred MTU size. */
- #ifndef BNEP_MTU_SIZE
- #define BNEP_MTU_SIZE BNEP_MIN_MTU_SIZE
- #endif
- /* Maximum number of buffers allowed in transmit data queue. */
- #ifndef BNEP_MAX_XMITQ_DEPTH
- #define BNEP_MAX_XMITQ_DEPTH 20
- #endif
- /* Maximum number BNEP of connections supported. */
- #ifndef BNEP_MAX_CONNECTIONS
- #define BNEP_MAX_CONNECTIONS 7
- #endif
- /******************************************************************************
- **
- ** AVDTP
- **
- ******************************************************************************/
- #ifndef AVDT_INCLUDED
- #define AVDT_INCLUDED TRUE
- #endif
- /* Include reporting capability in AVDTP */
- #ifndef AVDT_REPORTING
- #define AVDT_REPORTING TRUE
- #endif
- /* Include multiplexing capability in AVDTP */
- #ifndef AVDT_MULTIPLEXING
- #define AVDT_MULTIPLEXING TRUE
- #endif
- /* Number of simultaneous links to different peer devices. */
- #ifndef AVDT_NUM_LINKS
- #define AVDT_NUM_LINKS 2
- #endif
- /* Number of simultaneous stream endpoints. */
- #ifndef AVDT_NUM_SEPS
- #define AVDT_NUM_SEPS 3
- #endif
- /* Number of transport channels setup per media stream(audio or video) */
- #ifndef AVDT_NUM_CHANNELS
- #if AVDT_REPORTING == TRUE
- /* signaling, media and reporting channels */
- #define AVDT_NUM_CHANNELS 3
- #else
- /* signaling and media channels */
- #define AVDT_NUM_CHANNELS 2
- #endif // AVDT_REPORTING
- #endif // AVDT_NUM_CHANNELS
- /* Number of transport channels setup by AVDT for all media streams
- * AVDT_NUM_CHANNELS * Number of simultaneous streams.
- */
- #ifndef AVDT_NUM_TC_TBL
- #define AVDT_NUM_TC_TBL 6
- #endif
- /* Maximum size in bytes of the codec capabilities information element. */
- #ifndef AVDT_CODEC_SIZE
- #define AVDT_CODEC_SIZE 10
- #endif
- /* Maximum size in bytes of the content protection information element. */
- #ifndef AVDT_PROTECT_SIZE
- #define AVDT_PROTECT_SIZE 90
- #endif
- /* Maximum number of GKI buffers in the fragment queue (for video frames).
- * Must be less than the number of buffers in the buffer pool of size AVDT_DATA_POOL_SIZE */
- #ifndef AVDT_MAX_FRAG_COUNT
- #define AVDT_MAX_FRAG_COUNT 15
- #endif
- /******************************************************************************
- **
- ** PAN
- **
- ******************************************************************************/
- #ifndef PAN_INCLUDED
- #define PAN_INCLUDED FALSE//TRUE
- #endif
- /* This will enable the PANU role */
- #ifndef PAN_SUPPORTS_ROLE_PANU
- #define PAN_SUPPORTS_ROLE_PANU FALSE//TRUE
- #endif
- /* This will enable the GN role */
- #ifndef PAN_SUPPORTS_ROLE_GN
- #define PAN_SUPPORTS_ROLE_GN FALSE//TRUE
- #endif
- /* This will enable the NAP role */
- #ifndef PAN_SUPPORTS_ROLE_NAP
- #define PAN_SUPPORTS_ROLE_NAP FALSE//TRUE
- #endif
- /* This is just for debugging purposes */
- #ifndef PAN_SUPPORTS_DEBUG_DUMP
- #define PAN_SUPPORTS_DEBUG_DUMP FALSE//TRUE
- #endif
- /* Maximum number of PAN connections allowed */
- #ifndef MAX_PAN_CONNS
- #define MAX_PAN_CONNS 7
- #endif
- /* Default service name for NAP role */
- #ifndef PAN_NAP_DEFAULT_SERVICE_NAME
- #define PAN_NAP_DEFAULT_SERVICE_NAME "Network Access Point Service"
- #endif
- /* Default service name for GN role */
- #ifndef PAN_GN_DEFAULT_SERVICE_NAME
- #define PAN_GN_DEFAULT_SERVICE_NAME "Group Network Service"
- #endif
- /* Default service name for PANU role */
- #ifndef PAN_PANU_DEFAULT_SERVICE_NAME
- #define PAN_PANU_DEFAULT_SERVICE_NAME "PAN User Service"
- #endif
- /* Default description for NAP role service */
- #ifndef PAN_NAP_DEFAULT_DESCRIPTION
- #define PAN_NAP_DEFAULT_DESCRIPTION "NAP"
- #endif
- /* Default description for GN role service */
- #ifndef PAN_GN_DEFAULT_DESCRIPTION
- #define PAN_GN_DEFAULT_DESCRIPTION "GN"
- #endif
- /* Default description for PANU role service */
- #ifndef PAN_PANU_DEFAULT_DESCRIPTION
- #define PAN_PANU_DEFAULT_DESCRIPTION "PANU"
- #endif
- /* Default Security level for PANU role. */
- #ifndef PAN_PANU_SECURITY_LEVEL
- #define PAN_PANU_SECURITY_LEVEL 0
- #endif
- /* Default Security level for GN role. */
- #ifndef PAN_GN_SECURITY_LEVEL
- #define PAN_GN_SECURITY_LEVEL 0
- #endif
- /* Default Security level for NAP role. */
- #ifndef PAN_NAP_SECURITY_LEVEL
- #define PAN_NAP_SECURITY_LEVEL 0
- #endif
- /******************************************************************************
- **
- ** GAP
- **
- ******************************************************************************/
- #ifndef GAP_INCLUDED
- #define GAP_INCLUDED TRUE
- #endif
- /* This is set to enable use of GAP L2CAP connections. */
- #ifndef GAP_CONN_INCLUDED
- #if GAP_INCLUDED == TRUE
- #define GAP_CONN_INCLUDED TRUE
- #else
- #define GAP_CONN_INCLUDED FALSE
- #endif
- #endif
- /* This is set to enable posting event for data write */
- #ifndef GAP_CONN_POST_EVT_INCLUDED
- #define GAP_CONN_POST_EVT_INCLUDED FALSE
- #endif
- /* The maximum number of simultaneous GAP L2CAP connections. */
- #ifndef GAP_MAX_CONNECTIONS
- #define GAP_MAX_CONNECTIONS 10 // 30
- #endif
- /* keep the raw data received from SDP server in database. */
- #ifndef SDP_RAW_DATA_INCLUDED
- #define SDP_RAW_DATA_INCLUDED TRUE
- #endif
- /* Inquiry duration in 1.28 second units. */
- #ifndef SDP_DEBUG
- #define SDP_DEBUG TRUE
- #endif
- /******************************************************************************
- **
- ** HID
- **
- ******************************************************************************/
- #ifndef HID_DEV_SUBCLASS
- #define HID_DEV_SUBCLASS COD_MINOR_POINTING
- #endif
- #ifndef HID_CONTROL_POOL_ID
- #define HID_CONTROL_POOL_ID 2
- #endif
- #ifndef HID_INTERRUPT_POOL_ID
- #define HID_INTERRUPT_POOL_ID 2
- #endif
- /*************************************************************************
- ** Definitions for Both HID-Host & Device
- */
- #ifndef HID_MAX_SVC_NAME_LEN
- #define HID_MAX_SVC_NAME_LEN 32
- #endif
- #ifndef HID_MAX_SVC_DESCR_LEN
- #define HID_MAX_SVC_DESCR_LEN 32
- #endif
- #ifndef HID_MAX_PROV_NAME_LEN
- #define HID_MAX_PROV_NAME_LEN 32
- #endif
- /*************************************************************************
- ** Definitions for HID-Host
- */
- #ifndef HID_HOST_INCLUDED
- #define HID_HOST_INCLUDED FALSE//TRUE
- #endif
- #ifndef HID_HOST_MAX_DEVICES
- #define HID_HOST_MAX_DEVICES 7
- #endif
- #ifndef HID_HOST_MTU
- #define HID_HOST_MTU 640
- #endif
- #ifndef HID_HOST_FLUSH_TO
- #define HID_HOST_FLUSH_TO 0xffff
- #endif
- #ifndef HID_HOST_MAX_CONN_RETRY
- #define HID_HOST_MAX_CONN_RETRY (3)
- #endif
- #ifndef HID_HOST_REPAGE_WIN
- #define HID_HOST_REPAGE_WIN (2)
- #endif
- /*************************************************************************
- * A2DP Definitions
- */
- #ifndef A2D_INCLUDED
- #define A2D_INCLUDED FALSE//TRUE
- #endif
- /******************************************************************************
- **
- ** AVCTP
- **
- ******************************************************************************/
- /* Number of simultaneous ACL links to different peer devices. */
- #ifndef AVCT_NUM_LINKS
- #define AVCT_NUM_LINKS 2
- #endif
- /* Number of simultaneous AVCTP connections. */
- #ifndef AVCT_NUM_CONN
- #define AVCT_NUM_CONN 3
- #endif
- /******************************************************************************
- **
- ** AVRCP
- **
- ******************************************************************************/
- #ifndef AVRC_INCLUDED
- #define AVRC_INCLUDED TRUE
- #endif
- #ifndef AVRC_METADATA_INCLUDED
- #if AVRC_INCLUDED == TRUE
- #define AVRC_METADATA_INCLUDED TRUE
- #else
- #define AVRC_METADATA_INCLUDED FALSE
- #endif
- #endif
- #ifndef AVRC_ADV_CTRL_INCLUDED
- #if AVRC_INCLUDED == TRUE
- #define AVRC_ADV_CTRL_INCLUDED TRUE
- #else
- #define AVRC_ADV_CTRL_INCLUDED FALSE
- #endif
- #endif
- #ifndef AVRC_CTLR_INCLUDED
- #if AVRC_INCLUDED == TRUE
- #define AVRC_CTLR_INCLUDED TRUE
- #else
- #define AVRC_CTLR_INCLUDED FALSE
- #endif
- #endif
- /******************************************************************************
- **
- ** MCAP
- **
- ******************************************************************************/
- #ifndef MCA_INCLUDED
- #define MCA_INCLUDED FALSE
- #endif
- /* The MTU size for the L2CAP configuration on control channel. 48 is the minimal */
- #ifndef MCA_CTRL_MTU
- #define MCA_CTRL_MTU 60
- #endif
- /* The maximum number of registered MCAP instances. */
- #ifndef MCA_NUM_REGS
- #define MCA_NUM_REGS 12
- #endif
- /* The maximum number of control channels (to difference devices) per registered MCAP instances. */
- #ifndef MCA_NUM_LINKS
- #define MCA_NUM_LINKS 3
- #endif
- /* The maximum number of MDEP (including HDP echo) per registered MCAP instances. */
- #ifndef MCA_NUM_DEPS
- #define MCA_NUM_DEPS 13
- #endif
- /* The maximum number of MDL link per control channel. */
- #ifndef MCA_NUM_MDLS
- #define MCA_NUM_MDLS 4
- #endif
- /* Pool ID where to reassemble the SDU. */
- #ifndef MCA_USER_RX_POOL_ID
- #define MCA_USER_RX_POOL_ID HCI_ACL_POOL_ID
- #endif
- /* Pool ID where to hold the SDU. */
- #ifndef MCA_USER_TX_POOL_ID
- #define MCA_USER_TX_POOL_ID HCI_ACL_POOL_ID
- #endif
- /*
- GKI Buffer Pool ID used to hold MPS segments during SDU reassembly
- */
- #ifndef MCA_FCR_RX_POOL_ID
- #define MCA_FCR_RX_POOL_ID HCI_ACL_POOL_ID
- #endif
- /*
- GKI Buffer Pool ID used to hold MPS segments used in (re)transmissions.
- L2CAP_DEFAULT_ERM_POOL_ID is specified to use the HCI ACL data pool.
- Note: This pool needs to have enough buffers to hold two times the window size negotiated
- in the tL2CAP_FCR_OPTIONS (2 * tx_win_size) to allow for retransmissions.
- The size of each buffer must be able to hold the maximum MPS segment size passed in
- tL2CAP_FCR_OPTIONS plus BT_HDR (8) + HCI preamble (4) + L2CAP_MIN_OFFSET (11 - as of BT 2.1 + EDR Spec).
- */
- #ifndef MCA_FCR_TX_POOL_ID
- #define MCA_FCR_TX_POOL_ID HCI_ACL_POOL_ID
- #endif
- /* MCAP control channel FCR Option:
- Size of the transmission window when using enhanced retransmission mode.
- 1 is defined by HDP specification for control channel.
- */
- #ifndef MCA_FCR_OPT_TX_WINDOW_SIZE
- #define MCA_FCR_OPT_TX_WINDOW_SIZE 1
- #endif
- /* MCAP control channel FCR Option:
- Number of transmission attempts for a single I-Frame before taking
- Down the connection. Used In ERTM mode only. Value is Ignored in basic and
- Streaming modes.
- Range: 0, 1-0xFF
- 0 - infinite retransmissions
- 1 - single transmission
- */
- #ifndef MCA_FCR_OPT_MAX_TX_B4_DISCNT
- #define MCA_FCR_OPT_MAX_TX_B4_DISCNT 20
- #endif
- /* MCAP control channel FCR Option: Retransmission Timeout
- The AVRCP specification set a value in the range of 300 - 2000 ms
- Timeout (in msecs) to detect Lost I-Frames. Only used in Enhanced retransmission mode.
- Range: Minimum 2000 (2 secs) when supporting PBF.
- */
- #ifndef MCA_FCR_OPT_RETX_TOUT
- #define MCA_FCR_OPT_RETX_TOUT 2000
- #endif
- /* MCAP control channel FCR Option: Monitor Timeout
- The AVRCP specification set a value in the range of 300 - 2000 ms
- Timeout (in msecs) to detect Lost S-Frames. Only used in Enhanced retransmission mode.
- Range: Minimum 12000 (12 secs) when supporting PBF.
- */
- #ifndef MCA_FCR_OPT_MONITOR_TOUT
- #define MCA_FCR_OPT_MONITOR_TOUT 12000
- #endif
- /* MCAP control channel FCR Option: Maximum PDU payload size.
- The maximum number of payload octets that the local device can receive in a single PDU.
- */
- #ifndef MCA_FCR_OPT_MPS_SIZE
- #define MCA_FCR_OPT_MPS_SIZE 1000
- #endif
- /* Shared transport */
- #ifndef NFC_SHARED_TRANSPORT_ENABLED
- #define NFC_SHARED_TRANSPORT_ENABLED FALSE
- #endif
- /******************************************************************************
- **
- ** Sleep Mode (Low Power Mode)
- **
- ******************************************************************************/
- #ifndef HCILP_INCLUDED
- #define HCILP_INCLUDED FALSE//TRUE
- #endif
- /******************************************************************************
- **
- ** APPL - Application Task
- **
- ******************************************************************************/
- #define L2CAP_FEATURE_REQ_ID 73
- #define L2CAP_FEATURE_RSP_ID 173
- /******************************************************************************
- **
- ** BTA
- **
- ******************************************************************************/
- /* BTA EIR canned UUID list (default is dynamic) */
- #ifndef BTA_EIR_CANNED_UUID_LIST
- #define BTA_EIR_CANNED_UUID_LIST FALSE
- #endif
- /* Number of supported customer UUID in EIR */
- #ifndef BTA_EIR_SERVER_NUM_CUSTOM_UUID
- #define BTA_EIR_SERVER_NUM_CUSTOM_UUID 8
- #endif
- /* CHLD override for bluedroid */
- #ifndef BTA_AG_CHLD_VAL_ECC
- #define BTA_AG_CHLD_VAL_ECC "(0,1,1x,2,2x,3)"
- #endif
- #ifndef BTA_AG_CHLD_VAL
- #define BTA_AG_CHLD_VAL "(0,1,2,3)"
- #endif
- /* Set the CIND to match HFP 1.5 */
- #ifndef BTA_AG_CIND_INFO
- #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))"
- #endif
- #ifndef BTA_DM_AVOID_A2DP_ROLESWITCH_ON_INQUIRY
- #define BTA_DM_AVOID_A2DP_ROLESWITCH_ON_INQUIRY FALSE//TRUE
- #endif
- /******************************************************************************
- **
- ** Tracing: Include trace header file here.
- **
- ******************************************************************************/
- /* Enable/disable BTSnoop memory logging */
- #ifndef BTSNOOP_MEM
- #define BTSNOOP_MEM FALSE//TRUE
- #endif
- #include "bt_trace.h"
- #endif /* BT_TARGET_H */
|