blob: e1e2cadfb21fca92d461f5f8766a05522e07d6bc [file] [log] [blame]
The Android Open Source Project5738f832012-12-12 16:00:35 -08001/******************************************************************************
2 *
Jakub Pawlowski5b790fe2017-09-18 09:00:20 -07003 * Copyright 2003-2012 Broadcom Corporation
The Android Open Source Project5738f832012-12-12 16:00:35 -08004 *
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
Scott James Remnant933926c2015-04-02 15:22:14 -070026#include <stddef.h>
Myles Watsonf355ef52016-11-09 13:04:33 -080027
The Android Open Source Project5738f832012-12-12 16:00:35 -080028#include "bt_target.h"
The Android Open Source Project5738f832012-12-12 16:00:35 -080029#include "bta_api.h"
30#include "bta_dm_int.h"
Kim Low18985be2017-12-20 15:11:08 -080031#include "bta_hh_api.h"
Ganesh Ganapathi Batta2f338f22013-03-24 03:11:59 +010032#include "bta_jv_api.h"
Myles Watsoncd1fd072016-11-09 13:17:43 -080033#include "bta_sys.h"
The Android Open Source Project5738f832012-12-12 16:00:35 -080034
35#ifndef BTA_DM_LINK_POLICY_SETTINGS
Myles Watsoncd1fd072016-11-09 13:17:43 -080036#define BTA_DM_LINK_POLICY_SETTINGS \
37 (HCI_ENABLE_MASTER_SLAVE_SWITCH | HCI_ENABLE_HOLD_MODE | \
38 HCI_ENABLE_SNIFF_MODE | HCI_ENABLE_PARK_MODE)
The Android Open Source Project5738f832012-12-12 16:00:35 -080039#endif
40
41/* page timeout in 625uS */
42#ifndef BTA_DM_PAGE_TIMEOUT
Myles Watsoncd1fd072016-11-09 13:17:43 -080043#define BTA_DM_PAGE_TIMEOUT 8192
The Android Open Source Project5738f832012-12-12 16:00:35 -080044#endif
45
46/* link supervision timeout in 625uS (5 secs) */
47#ifndef BTA_DM_LINK_TIMEOUT
Myles Watsoncd1fd072016-11-09 13:17:43 -080048#define BTA_DM_LINK_TIMEOUT 8000
The Android Open Source Project5738f832012-12-12 16:00:35 -080049#endif
50
Marie Janssend19e0782016-07-15 12:48:27 -070051/* TRUE to avoid scatternet when av is streaming (be the master) */
Mattias Agren9647e912013-04-08 12:23:42 +020052#ifndef BTA_DM_AVOID_SCATTER_A2DP
Myles Watsoncd1fd072016-11-09 13:17:43 -080053#define BTA_DM_AVOID_SCATTER_A2DP TRUE
Mattias Agren9647e912013-04-08 12:23:42 +020054#endif
55
Myles Watsoncd1fd072016-11-09 13:17:43 -080056/* For Insight, PM cfg lookup tables are runtime configurable (to allow tweaking
57 * of params for power consumption measurements) */
The Android Open Source Project5738f832012-12-12 16:00:35 -080058#ifndef BTE_SIM_APP
Myles Watsoncd1fd072016-11-09 13:17:43 -080059#define tBTA_DM_PM_TYPE_QUALIFIER const
The Android Open Source Project5738f832012-12-12 16:00:35 -080060#else
61#define tBTA_DM_PM_TYPE_QUALIFIER
62#endif
63
Myles Watsoncd1fd072016-11-09 13:17:43 -080064const tBTA_DM_CFG bta_dm_cfg = {
The Android Open Source Project5738f832012-12-12 16:00:35 -080065 /* mobile phone COD */
66 BTA_DM_COD,
67 /* link policy settings */
68 BTA_DM_LINK_POLICY_SETTINGS,
69 /* page timeout in 625uS */
70 BTA_DM_PAGE_TIMEOUT,
71 /* link supervision timeout in 625uS*/
72 BTA_DM_LINK_TIMEOUT,
Marie Janssene9e58ce2016-06-17 14:12:17 -070073 /* true to avoid scatternet when av is streaming (be the master) */
Myles Watsoncd1fd072016-11-09 13:17:43 -080074 BTA_DM_AVOID_SCATTER_A2DP};
The Android Open Source Project5738f832012-12-12 16:00:35 -080075
76#ifndef BTA_DM_SCATTERNET
77/* By default, allow partial scatternet */
78#define BTA_DM_SCATTERNET BTA_DM_PARTIAL_SCATTERNET
79#endif
80
81#ifndef BTA_HH_ROLE
82/* By default, do not specify HH role (backward compatibility) */
83#define BTA_HH_ROLE BTA_ANY_ROLE
84#endif
85
86#ifndef BTA_AV_ROLE
87/* By default, AV role (backward BTA_MASTER_ROLE_PREF) */
88#define BTA_AV_ROLE BTA_MASTER_ROLE_PREF
89#endif
90
tturneye31d4172015-09-21 10:49:09 -070091#ifndef BTA_PANU_ROLE
92/* By default, AV role (backward BTA_MASTER_ROLE_PREF) */
93#define BTA_PANU_ROLE BTA_SLAVE_ROLE_ONLY
94#endif
Myles Watsoncd1fd072016-11-09 13:17:43 -080095#define BTA_DM_NUM_RM_ENTRY 6
The Android Open Source Project5738f832012-12-12 16:00:35 -080096
97/* appids for PAN used by insight sample application
98 these have to be same as defined in btui_int.h */
Myles Watsoncd1fd072016-11-09 13:17:43 -080099#define BTUI_PAN_ID_PANU 0
100#define BTUI_PAN_ID_NAP 1
101#define BTUI_PAN_ID_GN 2
The Android Open Source Project5738f832012-12-12 16:00:35 -0800102
103/* First element is always for SYS:
104 app_id = # of entries table, cfg is
105 device scatternet support */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800106const tBTA_DM_RM bta_dm_rm_cfg[] = {
The Android Open Source Project5738f832012-12-12 16:00:35 -0800107 {BTA_ID_SYS, BTA_DM_NUM_RM_ENTRY, BTA_DM_SCATTERNET},
tturneye31d4172015-09-21 10:49:09 -0700108 {BTA_ID_PAN, BTUI_PAN_ID_NAP, BTA_ANY_ROLE},
109 {BTA_ID_PAN, BTUI_PAN_ID_GN, BTA_ANY_ROLE},
110 {BTA_ID_PAN, BTA_APP_ID_PAN_MULTI, BTA_MASTER_ROLE_ONLY},
111 {BTA_ID_PAN, BTUI_PAN_ID_PANU, BTA_PANU_ROLE},
Myles Watsoncd1fd072016-11-09 13:17:43 -0800112 {BTA_ID_HH, BTA_ALL_APP_ID, BTA_HH_ROLE},
113 {BTA_ID_AV, BTA_ALL_APP_ID, BTA_AV_ROLE}};
The Android Open Source Project5738f832012-12-12 16:00:35 -0800114
Myles Watson6ef91902017-10-03 12:35:59 -0700115const tBTA_DM_CFG* p_bta_dm_cfg = &bta_dm_cfg;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800116
Myles Watson6ef91902017-10-03 12:35:59 -0700117const tBTA_DM_RM* p_bta_dm_rm_cfg = &bta_dm_rm_cfg[0];
The Android Open Source Project5738f832012-12-12 16:00:35 -0800118
Myles Watsoncd1fd072016-11-09 13:17:43 -0800119#define BTA_DM_NUM_PM_ENTRY \
Kim Low18985be2017-12-20 15:11:08 -0800120 25 /* number of entries in bta_dm_pm_cfg except the first */
121#define BTA_DM_NUM_PM_SPEC 16 /* number of entries in bta_dm_pm_spec */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800122
Myles Watsoncd1fd072016-11-09 13:17:43 -0800123tBTA_DM_PM_TYPE_QUALIFIER tBTA_DM_PM_CFG
124 bta_dm_pm_cfg[BTA_DM_NUM_PM_ENTRY + 1] = {
125 {BTA_ID_SYS, BTA_DM_NUM_PM_ENTRY,
126 0}, /* reserved: specifies length of this table. */
127 {BTA_ID_AG, BTA_ALL_APP_ID,
128 0}, /* ag uses first spec table for app id 0 */
129 {BTA_ID_CT, 1, 1}, /* ct (BTA_ID_CT,APP ID=1) spec table */
Kim Low18985be2017-12-20 15:11:08 -0800130 {BTA_ID_CG, BTA_ALL_APP_ID, 1}, /* cg resue ct spec table */
131 {BTA_ID_DG, BTA_ALL_APP_ID, 2}, /* dg spec table */
132 {BTA_ID_AV, BTA_ALL_APP_ID, 4}, /* av spec table */
Allen-CT Chuaf305112019-06-03 14:44:32 +0800133 {BTA_ID_AVK, BTA_ALL_APP_ID, 13}, /* avk spec table */
134 {BTA_ID_FTC, BTA_ALL_APP_ID, 7}, /* ftc spec table */
135 {BTA_ID_FTS, BTA_ALL_APP_ID, 8}, /* fts spec table */
Kim Low18985be2017-12-20 15:11:08 -0800136 {BTA_ID_HD, BTA_ALL_APP_ID, 3}, /* hd spec table */
137 {BTA_ID_HH, BTA_HH_APP_ID_JOY, 5}, /* app BTA_HH_APP_ID_JOY,
138 similar to hh spec table */
139 {BTA_ID_HH, BTA_HH_APP_ID_GPAD, 5}, /* app BTA_HH_APP_ID_GPAD,
140 similar to hh spec table */
141 {BTA_ID_HH, BTA_ALL_APP_ID, 6}, /* hh spec table */
142 {BTA_ID_PBC, BTA_ALL_APP_ID, 2}, /* reuse dg spec table */
Allen-CT Chuaf305112019-06-03 14:44:32 +0800143 {BTA_ID_PBS, BTA_ALL_APP_ID, 8}, /* reuse fts spec table */
144 {BTA_ID_OPC, BTA_ALL_APP_ID, 7}, /* reuse ftc spec table */
145 {BTA_ID_OPS, BTA_ALL_APP_ID, 8}, /* reuse fts spec table */
146 {BTA_ID_MSE, BTA_ALL_APP_ID, 8}, /* reuse fts spec table */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800147 {BTA_ID_JV, BTA_JV_PM_ID_1,
Allen-CT Chuaf305112019-06-03 14:44:32 +0800148 7}, /* app BTA_JV_PM_ID_1, reuse ftc spec table */
149 {BTA_ID_JV, BTA_ALL_APP_ID, 8}, /* reuse fts spec table */
150 {BTA_ID_HL, BTA_ALL_APP_ID, 9}, /* reuse fts spec table */
151 {BTA_ID_PAN, BTUI_PAN_ID_PANU, 10}, /* PANU spec table */
152 {BTA_ID_PAN, BTUI_PAN_ID_NAP, 11}, /* NAP spec table */
153 {BTA_ID_HS, BTA_ALL_APP_ID, 12}, /* HS spec table */
154 {BTA_ID_GATTC, BTA_ALL_APP_ID, 14}, /* gattc spec table */
155 {BTA_ID_GATTS, BTA_ALL_APP_ID, 15} /* gatts spec table */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800156};
157
Myles Watsoncd1fd072016-11-09 13:17:43 -0800158tBTA_DM_PM_TYPE_QUALIFIER tBTA_DM_PM_SPEC bta_dm_pm_spec[BTA_DM_NUM_PM_SPEC] = {
159 /* AG : 0 */
160 {(BTA_DM_PM_SNIFF | BTA_DM_PM_PARK), /* allow park & sniff */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800161#if (BTM_SSR_INCLUDED == TRUE)
Myles Watsoncd1fd072016-11-09 13:17:43 -0800162 (BTA_DM_PM_SSR2), /* the SSR entry */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800163#endif
Myles Watsoncd1fd072016-11-09 13:17:43 -0800164 {
165 {{BTA_DM_PM_SNIFF_A2DP_IDX, 7000},
166 {BTA_DM_PM_NO_ACTION, 0}}, /* conn open sniff */
167 {{BTA_DM_PM_NO_PREF, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* conn close */
168 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app open */
169 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app close */
170 {{BTA_DM_PM_SNIFF_SCO_OPEN_IDX, 7000},
171 {BTA_DM_PM_NO_ACTION, 0}}, /* sco open, active */
172 {{BTA_DM_PM_SNIFF_A2DP_IDX, 7000},
173 {BTA_DM_PM_NO_ACTION, 0}}, /* sco close sniff */
Ugo Yuf012de42018-09-13 20:12:36 +0800174 {{BTA_DM_PM_SNIFF_A2DP_IDX, 7000},
175 {BTA_DM_PM_NO_ACTION, 0}}, /* idle */
176 {{BTA_DM_PM_ACTIVE, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* busy */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800177 {{BTA_DM_PM_RETRY, 7000},
178 {BTA_DM_PM_NO_ACTION, 0}} /* mode change retry */
179 }},
The Android Open Source Project5738f832012-12-12 16:00:35 -0800180
Myles Watsoncd1fd072016-11-09 13:17:43 -0800181 /* CT, CG : 1 */
182 {(BTA_DM_PM_SNIFF | BTA_DM_PM_PARK), /* allow park & sniff */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800183#if (BTM_SSR_INCLUDED == TRUE)
Myles Watsoncd1fd072016-11-09 13:17:43 -0800184 (BTA_DM_PM_SSR2), /* the SSR entry */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800185#endif
Myles Watsoncd1fd072016-11-09 13:17:43 -0800186 {
187 {{BTA_DM_PM_PARK, 5000},
188 {BTA_DM_PM_NO_ACTION, 0}}, /* conn open park */
189 {{BTA_DM_PM_NO_PREF, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* conn close */
190 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app open */
191 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app close */
192 {{BTA_DM_PM_SNIFF_A2DP_IDX, 5000},
193 {BTA_DM_PM_NO_ACTION, 0}}, /* sco open sniff */
194 {{BTA_DM_PM_PARK, 5000},
195 {BTA_DM_PM_NO_ACTION, 0}}, /* sco close park */
196 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* idle */
197 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* busy */
198 {{BTA_DM_PM_RETRY, 5000},
199 {BTA_DM_PM_NO_ACTION, 0}} /* mode change retry */
200 }},
The Android Open Source Project5738f832012-12-12 16:00:35 -0800201
Myles Watsoncd1fd072016-11-09 13:17:43 -0800202 /* DG, PBC : 2 */
203 {(BTA_DM_PM_ACTIVE), /* no power saving mode allowed */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800204#if (BTM_SSR_INCLUDED == TRUE)
Myles Watsoncd1fd072016-11-09 13:17:43 -0800205 (BTA_DM_PM_SSR2), /* the SSR entry */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800206#endif
Myles Watsoncd1fd072016-11-09 13:17:43 -0800207 {
208 {{BTA_DM_PM_SNIFF, 5000},
209 {BTA_DM_PM_NO_ACTION, 0}}, /* conn open active */
210 {{BTA_DM_PM_NO_PREF, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* conn close */
211 {{BTA_DM_PM_ACTIVE, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app open */
212 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app close */
213 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco open */
214 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco close */
215 {{BTA_DM_PM_SNIFF, 1000}, {BTA_DM_PM_NO_ACTION, 0}}, /* idle */
216 {{BTA_DM_PM_ACTIVE, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* busy */
217 {{BTA_DM_PM_NO_ACTION, 0},
218 {BTA_DM_PM_NO_ACTION, 0}} /* mode change retry */
219 }},
The Android Open Source Project5738f832012-12-12 16:00:35 -0800220
Myles Watsoncd1fd072016-11-09 13:17:43 -0800221 /* HD : 3 */
222 {(BTA_DM_PM_SNIFF | BTA_DM_PM_PARK), /* allow park & sniff */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800223#if (BTM_SSR_INCLUDED == TRUE)
Myles Watsoncd1fd072016-11-09 13:17:43 -0800224 (BTA_DM_PM_SSR3), /* the SSR entry */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800225#endif
Myles Watsoncd1fd072016-11-09 13:17:43 -0800226 {
227 {{BTA_DM_PM_SNIFF_HD_ACTIVE_IDX, 5000},
228 {BTA_DM_PM_NO_ACTION, 0}}, /* conn open sniff */
229 {{BTA_DM_PM_NO_PREF, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* conn close */
230 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app open */
231 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app close */
232 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco open */
233 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco close */
234 {{BTA_DM_PM_SNIFF_HD_IDLE_IDX, 5000},
235 {BTA_DM_PM_NO_ACTION, 0}}, /* idle */
236 {{BTA_DM_PM_SNIFF_HD_ACTIVE_IDX, 0},
237 {BTA_DM_PM_NO_ACTION, 0}}, /* busy */
238 {{BTA_DM_PM_NO_ACTION, 0},
239 {BTA_DM_PM_NO_ACTION, 0}} /* mode change retry */
240 }},
The Android Open Source Project5738f832012-12-12 16:00:35 -0800241
Myles Watsoncd1fd072016-11-09 13:17:43 -0800242 /* AV : 4 */
243 {(BTA_DM_PM_SNIFF), /* allow sniff */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800244#if (BTM_SSR_INCLUDED == TRUE)
Ugo Yuf012de42018-09-13 20:12:36 +0800245 (BTA_DM_PM_SSR2), /* the SSR entry */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800246#endif
Myles Watsoncd1fd072016-11-09 13:17:43 -0800247 {
248 {{BTA_DM_PM_SNIFF_A2DP_IDX, 7000},
249 {BTA_DM_PM_NO_ACTION, 0}}, /* conn open sniff */
250 {{BTA_DM_PM_NO_PREF, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* conn close */
251 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app open */
252 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app close */
253 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco open */
254 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco close */
255 {{BTA_DM_PM_SNIFF_A2DP_IDX, 7000},
256 {BTA_DM_PM_NO_ACTION, 0}}, /* idle */
257 {{BTA_DM_PM_ACTIVE, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* busy */
258 {{BTA_DM_PM_NO_ACTION, 0},
259 {BTA_DM_PM_NO_ACTION, 0}} /* mode change retry */
260 }},
The Android Open Source Project5738f832012-12-12 16:00:35 -0800261
Kim Low18985be2017-12-20 15:11:08 -0800262 /* HH for joysticks and gamepad : 5 */
263 {(BTA_DM_PM_SNIFF | BTA_DM_PM_PARK), /* allow park & sniff */
264#if (BTM_SSR_INCLUDED == TRUE)
265 (BTA_DM_PM_SSR1), /* the SSR entry */
266#endif
267 {
268 {{BTA_DM_PM_SNIFF6, BTA_DM_PM_HH_OPEN_DELAY},
269 {BTA_DM_PM_NO_ACTION, 0}}, /* conn open sniff */
270 {{BTA_DM_PM_NO_PREF, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* conn close */
271 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app open */
272 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app close */
273 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco open */
274 {{BTA_DM_PM_NO_ACTION, 0},
275 {BTA_DM_PM_NO_ACTION, 0}}, /* sco close, used for HH suspend */
276 {{BTA_DM_PM_SNIFF6, BTA_DM_PM_HH_IDLE_DELAY},
277 {BTA_DM_PM_NO_ACTION, 0}}, /* idle */
278 {{BTA_DM_PM_SNIFF6, BTA_DM_PM_HH_ACTIVE_DELAY},
279 {BTA_DM_PM_NO_ACTION, 0}}, /* busy */
280 {{BTA_DM_PM_NO_ACTION, 0},
281 {BTA_DM_PM_NO_ACTION, 0}} /* mode change retry */
282 }},
283
284 /* HH : 6 */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800285 {(BTA_DM_PM_SNIFF | BTA_DM_PM_PARK), /* allow park & sniff */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800286#if (BTM_SSR_INCLUDED == TRUE)
Myles Watsoncd1fd072016-11-09 13:17:43 -0800287 (BTA_DM_PM_SSR1), /* the SSR entry */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800288#endif
Myles Watsoncd1fd072016-11-09 13:17:43 -0800289 {
290 {{BTA_DM_PM_SNIFF_HH_OPEN_IDX, BTA_DM_PM_HH_OPEN_DELAY},
291 {BTA_DM_PM_NO_ACTION, 0}}, /* conn open sniff */
292 {{BTA_DM_PM_NO_PREF, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* conn close */
293 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app open */
294 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app close */
295 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco open */
296 {{BTA_DM_PM_NO_ACTION, 0},
297 {BTA_DM_PM_NO_ACTION, 0}}, /* sco close, used for HH suspend */
298 {{BTA_DM_PM_SNIFF_HH_IDLE_IDX, BTA_DM_PM_HH_IDLE_DELAY},
299 {BTA_DM_PM_NO_ACTION, 0}}, /* idle */
300 {{BTA_DM_PM_SNIFF_HH_ACTIVE_IDX, BTA_DM_PM_HH_ACTIVE_DELAY},
301 {BTA_DM_PM_NO_ACTION, 0}}, /* busy */
302 {{BTA_DM_PM_NO_ACTION, 0},
303 {BTA_DM_PM_NO_ACTION, 0}} /* mode change retry */
304 }},
The Android Open Source Project5738f832012-12-12 16:00:35 -0800305
Kim Low18985be2017-12-20 15:11:08 -0800306 /* FTC, OPC, JV : 7 */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800307 {(BTA_DM_PM_SNIFF), /* allow sniff */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800308#if (BTM_SSR_INCLUDED == TRUE)
Myles Watsoncd1fd072016-11-09 13:17:43 -0800309 (BTA_DM_PM_SSR2), /* the SSR entry */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800310#endif
Myles Watsoncd1fd072016-11-09 13:17:43 -0800311 {
312 {{BTA_DM_PM_ACTIVE, 0},
313 {BTA_DM_PM_NO_ACTION, 0}}, /* conn open active */
314 {{BTA_DM_PM_NO_PREF, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* conn close */
315 {{BTA_DM_PM_ACTIVE, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app open */
316 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app close */
317 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco open */
318 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco close */
Zach Johnson53898382018-03-30 13:33:54 -0700319 {{BTA_DM_PM_SNIFF_A2DP_IDX, BTA_FTC_IDLE_TO_SNIFF_DELAY_MS},
Myles Watsoncd1fd072016-11-09 13:17:43 -0800320 {BTA_DM_PM_NO_ACTION, 0}}, /* idle */
321 {{BTA_DM_PM_ACTIVE, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* busy */
322 {{BTA_DM_PM_NO_ACTION, 0},
323 {BTA_DM_PM_NO_ACTION, 0}} /* mode change retry */
324 }},
The Android Open Source Project5738f832012-12-12 16:00:35 -0800325
Kim Low18985be2017-12-20 15:11:08 -0800326 /* FTS, PBS, OPS, MSE, BTA_JV_PM_ID_1 : 8 */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800327 {(BTA_DM_PM_SNIFF), /* allow sniff */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800328#if (BTM_SSR_INCLUDED == TRUE)
Myles Watsoncd1fd072016-11-09 13:17:43 -0800329 (BTA_DM_PM_SSR2), /* the SSR entry */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800330#endif
Myles Watsoncd1fd072016-11-09 13:17:43 -0800331 {
332 {{BTA_DM_PM_ACTIVE, 0},
333 {BTA_DM_PM_NO_ACTION, 0}}, /* conn open active */
334 {{BTA_DM_PM_NO_PREF, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* conn close */
335 {{BTA_DM_PM_ACTIVE, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app open */
336 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app close */
337 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco open */
338 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco close */
339 {{BTA_DM_PM_SNIFF_A2DP_IDX, BTA_FTS_OPS_IDLE_TO_SNIFF_DELAY_MS},
340 {BTA_DM_PM_NO_ACTION, 0}}, /* idle */
341 {{BTA_DM_PM_ACTIVE, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* busy */
342 {{BTA_DM_PM_NO_ACTION, 0},
343 {BTA_DM_PM_NO_ACTION, 0}} /* mode change retry */
344 }},
The Android Open Source Project5738f832012-12-12 16:00:35 -0800345
Kim Low18985be2017-12-20 15:11:08 -0800346 /* HL : 9 */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800347 {(BTA_DM_PM_SNIFF), /* allow sniff */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800348#if (BTM_SSR_INCLUDED == TRUE)
Myles Watsoncd1fd072016-11-09 13:17:43 -0800349 (BTA_DM_PM_SSR2), /* the SSR entry */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800350#endif
Myles Watsoncd1fd072016-11-09 13:17:43 -0800351 {
352 {{BTA_DM_PM_SNIFF_A2DP_IDX, 5000},
353 {BTA_DM_PM_NO_ACTION, 0}}, /* conn open sniff */
354 {{BTA_DM_PM_NO_PREF, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* conn close */
355 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app open */
356 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app close */
357 {{BTA_DM_PM_NO_ACTION, 0},
358 {BTA_DM_PM_NO_ACTION, 0}}, /* sco open, active */
359 {{BTA_DM_PM_NO_ACTION, 0},
360 {BTA_DM_PM_NO_ACTION, 0}}, /* sco close sniff */
361 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* idle */
362 {{BTA_DM_PM_ACTIVE, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* busy */
363 {{BTA_DM_PM_NO_ACTION, 0},
364 {BTA_DM_PM_NO_ACTION, 0}} /* mode change retry */
365 }},
Nitin Shivpure36f43cc2013-08-29 21:28:59 +0530366
Kim Low18985be2017-12-20 15:11:08 -0800367 /* PANU : 10 */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800368 {(BTA_DM_PM_SNIFF), /* allow sniff */
Nitin Shivpure36f43cc2013-08-29 21:28:59 +0530369#if (BTM_SSR_INCLUDED == TRUE)
Myles Watsoncd1fd072016-11-09 13:17:43 -0800370 (BTA_DM_PM_SSR2), /* the SSR entry */
Nitin Shivpure36f43cc2013-08-29 21:28:59 +0530371#endif
Myles Watsoncd1fd072016-11-09 13:17:43 -0800372 {
373 {{BTA_DM_PM_ACTIVE, 0},
374 {BTA_DM_PM_NO_ACTION, 0}}, /* conn open active */
375 {{BTA_DM_PM_NO_PREF, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* conn close */
376 {{BTA_DM_PM_ACTIVE, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app open */
377 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app close */
378 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco open */
379 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco close */
380 {{BTA_DM_PM_SNIFF_A2DP_IDX, 5000},
381 {BTA_DM_PM_NO_ACTION, 0}}, /* idle */
382 {{BTA_DM_PM_ACTIVE, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* busy */
383 {{BTA_DM_PM_NO_ACTION, 0},
384 {BTA_DM_PM_NO_ACTION, 0}} /* mode change retry */
385 }},
Nitin Shivpure36f43cc2013-08-29 21:28:59 +0530386
Kim Low18985be2017-12-20 15:11:08 -0800387 /* NAP : 11 */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800388 {(BTA_DM_PM_SNIFF), /* allow sniff */
Nitin Shivpure36f43cc2013-08-29 21:28:59 +0530389#if (BTM_SSR_INCLUDED == TRUE)
Myles Watsoncd1fd072016-11-09 13:17:43 -0800390 (BTA_DM_PM_SSR2), /* the SSR entry */
Nitin Shivpure36f43cc2013-08-29 21:28:59 +0530391#endif
Myles Watsoncd1fd072016-11-09 13:17:43 -0800392 {
393 {{BTA_DM_PM_ACTIVE, 0},
394 {BTA_DM_PM_NO_ACTION, 0}}, /* conn open active */
395 {{BTA_DM_PM_NO_PREF, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* conn close */
396 {{BTA_DM_PM_ACTIVE, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app open */
397 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app close */
398 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco open */
399 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco close */
400 {{BTA_DM_PM_SNIFF_A2DP_IDX, 5000},
401 {BTA_DM_PM_NO_ACTION, 0}}, /* idle */
402 {{BTA_DM_PM_ACTIVE, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* busy */
VenkatRaghavan VijayaRaghavan76356ae2015-04-21 11:32:29 -0700403
Myles Watsoncd1fd072016-11-09 13:17:43 -0800404 {{BTA_DM_PM_NO_ACTION, 0},
405 {BTA_DM_PM_NO_ACTION, 0}} /* mode change retry */
406 }},
The Android Open Source Project5738f832012-12-12 16:00:35 -0800407
Kim Low18985be2017-12-20 15:11:08 -0800408 /* HS : 12 */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800409 {(BTA_DM_PM_SNIFF | BTA_DM_PM_PARK), /* allow park & sniff */
Hemant Gupta41d4a262013-08-19 18:33:01 +0530410#if (BTM_SSR_INCLUDED == TRUE)
Myles Watsoncd1fd072016-11-09 13:17:43 -0800411 (BTA_DM_PM_SSR2), /* the SSR entry */
Hemant Gupta41d4a262013-08-19 18:33:01 +0530412#endif
Myles Watsoncd1fd072016-11-09 13:17:43 -0800413 {
414 {{BTA_DM_PM_SNIFF, 7000},
415 {BTA_DM_PM_NO_ACTION, 0}}, /* conn open sniff */
416 {{BTA_DM_PM_NO_PREF, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* conn close */
417 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app open */
418 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app close */
419 {{BTA_DM_PM_SNIFF3, 7000},
420 {BTA_DM_PM_NO_ACTION, 0}}, /* sco open, active */
421 {{BTA_DM_PM_SNIFF, 7000},
422 {BTA_DM_PM_NO_ACTION, 0}}, /* sco close sniff */
423 {{BTA_DM_PM_SNIFF, 7000}, {BTA_DM_PM_NO_ACTION, 0}}, /* idle */
424 {{BTA_DM_PM_ACTIVE, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* busy */
425 {{BTA_DM_PM_RETRY, 7000},
426 {BTA_DM_PM_NO_ACTION, 0}} /* mode change retry */
427 }},
Pavlin Radoslavov1076b7b2015-07-22 22:49:26 -0700428
Kim Low18985be2017-12-20 15:11:08 -0800429 /* AVK : 13 */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800430 {(BTA_DM_PM_SNIFF), /* allow sniff */
Pavlin Radoslavov1076b7b2015-07-22 22:49:26 -0700431#if (BTM_SSR_INCLUDED == TRUE)
Myles Watsoncd1fd072016-11-09 13:17:43 -0800432 (BTA_DM_PM_SSR2), /* the SSR entry */
Pavlin Radoslavov1076b7b2015-07-22 22:49:26 -0700433#endif
Myles Watsoncd1fd072016-11-09 13:17:43 -0800434 {
435 {{BTA_DM_PM_SNIFF, 3000},
436 {BTA_DM_PM_NO_ACTION, 0}}, /* conn open sniff */
437 {{BTA_DM_PM_NO_PREF, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* conn close */
438 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app open */
439 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app close */
440 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco open */
441 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco close */
442 {{BTA_DM_PM_SNIFF4, 3000}, {BTA_DM_PM_NO_ACTION, 0}}, /* idle */
443 {{BTA_DM_PM_ACTIVE, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* busy */
444 {{BTA_DM_PM_NO_ACTION, 0},
445 {BTA_DM_PM_NO_ACTION, 0}} /* mode change retry */
446 }}
Pavlin Radoslavov1076b7b2015-07-22 22:49:26 -0700447
Kim Low18985be2017-12-20 15:11:08 -0800448 /* GATTC : 14 */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800449 ,
450 {(BTA_DM_PM_SNIFF | BTA_DM_PM_PARK), /* allow park & sniff */
Andre Eisenbach781b5ad2013-05-28 15:11:43 +0900451#if (BTM_SSR_INCLUDED == TRUE)
Myles Watsoncd1fd072016-11-09 13:17:43 -0800452 (BTA_DM_PM_SSR2), /* the SSR entry */
Andre Eisenbach781b5ad2013-05-28 15:11:43 +0900453#endif
Myles Watsoncd1fd072016-11-09 13:17:43 -0800454 {
455 {{BTA_DM_PM_SNIFF_A2DP_IDX, 10000},
456 {BTA_DM_PM_NO_ACTION, 0}}, /* conn open active */
457 {{BTA_DM_PM_NO_PREF, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* conn close */
458 {{BTA_DM_PM_ACTIVE, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app open */
459 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app close */
460 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco open */
461 {{BTA_DM_PM_NO_ACTION, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco close */
462 {{BTA_DM_PM_SNIFF_A2DP_IDX, 10000},
463 {BTA_DM_PM_NO_ACTION, 0}}, /* idle */
464 {{BTA_DM_PM_ACTIVE, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* busy */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800465 {{BTA_DM_PM_RETRY, 5000},
466 {BTA_DM_PM_NO_ACTION, 0}} /* mode change retry */
467 }}
Kim Low18985be2017-12-20 15:11:08 -0800468 /* GATTS : 15 */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800469 ,
470 {(BTA_DM_PM_SNIFF | BTA_DM_PM_PARK), /* allow park & sniff */
Andre Eisenbach781b5ad2013-05-28 15:11:43 +0900471#if (BTM_SSR_INCLUDED == TRUE)
Myles Watsoncd1fd072016-11-09 13:17:43 -0800472 (BTA_DM_PM_SSR2), /* the SSR entry */
Andre Eisenbach781b5ad2013-05-28 15:11:43 +0900473#endif
Myles Watsoncd1fd072016-11-09 13:17:43 -0800474 {
475 {{BTA_DM_PM_NO_PREF, 0},
476 {BTA_DM_PM_NO_ACTION, 0}}, /* conn open active */
477 {{BTA_DM_PM_NO_PREF, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* conn close */
478 {{BTA_DM_PM_NO_PREF, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app open */
479 {{BTA_DM_PM_NO_PREF, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* app close */
480 {{BTA_DM_PM_NO_PREF, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco open */
481 {{BTA_DM_PM_NO_PREF, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* sco close */
482 {{BTA_DM_PM_NO_PREF, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* idle */
483 {{BTA_DM_PM_NO_PREF, 0}, {BTA_DM_PM_NO_ACTION, 0}}, /* busy */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800484 {{BTA_DM_PM_RETRY, 5000},
485 {BTA_DM_PM_NO_ACTION, 0}} /* mode change retry */
486 }}
Andre Eisenbach781b5ad2013-05-28 15:11:43 +0900487
Myles Watsoncd1fd072016-11-09 13:17:43 -0800488#ifdef BTE_SIM_APP /* For Insight builds only */
489 /* Entries at the end of the pm_spec table are user-defined (runtime
490 configurable),
491 for power consumption experiments.
492 Insight finds the first user-defined entry by looking for the first
493 BTA_DM_PM_NO_PREF.
494 The number of user_defined specs is defined by
495 BTA_SWRAP_UD_PM_SPEC_COUNT */
496 ,
497 {BTA_DM_PM_NO_PREF}, /* pm_spec USER_DEFINED_0 */
498 {BTA_DM_PM_NO_PREF} /* pm_spec USER_DEFINED_1 */
499#endif /* BTE_SIM_APP */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800500};
501
Adam Hampson63399d92014-05-19 16:23:45 -0700502/* Please refer to the SNIFF table definitions in bta_api.h.
503 *
504 * Adding to or Modifying the Table
Kim Low18985be2017-12-20 15:11:08 -0800505 * Additional sniff parameter entries can be added for BTA_DM_PM_SNIFF6 -
Myles Watsoncd1fd072016-11-09 13:17:43 -0800506 * BTA_DM_PM_SNIFF7.
507 * Overrides of additional table entries can be specified in bdroid_buildcfg.h.
508 * If additional
509 * sniff parameter entries are added or an override of an existing entry is
510 * specified in
511 * bdroid_buildcfg.h then the BTA_DM_PM_*_IDX defines in bta_api.h will need to
512 * be match the new
Adam Hampson63399d92014-05-19 16:23:45 -0700513 * ordering.
514 *
515 * Table Ordering
Myles Watsoncd1fd072016-11-09 13:17:43 -0800516 * Sniff Table entries must be ordered from highest latency (biggest interval)
517 * to lowest latency.
518 * If there is a conflict among the connected services the setting with the
519 * lowest latency will
Adam Hampson63399d92014-05-19 16:23:45 -0700520 * be selected.
521 */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800522tBTA_DM_PM_TYPE_QUALIFIER tBTM_PM_PWR_MD bta_dm_pm_md[] = {
523 /*
524 * More sniff parameter entries can be added for
525 * BTA_DM_PM_SNIFF3 - BTA_DM_PM_SNIFF7, if needed. When entries are added or
526 * removed, BTA_DM_PM_PARK_IDX needs to be updated to reflect the actual
527 * index
528 * BTA_DM_PM_PARK_IDX is defined in bta_api.h and can be override by the
529 * bdroid_buildcfg.h settings.
530 * The SNIFF table entries must be in the order from highest latency
531 * (biggest
532 * interval) to lowest latency. If there's a conflict among the connected
533 * services, the setting with lowest latency wins.
534 */
535 /* sniff modes: max interval, min interval, attempt, timeout */
536 {BTA_DM_PM_SNIFF_MAX, BTA_DM_PM_SNIFF_MIN, BTA_DM_PM_SNIFF_ATTEMPT,
537 BTA_DM_PM_SNIFF_TIMEOUT, BTM_PM_MD_SNIFF}, /* for BTA_DM_PM_SNIFF - A2DP */
538 {BTA_DM_PM_SNIFF1_MAX, BTA_DM_PM_SNIFF1_MIN, BTA_DM_PM_SNIFF1_ATTEMPT,
539 BTA_DM_PM_SNIFF1_TIMEOUT, BTM_PM_MD_SNIFF}, /* for BTA_DM_PM_SNIFF1 */
540 {BTA_DM_PM_SNIFF2_MAX, BTA_DM_PM_SNIFF2_MIN, BTA_DM_PM_SNIFF2_ATTEMPT,
541 BTA_DM_PM_SNIFF2_TIMEOUT,
542 BTM_PM_MD_SNIFF}, /* for BTA_DM_PM_SNIFF2- HD idle */
543 {BTA_DM_PM_SNIFF3_MAX, BTA_DM_PM_SNIFF3_MIN, BTA_DM_PM_SNIFF3_ATTEMPT,
544 BTA_DM_PM_SNIFF3_TIMEOUT,
545 BTM_PM_MD_SNIFF}, /* for BTA_DM_PM_SNIFF3- SCO open */
546 {BTA_DM_PM_SNIFF4_MAX, BTA_DM_PM_SNIFF4_MIN, BTA_DM_PM_SNIFF4_ATTEMPT,
547 BTA_DM_PM_SNIFF4_TIMEOUT,
548 BTM_PM_MD_SNIFF}, /* for BTA_DM_PM_SNIFF4- HD active */
549 {BTA_DM_PM_SNIFF5_MAX, BTA_DM_PM_SNIFF5_MIN, BTA_DM_PM_SNIFF5_ATTEMPT,
550 BTA_DM_PM_SNIFF5_TIMEOUT,
551 BTM_PM_MD_SNIFF}, /* for BTA_DM_PM_SNIFF5- HD active */
Kim Low18985be2017-12-20 15:11:08 -0800552 {BTA_DM_PM_SNIFF6_MAX, BTA_DM_PM_SNIFF6_MIN, BTA_DM_PM_SNIFF6_ATTEMPT,
553 BTA_DM_PM_SNIFF6_TIMEOUT,
554 BTM_PM_MD_SNIFF}, /* for BTA_DM_PM_SNIFF6- HD active */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800555 {BTA_DM_PM_PARK_MAX, BTA_DM_PM_PARK_MIN, BTA_DM_PM_PARK_ATTEMPT,
556 BTA_DM_PM_PARK_TIMEOUT, BTM_PM_MD_PARK}
The Android Open Source Project5738f832012-12-12 16:00:35 -0800557
Myles Watsoncd1fd072016-11-09 13:17:43 -0800558#ifdef BTE_SIM_APP /* For Insight builds only */
559 /* Entries at the end of the bta_dm_pm_md table are user-defined (runtime
560 configurable),
561 for power consumption experiments.
562 Insight finds the first user-defined entry by looking for the first
563 'max=0'.
564 The number of user_defined specs is defined by BTA_SWRAP_UD_PM_DM_COUNT
565 */
566 ,
567 {0}, /* CONN_OPEN/SCO_CLOSE power mode settings for pm_spec USER_DEFINED_0
568 */
569 {0}, /* SCO_OPEN power mode settings for pm_spec USER_DEFINED_0 */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800570
Myles Watsoncd1fd072016-11-09 13:17:43 -0800571 {0}, /* CONN_OPEN/SCO_CLOSE power mode settings for pm_spec USER_DEFINED_1
572 */
573 {0} /* SCO_OPEN power mode settings for pm_spec USER_DEFINED_1 */
574#endif /* BTE_SIM_APP */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800575};
576
577/* 0=max_lat -> no SSR */
578/* the smaller of the SSR max latency wins.
Myles Watsoncd1fd072016-11-09 13:17:43 -0800579 * the entries in this table must be from highest latency (biggest interval) to
580 * lowest latency */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800581#if (BTM_SSR_INCLUDED == TRUE)
Myles Watsoncd1fd072016-11-09 13:17:43 -0800582tBTA_DM_SSR_SPEC bta_dm_ssr_spec[] = {
The Android Open Source Project5738f832012-12-12 16:00:35 -0800583 /*max_lat, min_rmt_to, min_loc_to*/
Myles Watsoncd1fd072016-11-09 13:17:43 -0800584 {0, 0, 0}, /* BTA_DM_PM_SSR0 - do not use SSR */
Hemant Gupta8843cc82014-04-18 12:34:55 +0530585 /* BTA_DM_PM_SSR1 - HH, can NOT share entry with any other profile, seting
586 default max latency and min remote timeout as 0, and always read
587 individual device preference from HH module */
588 {0, 0, 2},
Ugo Yuf012de42018-09-13 20:12:36 +0800589 {1200, 2, 2}, /* BTA_DM_PM_SSR2 - others (as long as sniff is allowed)*/
590 {360, 160, 1600}, /* BTA_DM_PM_SSR3 - HD */
591 {1200, 65534, 65534} /* BTA_DM_PM_SSR4 - A2DP streaming */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800592};
593
Myles Watson6ef91902017-10-03 12:35:59 -0700594tBTA_DM_SSR_SPEC* p_bta_dm_ssr_spec = &bta_dm_ssr_spec[0];
The Android Open Source Project5738f832012-12-12 16:00:35 -0800595#endif
596
Myles Watson6ef91902017-10-03 12:35:59 -0700597const tBTA_DM_PM_CFG* p_bta_dm_pm_cfg = &bta_dm_pm_cfg[0];
598const tBTA_DM_PM_SPEC* p_bta_dm_pm_spec = &bta_dm_pm_spec[0];
599const tBTM_PM_PWR_MD* p_bta_dm_pm_md = &bta_dm_pm_md[0];
The Android Open Source Project5738f832012-12-12 16:00:35 -0800600
601/* The performance impact of EIR packet size
Myles Watson8af480e2016-11-09 10:40:23 -0800602 *
603 * When BTM_EIR_DEFAULT_FEC_REQUIRED is true,
604 * 1 to 17 bytes, DM1 is used and most robust.
605 * 18 to 121 bytes, DM3 is used but impacts inquiry scan time with large number
606 * of devices.(almost double with 150 users)
607 * 122 to 224 bytes, DM5 is used but cause quite big performance loss even with
608 * small number of users. so it is not recommended.
609 * 225 to 240 bytes, DH5 is used without FEC but it not recommended.
610 * (same reason of DM5)
611 *
612 * When BTM_EIR_DEFAULT_FEC_REQUIRED is false,
613 * 1 to 27 bytes, DH1 is used but only robust at short range.
Myles Watsoncd1fd072016-11-09 13:17:43 -0800614 * 28 to 183 bytes, DH3 is used but only robust at short range and impacts
615 * inquiry
Myles Watson8af480e2016-11-09 10:40:23 -0800616 * scan time with large number of devices.
617 * 184 to 240 bytes, DH5 is used but it not recommended.
The Android Open Source Project5738f832012-12-12 16:00:35 -0800618*/
619
The Android Open Source Project5738f832012-12-12 16:00:35 -0800620#if (BTA_EIR_CANNED_UUID_LIST == TRUE)
Myles Watsoncd1fd072016-11-09 13:17:43 -0800621/* for example */
622const uint8_t bta_dm_eir_uuid16_list[] = {
623 0x08, 0x11, /* Headset */
624 0x1E, 0x11, /* Handsfree */
625 0x0E, 0x11, /* AV Remote Control */
626 0x0B, 0x11, /* Audio Sink */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800627};
Chris Manton1e61ce12014-10-24 09:12:41 -0700628#endif // BTA_EIR_CANNED_UUID_LIST
The Android Open Source Project5738f832012-12-12 16:00:35 -0800629
630/* Extended Inquiry Response */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800631const tBTA_DM_EIR_CONF bta_dm_eir_cfg = {
632 50, /* minimum length of local name when it is shortened */
633 /* if length of local name is longer than this and EIR has not enough */
634 /* room for all UUID list then local name is shortened to this length */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800635#if (BTA_EIR_CANNED_UUID_LIST == TRUE)
Myles Watsoncd1fd072016-11-09 13:17:43 -0800636 8, (uint8_t*)bta_dm_eir_uuid16_list,
637#else // BTA_EIR_CANNED_UUID_LIST
638 {
639 /* mask of UUID list in EIR */
640 0xFFFFFFFF, /* LSB is the first UUID of the first 32 UUIDs in
641 BTM_EIR_UUID_LKUP_TBL */
642 0xFFFFFFFF /* LSB is the first UUID of the next 32 UUIDs in
643 BTM_EIR_UUID_LKUP_TBL */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800644 /* BTM_EIR_UUID_LKUP_TBL can be overrided */
645 },
Myles Watsoncd1fd072016-11-09 13:17:43 -0800646#endif // BTA_EIR_CANNED_UUID_LIST
647 NULL, /* Inquiry TX power */
648 0, /* length of flags in bytes */
649 NULL, /* flags for EIR */
650 0, /* length of manufacturer specific in bytes */
651 NULL, /* manufacturer specific */
652 0, /* length of additional data in bytes */
653 NULL /* additional data */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800654};
Myles Watson6ef91902017-10-03 12:35:59 -0700655const tBTA_DM_EIR_CONF* p_bta_dm_eir_cfg = &bta_dm_eir_cfg;