1 /****************************************************************************** 2 * 3 * Copyright (C) 2003-2012 Broadcom Corporation 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at: 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 * 17 ******************************************************************************/ 18 19 /****************************************************************************** 20 * 21 * This file contains compile-time configurable constants for the device 22 * manager. 23 * 24 ******************************************************************************/ 25 26 #include "bt_target.h" 27 #include "bta_sys.h" 28 #include "bta_api.h" 29 #include "bta_dm_int.h" 30 31 #ifndef BTA_DM_LINK_POLICY_SETTINGS 32 #define BTA_DM_LINK_POLICY_SETTINGS (HCI_ENABLE_MASTER_SLAVE_SWITCH | HCI_ENABLE_HOLD_MODE | HCI_ENABLE_SNIFF_MODE | HCI_ENABLE_PARK_MODE) 33 #endif 34 35 /* page timeout in 625uS */ 36 #ifndef BTA_DM_PAGE_TIMEOUT 37 #define BTA_DM_PAGE_TIMEOUT 8192 38 #endif 39 40 /* link supervision timeout in 625uS (5 secs) */ 41 #ifndef BTA_DM_LINK_TIMEOUT 42 #define BTA_DM_LINK_TIMEOUT 8000 43 #endif 44 45 /* For Insight, PM cfg lookup tables are runtime configurable (to allow tweaking of params for power consumption measurements) */ 46 #ifndef BTE_SIM_APP 47 #define tBTA_DM_PM_TYPE_QUALIFIER const 48 #else 49 #define tBTA_DM_PM_TYPE_QUALIFIER 50 #endif 51 52 53 const tBTA_DM_CFG bta_dm_cfg = 54 { 55 /* mobile phone COD */ 56 BTA_DM_COD, 57 /* link policy settings */ 58 BTA_DM_LINK_POLICY_SETTINGS, 59 /* page timeout in 625uS */ 60 BTA_DM_PAGE_TIMEOUT, 61 /* link supervision timeout in 625uS*/ 62 BTA_DM_LINK_TIMEOUT, 63 /* TRUE to avoid scatternet when av is streaming (be the master) */ 64 TRUE 65 }; 66 67 #ifndef BTA_DM_SCATTERNET 68 /* By default, allow partial scatternet */ 69 #define BTA_DM_SCATTERNET BTA_DM_PARTIAL_SCATTERNET 70 #endif 71 72 #ifndef BTA_HH_ROLE 73 /* By default, do not specify HH role (backward compatibility) */ 74 #define BTA_HH_ROLE BTA_ANY_ROLE 75 #endif 76 77 #ifndef BTA_AV_ROLE 78 /* By default, AV role (backward BTA_MASTER_ROLE_PREF) */ 79 #define BTA_AV_ROLE BTA_MASTER_ROLE_PREF 80 #endif 81 82 #define BTA_DM_NUM_RM_ENTRY 4 83 84 /* appids for PAN used by insight sample application 85 these have to be same as defined in btui_int.h */ 86 #define BTUI_PAN_ID_PANU 0 87 #define BTUI_PAN_ID_NAP 1 88 #define BTUI_PAN_ID_GN 2 89 90 /* First element is always for SYS: 91 app_id = # of entries table, cfg is 92 device scatternet support */ 93 const tBTA_DM_RM bta_dm_rm_cfg[] = 94 { 95 {BTA_ID_SYS, BTA_DM_NUM_RM_ENTRY, BTA_DM_SCATTERNET}, 96 {BTA_ID_PAN, BTUI_PAN_ID_NAP, BTA_MASTER_ROLE_ONLY}, 97 {BTA_ID_PAN, BTUI_PAN_ID_GN, BTA_MASTER_ROLE_ONLY}, 98 {BTA_ID_HH, BTA_ALL_APP_ID, BTA_HH_ROLE}, 99 {BTA_ID_AV, BTA_ALL_APP_ID, BTA_AV_ROLE} 100 }; 101 102 103 tBTA_DM_CFG *p_bta_dm_cfg = (tBTA_DM_CFG *)&bta_dm_cfg; 104 105 tBTA_DM_RM *p_bta_dm_rm_cfg = (tBTA_DM_RM *)&bta_dm_rm_cfg; 106 107 108 #define BTA_DM_NUM_PM_ENTRY (15+BTA_DM_NUM_JV_ID) /* number of entries in bta_dm_pm_cfg except the first */ 109 110 tBTA_DM_PM_TYPE_QUALIFIER tBTA_DM_PM_CFG bta_dm_pm_cfg[] = 111 { 112 {BTA_ID_SYS, BTA_DM_NUM_PM_ENTRY, 0}, 113 {BTA_ID_AG, BTA_ALL_APP_ID, 0}, /* ag uses first spec table for app id 0 */ 114 {BTA_ID_CT, 1, 1}, /* ct (BTA_ID_CT,APP ID=1) spec table */ 115 {BTA_ID_CG, BTA_ALL_APP_ID, 1}, /* cg resue ct spec table */ 116 {BTA_ID_DG, BTA_ALL_APP_ID, 2}, /* dg spec table */ 117 {BTA_ID_AV, BTA_ALL_APP_ID, 4}, /* av spec table */ 118 {BTA_ID_FTC, BTA_ALL_APP_ID, 6}, /* ftc spec table */ 119 {BTA_ID_FTS, BTA_ALL_APP_ID, 7}, /* fts spec table */ 120 {BTA_ID_HD, BTA_ALL_APP_ID, 3}, /* hd spec table */ 121 {BTA_ID_HH, BTA_ALL_APP_ID, 5}, /* hh spec table */ 122 {BTA_ID_PBC, BTA_ALL_APP_ID, 2}, /* reuse dg spec table */ 123 {BTA_ID_PBS, BTA_ALL_APP_ID, 7}, /* reuse fts spec table */ 124 {BTA_ID_OPC, BTA_ALL_APP_ID, 6}, /* reuse ftc spec table */ 125 {BTA_ID_OPS, BTA_ALL_APP_ID, 7}, /* reuse fts spec table */ 126 {BTA_ID_MSE, BTA_ALL_APP_ID, 7}, /* reuse fts spec table */ 127 {BTA_ID_JV1, BTA_ALL_APP_ID, 7}, /* reuse fts spec table */ 128 {BTA_ID_JV2, BTA_ALL_APP_ID, 7}, /* reuse fts spec table */ 129 {BTA_ID_HL, BTA_ALL_APP_ID, 8} /* reuse fts spec table */ 130 }; 131 132 133 #ifdef BTE_SIM_APP /* For Insight builds only, see the detail below */ 134 #define BTA_DM_NUM_PM_SPEC (9 + 2) /* additional two */ 135 #else 136 #define BTA_DM_NUM_PM_SPEC 9 /* additional JV*/ 137 #endif 138 139 tBTA_DM_PM_TYPE_QUALIFIER tBTA_DM_PM_SPEC bta_dm_pm_spec[BTA_DM_NUM_PM_SPEC] = 140 { 141 /* AG */ 142 { 143 (BTA_DM_PM_SNIFF | BTA_DM_PM_PARK), /* allow park & sniff */ 144 #if (BTM_SSR_INCLUDED == TRUE) 145 (BTA_DM_PM_SSR2), /* the SSR entry */ 146 #endif 147 { 148 {{BTA_DM_PM_SNIFF, 5000}, {BTA_DM_PM_NO_ACTION, 0}}, /* conn open sniff */ 149 {{BTA_DM_PM_NO_PREF, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* conn close */ 150 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app open */ 151 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app close */ 152 {{BTA_DM_PM_SNIFF3, 5000}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco open, active */ 153 {{BTA_DM_PM_SNIFF, 5000}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco close sniff */ 154 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* idle */ 155 {{BTA_DM_PM_ACTIVE, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* busy */ 156 {{BTA_DM_PM_RETRY, 5000}, {BTA_DM_PM_NO_ACTION, 0}} /* mode change retry */ 157 } 158 }, 159 160 /* CT */ 161 { 162 (BTA_DM_PM_SNIFF | BTA_DM_PM_PARK), /* allow park & sniff */ 163 #if (BTM_SSR_INCLUDED == TRUE) 164 (BTA_DM_PM_SSR2), /* the SSR entry */ 165 #endif 166 { 167 {{BTA_DM_PM_PARK, 5000}, {BTA_DM_PM_NO_ACTION, 0}}, /* conn open park */ 168 {{BTA_DM_PM_NO_PREF, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* conn close */ 169 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app open */ 170 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app close */ 171 {{BTA_DM_PM_SNIFF, 5000}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco open sniff */ 172 {{BTA_DM_PM_PARK, 5000}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco close park */ 173 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* idle */ 174 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* busy */ 175 {{BTA_DM_PM_RETRY, 5000}, {BTA_DM_PM_NO_ACTION, 0}} /* mode change retry */ 176 } 177 }, 178 179 /* DG */ 180 { 181 (BTA_DM_PM_ACTIVE), /* no power saving mode allowed */ 182 #if (BTM_SSR_INCLUDED == TRUE) 183 (BTA_DM_PM_SSR2), /* the SSR entry */ 184 #endif 185 { 186 {{BTA_DM_PM_ACTIVE, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* conn open active */ 187 {{BTA_DM_PM_NO_PREF, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* conn close */ 188 {{BTA_DM_PM_ACTIVE, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app open */ 189 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app close */ 190 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco open */ 191 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco close */ 192 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* idle */ 193 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* busy */ 194 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}} /* mode change retry */ 195 } 196 }, 197 198 /* HD */ 199 { 200 (BTA_DM_PM_SNIFF | BTA_DM_PM_PARK), /* allow park & sniff */ 201 #if (BTM_SSR_INCLUDED == TRUE) 202 (BTA_DM_PM_SSR3), /* the SSR entry */ 203 #endif 204 { 205 {{BTA_DM_PM_SNIFF4, 5000}, {BTA_DM_PM_NO_ACTION, 0}}, /* conn open sniff */ 206 {{BTA_DM_PM_NO_PREF, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* conn close */ 207 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app open */ 208 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app close */ 209 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco open */ 210 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco close */ 211 {{BTA_DM_PM_SNIFF2, 5000}, {BTA_DM_PM_NO_ACTION, 0}}, /* idle */ 212 {{BTA_DM_PM_SNIFF4, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* busy */ 213 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}} /* mode change retry */ 214 } 215 }, 216 217 /* AV */ 218 { 219 (BTA_DM_PM_SNIFF), /* allow sniff */ 220 #if (BTM_SSR_INCLUDED == TRUE) 221 (BTA_DM_PM_SSR2), /* the SSR entry */ 222 #endif 223 { 224 {{BTA_DM_PM_SNIFF, 5000}, {BTA_DM_PM_NO_ACTION, 0}}, /* conn open sniff */ 225 {{BTA_DM_PM_NO_PREF, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* conn close */ 226 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app open */ 227 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app close */ 228 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco open */ 229 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco close */ 230 {{BTA_DM_PM_SNIFF, 5000}, {BTA_DM_PM_NO_ACTION, 0}}, /* idle */ 231 {{BTA_DM_PM_ACTIVE, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* busy */ 232 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}} /* mode change retry */ 233 } 234 }, 235 236 /* HH */ 237 { 238 (BTA_DM_PM_SNIFF | BTA_DM_PM_PARK), /* allow park & sniff */ 239 #if (BTM_SSR_INCLUDED == TRUE) 240 (BTA_DM_PM_SSR1), /* the SSR entry */ 241 #endif 242 { 243 {{BTA_DM_PM_SNIFF2, 7000}, {BTA_DM_PM_NO_ACTION, 0}}, /* conn open sniff */ 244 {{BTA_DM_PM_NO_PREF, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* conn close */ 245 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app open */ 246 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app close */ 247 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco open */ 248 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco close, used for HH suspend */ 249 {{BTA_DM_PM_SNIFF2, 7000}, {BTA_DM_PM_NO_ACTION, 0}}, /* idle */ 250 {{BTA_DM_PM_SNIFF2, 7000}, {BTA_DM_PM_NO_ACTION, 0}}, /* busy */ 251 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}} /* mode change retry */ 252 } 253 }, 254 255 /* FTC, OPC */ 256 { 257 (BTA_DM_PM_SNIFF), /* allow sniff */ 258 #if (BTM_SSR_INCLUDED == TRUE) 259 (BTA_DM_PM_SSR2), /* the SSR entry */ 260 #endif 261 { 262 {{BTA_DM_PM_ACTIVE, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* conn open active */ 263 {{BTA_DM_PM_NO_PREF, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* conn close */ 264 {{BTA_DM_PM_ACTIVE, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app open */ 265 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app close */ 266 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco open */ 267 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco close */ 268 {{BTA_DM_PM_SNIFF, 5000}, {BTA_DM_PM_NO_ACTION, 0}}, /* idle */ 269 {{BTA_DM_PM_ACTIVE, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* busy */ 270 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}} /* mode change retry */ 271 } 272 }, 273 274 /* FTS, OPS */ 275 { 276 (BTA_DM_PM_SNIFF), /* allow sniff */ 277 #if (BTM_SSR_INCLUDED == TRUE) 278 (BTA_DM_PM_SSR2), /* the SSR entry */ 279 #endif 280 { 281 {{BTA_DM_PM_ACTIVE, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* conn open active */ 282 {{BTA_DM_PM_NO_PREF, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* conn close */ 283 {{BTA_DM_PM_ACTIVE, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app open */ 284 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app close */ 285 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco open */ 286 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco close */ 287 {{BTA_DM_PM_SNIFF, 7000}, {BTA_DM_PM_NO_ACTION, 0}}, /* idle */ 288 {{BTA_DM_PM_ACTIVE, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* busy */ 289 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}} /* mode change retry */ 290 } 291 }, 292 293 /* HL */ 294 { 295 (BTA_DM_PM_SNIFF), /* allow sniff */ 296 #if (BTM_SSR_INCLUDED == TRUE) 297 (BTA_DM_PM_SSR2), /* the SSR entry */ 298 #endif 299 { 300 {{BTA_DM_PM_SNIFF, 5000}, {BTA_DM_PM_NO_ACTION, 0}}, /* conn open sniff */ 301 {{BTA_DM_PM_NO_PREF, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* conn close */ 302 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app open */ 303 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app close */ 304 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco open, active */ 305 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco close sniff */ 306 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* idle */ 307 {{BTA_DM_PM_ACTIVE, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* busy */ 308 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}} /* mode change retry */ 309 } 310 } 311 312 #ifdef BTE_SIM_APP /* For Insight builds only */ 313 /* Entries at the end of the pm_spec table are user-defined (runtime configurable), 314 for power consumption experiments. 315 Insight finds the first user-defined entry by looking for the first BTA_DM_PM_NO_PREF. 316 The number of user_defined specs is defined by BTA_SWRAP_UD_PM_SPEC_COUNT */ 317 , 318 {BTA_DM_PM_NO_PREF}, /* pm_spec USER_DEFINED_0 */ 319 {BTA_DM_PM_NO_PREF} /* pm_spec USER_DEFINED_1 */ 320 #endif /* BTE_SIM_APP */ 321 }; 322 323 tBTA_DM_PM_TYPE_QUALIFIER tBTM_PM_PWR_MD bta_dm_pm_md[] = 324 { 325 /* more sniff parameter entries can be added for BTA_DM_PM_SNIFF3 - BTA_DM_PM_SNIFF7, if needed 326 When entries are added or removed, BTA_DM_PM_PARK_IDX needs to be updated to reflect the actual index 327 BTA_DM_PM_PARK_IDX is defined in bta_api.h and can be override by the bdroid_buildcfg.h settings. 328 The SNIFF table entries must be in the order from highest latency (biggest interval) to lowest latency. 329 If there's a conflict among the connected services, the setting with lowest latency wins. 330 */ 331 /* sniff modes: max interval, min interval, attempt, timeout */ 332 {800, 400, 4, 1, BTM_PM_MD_SNIFF}, /*for BTA_DM_PM_SNIFF - A2DP */ 333 {400, 200, 4, 1, BTM_PM_MD_SNIFF}, /*for BTA_DM_PM_SNIFF1 */ 334 {180, 150, 4, 1, BTM_PM_MD_SNIFF}, /*for BTA_DM_PM_SNIFF2- HD idle */ 335 {150, 50, 4, 1, BTM_PM_MD_SNIFF}, /*for BTA_DM_PM_SNIFF3- SCO open */ 336 { 54, 30, 4, 1, BTM_PM_MD_SNIFF}, /*for BTA_DM_PM_SNIFF4- HD active*/ 337 {800, 400, 0, 0, BTM_PM_MD_PARK} 338 339 #ifdef BTE_SIM_APP /* For Insight builds only */ 340 /* Entries at the end of the bta_dm_pm_md table are user-defined (runtime configurable), 341 for power consumption experiments. 342 Insight finds the first user-defined entry by looking for the first 'max=0'. 343 The number of user_defined specs is defined by BTA_SWRAP_UD_PM_DM_COUNT */ 344 , 345 {0}, /* CONN_OPEN/SCO_CLOSE power mode settings for pm_spec USER_DEFINED_0 */ 346 {0}, /* SCO_OPEN power mode settings for pm_spec USER_DEFINED_0 */ 347 348 {0}, /* CONN_OPEN/SCO_CLOSE power mode settings for pm_spec USER_DEFINED_1 */ 349 {0} /* SCO_OPEN power mode settings for pm_spec USER_DEFINED_1 */ 350 #endif /* BTE_SIM_APP */ 351 }; 352 353 /* 0=max_lat -> no SSR */ 354 /* the smaller of the SSR max latency wins. 355 * the entries in this table must be from highest latency (biggest interval) to lowest latency */ 356 #if (BTM_SSR_INCLUDED == TRUE) 357 tBTA_DM_SSR_SPEC bta_dm_ssr_spec[] = 358 { 359 /*max_lat, min_rmt_to, min_loc_to*/ 360 {0, 0, 0}, /* BTA_DM_PM_SSR0 - do not use SSR */ 361 {1600, 2, 2}, /* BTA_DM_PM_SSR1 - HH */ 362 {1200, 2, 2}, /* BTA_DM_PM_SSR2 - others (as long as sniff is allowed)*/ 363 {360, 160, 2} /* BTA_DM_PM_SSR3 - HD */ 364 }; 365 366 tBTA_DM_SSR_SPEC *p_bta_dm_ssr_spec = (tBTA_DM_SSR_SPEC *)&bta_dm_ssr_spec; 367 #endif 368 369 tBTA_DM_PM_CFG *p_bta_dm_pm_cfg = (tBTA_DM_PM_CFG *)&bta_dm_pm_cfg; 370 tBTA_DM_PM_SPEC *p_bta_dm_pm_spec = (tBTA_DM_PM_SPEC *)&bta_dm_pm_spec; 371 tBTM_PM_PWR_MD *p_bta_dm_pm_md = (tBTM_PM_PWR_MD *)&bta_dm_pm_md; 372 373 /* The performance impact of EIR packet size 374 ** 375 ** When BTM_EIR_DEFAULT_FEC_REQUIRED is TRUE, 376 ** 1 to 17 bytes, DM1 is used and most robust. 377 ** 18 to 121 bytes, DM3 is used but impacts inquiry scan time with large number 378 ** of devices.(almost double with 150 users) 379 ** 122 to 224 bytes, DM5 is used but cause quite big performance loss even with 380 ** small number of users. so it is not recommended. 381 ** 225 to 240 bytes, DH5 is used without FEC but it not recommended. 382 ** (same reason of DM5) 383 ** 384 ** When BTM_EIR_DEFAULT_FEC_REQUIRED is FALSE, 385 ** 1 to 27 bytes, DH1 is used but only robust at short range. 386 ** 28 to 183 bytes, DH3 is used but only robust at short range and impacts inquiry 387 ** scan time with large number of devices. 388 ** 184 to 240 bytes, DH5 is used but it not recommended. 389 */ 390 391 #if ( BTM_EIR_SERVER_INCLUDED == TRUE ) 392 #if (BTA_EIR_CANNED_UUID_LIST == TRUE) 393 /* for example */ 394 const UINT8 bta_dm_eir_uuid16_list[] = { 0x08, 0x11, /* Headset */ 395 0x1E, 0x11, /* Handsfree */ 396 0x0E, 0x11, /* AV Remote Control */ 397 0x0B, 0x11, /* Audio Sink */ 398 }; 399 #endif 400 401 /* Extended Inquiry Response */ 402 const tBTA_DM_EIR_CONF bta_dm_eir_cfg = 403 { 404 50, /* minimum length of local name when it is shortened */ 405 /* if length of local name is longer than this and EIR has not enough */ 406 /* room for all UUID list then local name is shortened to this length */ 407 #if (BTA_EIR_CANNED_UUID_LIST == TRUE) 408 8, 409 (UINT8 *)bta_dm_eir_uuid16_list, 410 #else 411 { /* mask of UUID list in EIR */ 412 0xFFFFFFFF, /* LSB is the first UUID of the first 32 UUIDs in BTM_EIR_UUID_LKUP_TBL */ 413 0xFFFFFFFF /* LSB is the first UUID of the next 32 UUIDs in BTM_EIR_UUID_LKUP_TBL */ 414 /* BTM_EIR_UUID_LKUP_TBL can be overrided */ 415 }, 416 #endif 417 NULL, /* Inquiry TX power */ 418 0, /* length of flags in bytes */ 419 NULL, /* flags for EIR */ 420 0, /* length of manufacturer specific in bytes */ 421 NULL, /* manufacturer specific */ 422 }; 423 tBTA_DM_EIR_CONF *p_bta_dm_eir_cfg = (tBTA_DM_EIR_CONF*)&bta_dm_eir_cfg; 424 #endif 425