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