The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | * |
Jakub Pawlowski | 5b790fe | 2017-09-18 09:00:20 -0700 | [diff] [blame] | 3 | * Copyright 2003-2012 Broadcom Corporation |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 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 | |
Scott James Remnant | 933926c | 2015-04-02 15:22:14 -0700 | [diff] [blame] | 26 | #include <stddef.h> |
Myles Watson | f355ef5 | 2016-11-09 13:04:33 -0800 | [diff] [blame] | 27 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 28 | #include "bt_target.h" |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 29 | #include "bta_api.h" |
| 30 | #include "bta_dm_int.h" |
Kim Low | 18985be | 2017-12-20 15:11:08 -0800 | [diff] [blame] | 31 | #include "bta_hh_api.h" |
Ganesh Ganapathi Batta | 2f338f2 | 2013-03-24 03:11:59 +0100 | [diff] [blame] | 32 | #include "bta_jv_api.h" |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 33 | #include "bta_sys.h" |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 34 | |
| 35 | #ifndef BTA_DM_LINK_POLICY_SETTINGS |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 36 | #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 Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 39 | #endif |
| 40 | |
| 41 | /* page timeout in 625uS */ |
| 42 | #ifndef BTA_DM_PAGE_TIMEOUT |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 43 | #define BTA_DM_PAGE_TIMEOUT 8192 |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 44 | #endif |
| 45 | |
| 46 | /* link supervision timeout in 625uS (5 secs) */ |
| 47 | #ifndef BTA_DM_LINK_TIMEOUT |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 48 | #define BTA_DM_LINK_TIMEOUT 8000 |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 49 | #endif |
| 50 | |
Marie Janssen | d19e078 | 2016-07-15 12:48:27 -0700 | [diff] [blame] | 51 | /* TRUE to avoid scatternet when av is streaming (be the master) */ |
Mattias Agren | 9647e91 | 2013-04-08 12:23:42 +0200 | [diff] [blame] | 52 | #ifndef BTA_DM_AVOID_SCATTER_A2DP |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 53 | #define BTA_DM_AVOID_SCATTER_A2DP TRUE |
Mattias Agren | 9647e91 | 2013-04-08 12:23:42 +0200 | [diff] [blame] | 54 | #endif |
| 55 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 56 | /* For Insight, PM cfg lookup tables are runtime configurable (to allow tweaking |
| 57 | * of params for power consumption measurements) */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 58 | #ifndef BTE_SIM_APP |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 59 | #define tBTA_DM_PM_TYPE_QUALIFIER const |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 60 | #else |
| 61 | #define tBTA_DM_PM_TYPE_QUALIFIER |
| 62 | #endif |
| 63 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 64 | const tBTA_DM_CFG bta_dm_cfg = { |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 65 | /* 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 Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 73 | /* true to avoid scatternet when av is streaming (be the master) */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 74 | BTA_DM_AVOID_SCATTER_A2DP}; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 75 | |
| 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 | |
tturney | e31d417 | 2015-09-21 10:49:09 -0700 | [diff] [blame] | 91 | #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 Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 95 | #define BTA_DM_NUM_RM_ENTRY 6 |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 96 | |
| 97 | /* appids for PAN used by insight sample application |
| 98 | these have to be same as defined in btui_int.h */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 99 | #define BTUI_PAN_ID_PANU 0 |
| 100 | #define BTUI_PAN_ID_NAP 1 |
| 101 | #define BTUI_PAN_ID_GN 2 |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 102 | |
| 103 | /* First element is always for SYS: |
| 104 | app_id = # of entries table, cfg is |
| 105 | device scatternet support */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 106 | const tBTA_DM_RM bta_dm_rm_cfg[] = { |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 107 | {BTA_ID_SYS, BTA_DM_NUM_RM_ENTRY, BTA_DM_SCATTERNET}, |
tturney | e31d417 | 2015-09-21 10:49:09 -0700 | [diff] [blame] | 108 | {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 Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 112 | {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 Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 114 | |
Myles Watson | 6ef9190 | 2017-10-03 12:35:59 -0700 | [diff] [blame] | 115 | const tBTA_DM_CFG* p_bta_dm_cfg = &bta_dm_cfg; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 116 | |
Myles Watson | 6ef9190 | 2017-10-03 12:35:59 -0700 | [diff] [blame] | 117 | const tBTA_DM_RM* p_bta_dm_rm_cfg = &bta_dm_rm_cfg[0]; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 118 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 119 | #define BTA_DM_NUM_PM_ENTRY \ |
Kim Low | 18985be | 2017-12-20 15:11:08 -0800 | [diff] [blame] | 120 | 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 Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 122 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 123 | tBTA_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 Low | 18985be | 2017-12-20 15:11:08 -0800 | [diff] [blame] | 130 | {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 Chu | af30511 | 2019-06-03 14:44:32 +0800 | [diff] [blame] | 133 | {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 Low | 18985be | 2017-12-20 15:11:08 -0800 | [diff] [blame] | 136 | {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 Chu | af30511 | 2019-06-03 14:44:32 +0800 | [diff] [blame] | 143 | {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 Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 147 | {BTA_ID_JV, BTA_JV_PM_ID_1, |
Allen-CT Chu | af30511 | 2019-06-03 14:44:32 +0800 | [diff] [blame] | 148 | 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 Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 156 | }; |
| 157 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 158 | tBTA_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 Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 161 | #if (BTM_SSR_INCLUDED == TRUE) |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 162 | (BTA_DM_PM_SSR2), /* the SSR entry */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 163 | #endif |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 164 | { |
| 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 Yu | f012de4 | 2018-09-13 20:12:36 +0800 | [diff] [blame] | 174 | {{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 Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 177 | {{BTA_DM_PM_RETRY, 7000}, |
| 178 | {BTA_DM_PM_NO_ACTION, 0}} /* mode change retry */ |
| 179 | }}, |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 180 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 181 | /* CT, CG : 1 */ |
| 182 | {(BTA_DM_PM_SNIFF | BTA_DM_PM_PARK), /* allow park & sniff */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 183 | #if (BTM_SSR_INCLUDED == TRUE) |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 184 | (BTA_DM_PM_SSR2), /* the SSR entry */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 185 | #endif |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 186 | { |
| 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 Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 201 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 202 | /* DG, PBC : 2 */ |
| 203 | {(BTA_DM_PM_ACTIVE), /* no power saving mode allowed */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 204 | #if (BTM_SSR_INCLUDED == TRUE) |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 205 | (BTA_DM_PM_SSR2), /* the SSR entry */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 206 | #endif |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 207 | { |
| 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 Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 220 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 221 | /* HD : 3 */ |
| 222 | {(BTA_DM_PM_SNIFF | BTA_DM_PM_PARK), /* allow park & sniff */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 223 | #if (BTM_SSR_INCLUDED == TRUE) |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 224 | (BTA_DM_PM_SSR3), /* the SSR entry */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 225 | #endif |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 226 | { |
| 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 Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 241 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 242 | /* AV : 4 */ |
| 243 | {(BTA_DM_PM_SNIFF), /* allow sniff */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 244 | #if (BTM_SSR_INCLUDED == TRUE) |
Ugo Yu | f012de4 | 2018-09-13 20:12:36 +0800 | [diff] [blame] | 245 | (BTA_DM_PM_SSR2), /* the SSR entry */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 246 | #endif |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 247 | { |
| 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 Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 261 | |
Kim Low | 18985be | 2017-12-20 15:11:08 -0800 | [diff] [blame] | 262 | /* 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 Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 285 | {(BTA_DM_PM_SNIFF | BTA_DM_PM_PARK), /* allow park & sniff */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 286 | #if (BTM_SSR_INCLUDED == TRUE) |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 287 | (BTA_DM_PM_SSR1), /* the SSR entry */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 288 | #endif |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 289 | { |
| 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 Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 305 | |
Kim Low | 18985be | 2017-12-20 15:11:08 -0800 | [diff] [blame] | 306 | /* FTC, OPC, JV : 7 */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 307 | {(BTA_DM_PM_SNIFF), /* allow sniff */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 308 | #if (BTM_SSR_INCLUDED == TRUE) |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 309 | (BTA_DM_PM_SSR2), /* the SSR entry */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 310 | #endif |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 311 | { |
| 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 Johnson | 5389838 | 2018-03-30 13:33:54 -0700 | [diff] [blame] | 319 | {{BTA_DM_PM_SNIFF_A2DP_IDX, BTA_FTC_IDLE_TO_SNIFF_DELAY_MS}, |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 320 | {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 Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 325 | |
Kim Low | 18985be | 2017-12-20 15:11:08 -0800 | [diff] [blame] | 326 | /* FTS, PBS, OPS, MSE, BTA_JV_PM_ID_1 : 8 */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 327 | {(BTA_DM_PM_SNIFF), /* allow sniff */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 328 | #if (BTM_SSR_INCLUDED == TRUE) |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 329 | (BTA_DM_PM_SSR2), /* the SSR entry */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 330 | #endif |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 331 | { |
| 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 Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 345 | |
Kim Low | 18985be | 2017-12-20 15:11:08 -0800 | [diff] [blame] | 346 | /* HL : 9 */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 347 | {(BTA_DM_PM_SNIFF), /* allow sniff */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 348 | #if (BTM_SSR_INCLUDED == TRUE) |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 349 | (BTA_DM_PM_SSR2), /* the SSR entry */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 350 | #endif |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 351 | { |
| 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 Shivpure | 36f43cc | 2013-08-29 21:28:59 +0530 | [diff] [blame] | 366 | |
Kim Low | 18985be | 2017-12-20 15:11:08 -0800 | [diff] [blame] | 367 | /* PANU : 10 */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 368 | {(BTA_DM_PM_SNIFF), /* allow sniff */ |
Nitin Shivpure | 36f43cc | 2013-08-29 21:28:59 +0530 | [diff] [blame] | 369 | #if (BTM_SSR_INCLUDED == TRUE) |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 370 | (BTA_DM_PM_SSR2), /* the SSR entry */ |
Nitin Shivpure | 36f43cc | 2013-08-29 21:28:59 +0530 | [diff] [blame] | 371 | #endif |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 372 | { |
| 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 Shivpure | 36f43cc | 2013-08-29 21:28:59 +0530 | [diff] [blame] | 386 | |
Kim Low | 18985be | 2017-12-20 15:11:08 -0800 | [diff] [blame] | 387 | /* NAP : 11 */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 388 | {(BTA_DM_PM_SNIFF), /* allow sniff */ |
Nitin Shivpure | 36f43cc | 2013-08-29 21:28:59 +0530 | [diff] [blame] | 389 | #if (BTM_SSR_INCLUDED == TRUE) |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 390 | (BTA_DM_PM_SSR2), /* the SSR entry */ |
Nitin Shivpure | 36f43cc | 2013-08-29 21:28:59 +0530 | [diff] [blame] | 391 | #endif |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 392 | { |
| 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 VijayaRaghavan | 76356ae | 2015-04-21 11:32:29 -0700 | [diff] [blame] | 403 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 404 | {{BTA_DM_PM_NO_ACTION, 0}, |
| 405 | {BTA_DM_PM_NO_ACTION, 0}} /* mode change retry */ |
| 406 | }}, |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 407 | |
Kim Low | 18985be | 2017-12-20 15:11:08 -0800 | [diff] [blame] | 408 | /* HS : 12 */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 409 | {(BTA_DM_PM_SNIFF | BTA_DM_PM_PARK), /* allow park & sniff */ |
Hemant Gupta | 41d4a26 | 2013-08-19 18:33:01 +0530 | [diff] [blame] | 410 | #if (BTM_SSR_INCLUDED == TRUE) |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 411 | (BTA_DM_PM_SSR2), /* the SSR entry */ |
Hemant Gupta | 41d4a26 | 2013-08-19 18:33:01 +0530 | [diff] [blame] | 412 | #endif |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 413 | { |
| 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 Radoslavov | 1076b7b | 2015-07-22 22:49:26 -0700 | [diff] [blame] | 428 | |
Kim Low | 18985be | 2017-12-20 15:11:08 -0800 | [diff] [blame] | 429 | /* AVK : 13 */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 430 | {(BTA_DM_PM_SNIFF), /* allow sniff */ |
Pavlin Radoslavov | 1076b7b | 2015-07-22 22:49:26 -0700 | [diff] [blame] | 431 | #if (BTM_SSR_INCLUDED == TRUE) |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 432 | (BTA_DM_PM_SSR2), /* the SSR entry */ |
Pavlin Radoslavov | 1076b7b | 2015-07-22 22:49:26 -0700 | [diff] [blame] | 433 | #endif |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 434 | { |
| 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 Radoslavov | 1076b7b | 2015-07-22 22:49:26 -0700 | [diff] [blame] | 447 | |
Kim Low | 18985be | 2017-12-20 15:11:08 -0800 | [diff] [blame] | 448 | /* GATTC : 14 */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 449 | , |
| 450 | {(BTA_DM_PM_SNIFF | BTA_DM_PM_PARK), /* allow park & sniff */ |
Andre Eisenbach | 781b5ad | 2013-05-28 15:11:43 +0900 | [diff] [blame] | 451 | #if (BTM_SSR_INCLUDED == TRUE) |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 452 | (BTA_DM_PM_SSR2), /* the SSR entry */ |
Andre Eisenbach | 781b5ad | 2013-05-28 15:11:43 +0900 | [diff] [blame] | 453 | #endif |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 454 | { |
| 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 Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 465 | {{BTA_DM_PM_RETRY, 5000}, |
| 466 | {BTA_DM_PM_NO_ACTION, 0}} /* mode change retry */ |
| 467 | }} |
Kim Low | 18985be | 2017-12-20 15:11:08 -0800 | [diff] [blame] | 468 | /* GATTS : 15 */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 469 | , |
| 470 | {(BTA_DM_PM_SNIFF | BTA_DM_PM_PARK), /* allow park & sniff */ |
Andre Eisenbach | 781b5ad | 2013-05-28 15:11:43 +0900 | [diff] [blame] | 471 | #if (BTM_SSR_INCLUDED == TRUE) |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 472 | (BTA_DM_PM_SSR2), /* the SSR entry */ |
Andre Eisenbach | 781b5ad | 2013-05-28 15:11:43 +0900 | [diff] [blame] | 473 | #endif |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 474 | { |
| 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 Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 484 | {{BTA_DM_PM_RETRY, 5000}, |
| 485 | {BTA_DM_PM_NO_ACTION, 0}} /* mode change retry */ |
| 486 | }} |
Andre Eisenbach | 781b5ad | 2013-05-28 15:11:43 +0900 | [diff] [blame] | 487 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 488 | #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 Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 500 | }; |
| 501 | |
Adam Hampson | 63399d9 | 2014-05-19 16:23:45 -0700 | [diff] [blame] | 502 | /* Please refer to the SNIFF table definitions in bta_api.h. |
| 503 | * |
| 504 | * Adding to or Modifying the Table |
Kim Low | 18985be | 2017-12-20 15:11:08 -0800 | [diff] [blame] | 505 | * Additional sniff parameter entries can be added for BTA_DM_PM_SNIFF6 - |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 506 | * 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 Hampson | 63399d9 | 2014-05-19 16:23:45 -0700 | [diff] [blame] | 513 | * ordering. |
| 514 | * |
| 515 | * Table Ordering |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 516 | * 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 Hampson | 63399d9 | 2014-05-19 16:23:45 -0700 | [diff] [blame] | 520 | * be selected. |
| 521 | */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 522 | tBTA_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 Low | 18985be | 2017-12-20 15:11:08 -0800 | [diff] [blame] | 552 | {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 Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 555 | {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 Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 557 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 558 | #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 Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 570 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 571 | {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 Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 575 | }; |
| 576 | |
| 577 | /* 0=max_lat -> no SSR */ |
| 578 | /* the smaller of the SSR max latency wins. |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 579 | * the entries in this table must be from highest latency (biggest interval) to |
| 580 | * lowest latency */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 581 | #if (BTM_SSR_INCLUDED == TRUE) |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 582 | tBTA_DM_SSR_SPEC bta_dm_ssr_spec[] = { |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 583 | /*max_lat, min_rmt_to, min_loc_to*/ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 584 | {0, 0, 0}, /* BTA_DM_PM_SSR0 - do not use SSR */ |
Hemant Gupta | 8843cc8 | 2014-04-18 12:34:55 +0530 | [diff] [blame] | 585 | /* 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 Yu | f012de4 | 2018-09-13 20:12:36 +0800 | [diff] [blame] | 589 | {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 Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 592 | }; |
| 593 | |
Myles Watson | 6ef9190 | 2017-10-03 12:35:59 -0700 | [diff] [blame] | 594 | tBTA_DM_SSR_SPEC* p_bta_dm_ssr_spec = &bta_dm_ssr_spec[0]; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 595 | #endif |
| 596 | |
Myles Watson | 6ef9190 | 2017-10-03 12:35:59 -0700 | [diff] [blame] | 597 | const tBTA_DM_PM_CFG* p_bta_dm_pm_cfg = &bta_dm_pm_cfg[0]; |
| 598 | const tBTA_DM_PM_SPEC* p_bta_dm_pm_spec = &bta_dm_pm_spec[0]; |
| 599 | const tBTM_PM_PWR_MD* p_bta_dm_pm_md = &bta_dm_pm_md[0]; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 600 | |
| 601 | /* The performance impact of EIR packet size |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 602 | * |
| 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 Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 614 | * 28 to 183 bytes, DH3 is used but only robust at short range and impacts |
| 615 | * inquiry |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 616 | * scan time with large number of devices. |
| 617 | * 184 to 240 bytes, DH5 is used but it not recommended. |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 618 | */ |
| 619 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 620 | #if (BTA_EIR_CANNED_UUID_LIST == TRUE) |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 621 | /* for example */ |
| 622 | const 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 Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 627 | }; |
Chris Manton | 1e61ce1 | 2014-10-24 09:12:41 -0700 | [diff] [blame] | 628 | #endif // BTA_EIR_CANNED_UUID_LIST |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 629 | |
| 630 | /* Extended Inquiry Response */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 631 | const 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 Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 635 | #if (BTA_EIR_CANNED_UUID_LIST == TRUE) |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 636 | 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 Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 644 | /* BTM_EIR_UUID_LKUP_TBL can be overrided */ |
| 645 | }, |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 646 | #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 Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 654 | }; |
Myles Watson | 6ef9190 | 2017-10-03 12:35:59 -0700 | [diff] [blame] | 655 | const tBTA_DM_EIR_CONF* p_bta_dm_eir_cfg = &bta_dm_eir_cfg; |