tBTA_DM_PM_TYPE_QUALIFIER tBTA_DM_PM_SPEC bta_dm_pm_spec[BTA_DM_NUM_PM_SPEC] = {
/* AG : 0 */
{(BTA_DM_PM_SNIFF | BTA_DM_PM_PARK), /* allow park & sniff */
-#if (BTM_SSR_INCLUDED == TRUE)
(BTA_DM_PM_SSR2), /* the SSR entry */
-#endif
{
{{BTA_DM_PM_SNIFF_A2DP_IDX, 7000},
{BTA_DM_PM_NO_ACTION, 0}}, /* conn open sniff */
/* CT, CG : 1 */
{(BTA_DM_PM_SNIFF | BTA_DM_PM_PARK), /* allow park & sniff */
-#if (BTM_SSR_INCLUDED == TRUE)
(BTA_DM_PM_SSR2), /* the SSR entry */
-#endif
{
{{BTA_DM_PM_PARK, 5000},
{BTA_DM_PM_NO_ACTION, 0}}, /* conn open park */
/* DG, PBC : 2 */
{(BTA_DM_PM_ACTIVE), /* no power saving mode allowed */
-#if (BTM_SSR_INCLUDED == TRUE)
(BTA_DM_PM_SSR2), /* the SSR entry */
-#endif
{
{{BTA_DM_PM_SNIFF, 5000},
{BTA_DM_PM_NO_ACTION, 0}}, /* conn open active */
/* HD : 3 */
{(BTA_DM_PM_SNIFF | BTA_DM_PM_PARK), /* allow park & sniff */
-#if (BTM_SSR_INCLUDED == TRUE)
(BTA_DM_PM_SSR3), /* the SSR entry */
-#endif
{
{{BTA_DM_PM_SNIFF_HD_ACTIVE_IDX, 5000},
{BTA_DM_PM_NO_ACTION, 0}}, /* conn open sniff */
/* AV : 4 */
{(BTA_DM_PM_SNIFF), /* allow sniff */
-#if (BTM_SSR_INCLUDED == TRUE)
(BTA_DM_PM_SSR2), /* the SSR entry */
-#endif
{
{{BTA_DM_PM_SNIFF_A2DP_IDX, 7000},
{BTA_DM_PM_NO_ACTION, 0}}, /* conn open sniff */
/* HH for joysticks and gamepad : 5 */
{(BTA_DM_PM_SNIFF | BTA_DM_PM_PARK), /* allow park & sniff */
-#if (BTM_SSR_INCLUDED == TRUE)
(BTA_DM_PM_SSR1), /* the SSR entry */
-#endif
{
{{BTA_DM_PM_SNIFF6, BTA_DM_PM_HH_OPEN_DELAY},
{BTA_DM_PM_NO_ACTION, 0}}, /* conn open sniff */
/* HH : 6 */
{(BTA_DM_PM_SNIFF | BTA_DM_PM_PARK), /* allow park & sniff */
-#if (BTM_SSR_INCLUDED == TRUE)
(BTA_DM_PM_SSR1), /* the SSR entry */
-#endif
{
{{BTA_DM_PM_SNIFF_HH_OPEN_IDX, BTA_DM_PM_HH_OPEN_DELAY},
{BTA_DM_PM_NO_ACTION, 0}}, /* conn open sniff */
/* FTC, OPC, JV : 7 */
{(BTA_DM_PM_SNIFF), /* allow sniff */
-#if (BTM_SSR_INCLUDED == TRUE)
(BTA_DM_PM_SSR2), /* the SSR entry */
-#endif
{
{{BTA_DM_PM_ACTIVE, 0},
{BTA_DM_PM_NO_ACTION, 0}}, /* conn open active */
/* FTS, PBS, OPS, MSE, BTA_JV_PM_ID_1 : 8 */
{(BTA_DM_PM_SNIFF), /* allow sniff */
-#if (BTM_SSR_INCLUDED == TRUE)
(BTA_DM_PM_SSR2), /* the SSR entry */
-#endif
{
{{BTA_DM_PM_ACTIVE, 0},
{BTA_DM_PM_NO_ACTION, 0}}, /* conn open active */
/* HL : 9 */
{(BTA_DM_PM_SNIFF), /* allow sniff */
-#if (BTM_SSR_INCLUDED == TRUE)
(BTA_DM_PM_SSR2), /* the SSR entry */
-#endif
{
{{BTA_DM_PM_SNIFF_A2DP_IDX, 5000},
{BTA_DM_PM_NO_ACTION, 0}}, /* conn open sniff */
/* PANU : 10 */
{(BTA_DM_PM_SNIFF), /* allow sniff */
-#if (BTM_SSR_INCLUDED == TRUE)
(BTA_DM_PM_SSR2), /* the SSR entry */
-#endif
{
{{BTA_DM_PM_ACTIVE, 0},
{BTA_DM_PM_NO_ACTION, 0}}, /* conn open active */
/* NAP : 11 */
{(BTA_DM_PM_SNIFF), /* allow sniff */
-#if (BTM_SSR_INCLUDED == TRUE)
(BTA_DM_PM_SSR2), /* the SSR entry */
-#endif
{
{{BTA_DM_PM_ACTIVE, 0},
{BTA_DM_PM_NO_ACTION, 0}}, /* conn open active */
/* HS : 12 */
{(BTA_DM_PM_SNIFF | BTA_DM_PM_PARK), /* allow park & sniff */
-#if (BTM_SSR_INCLUDED == TRUE)
(BTA_DM_PM_SSR2), /* the SSR entry */
-#endif
{
{{BTA_DM_PM_SNIFF, 7000},
{BTA_DM_PM_NO_ACTION, 0}}, /* conn open sniff */
/* AVK : 13 */
{(BTA_DM_PM_SNIFF), /* allow sniff */
-#if (BTM_SSR_INCLUDED == TRUE)
(BTA_DM_PM_SSR2), /* the SSR entry */
-#endif
{
{{BTA_DM_PM_SNIFF, 3000},
{BTA_DM_PM_NO_ACTION, 0}}, /* conn open sniff */
/* GATTC : 14 */
,
{(BTA_DM_PM_SNIFF | BTA_DM_PM_PARK), /* allow park & sniff */
-#if (BTM_SSR_INCLUDED == TRUE)
(BTA_DM_PM_SSR2), /* the SSR entry */
-#endif
{
{{BTA_DM_PM_SNIFF_A2DP_IDX, 10000},
{BTA_DM_PM_NO_ACTION, 0}}, /* conn open active */
/* GATTS : 15 */
,
{(BTA_DM_PM_SNIFF | BTA_DM_PM_PARK), /* allow park & sniff */
-#if (BTM_SSR_INCLUDED == TRUE)
(BTA_DM_PM_SSR2), /* the SSR entry */
-#endif
{
{{BTA_DM_PM_NO_PREF, 0},
{BTA_DM_PM_NO_ACTION, 0}}, /* conn open active */
/* the smaller of the SSR max latency wins.
* the entries in this table must be from highest latency (biggest interval) to
* lowest latency */
-#if (BTM_SSR_INCLUDED == TRUE)
tBTA_DM_SSR_SPEC bta_dm_ssr_spec[] = {
/*max_lat, min_rmt_to, min_loc_to*/
{0, 0, 0}, /* BTA_DM_PM_SSR0 - do not use SSR */
};
tBTA_DM_SSR_SPEC* p_bta_dm_ssr_spec = &bta_dm_ssr_spec[0];
-#endif
const tBTA_DM_PM_CFG* p_bta_dm_pm_cfg = &bta_dm_pm_cfg[0];
const tBTA_DM_PM_SPEC* p_bta_dm_pm_spec = &bta_dm_pm_spec[0];
static bool bta_dm_pm_park(const RawAddress& peer_addr);
static void bta_dm_pm_sniff(tBTA_DM_PEER_DEVICE* p_peer_dev, uint8_t index);
static bool bta_dm_pm_is_sco_active();
-#if (BTM_SSR_INCLUDED == TRUE)
static int bta_dm_get_sco_index();
-#endif
static void bta_dm_pm_hid_check(bool bScoActive);
static void bta_dm_pm_stop_timer_by_index(tBTA_PM_TIMER* p_timer,
uint8_t timer_idx);
-#if (BTM_SSR_INCLUDED == TRUE)
#if (BTA_HH_INCLUDED == TRUE)
#include "../hh/bta_hh_int.h"
/* BTA_DM_PM_SSR1 will be dedicated for HH SSR setting entry, no other profile
#define BTA_DM_PM_SSR_HH BTA_DM_PM_SSR1
#endif
static void bta_dm_pm_ssr(const RawAddress& peer_addr, int ssr);
-#endif
tBTA_DM_CONNECTED_SRVCS bta_dm_conn_srvcs;
static std::recursive_mutex pm_timer_schedule_mutex;
bta_dm_pm_stop_timer_by_srvc_id(peer_addr, id);
/*p_dev = bta_dm_find_peer_device(peer_addr);*/
-#if (BTM_SSR_INCLUDED == TRUE)
/* set SSR parameters on SYS CONN OPEN */
int index = BTA_DM_PM_SSR0;
if ((BTA_SYS_CONN_OPEN == status) && p_dev &&
index = p_bta_dm_pm_spec[p_bta_dm_pm_cfg[i].spec_idx].ssr;
}
}
-#endif
/* if no action for the event */
if (p_bta_dm_pm_spec[p_bta_dm_pm_cfg[i].spec_idx]
.actn_tbl[status][0]
.power_mode == BTA_DM_PM_NO_ACTION) {
-#if (BTM_SSR_INCLUDED == TRUE)
if (BTA_DM_PM_SSR0 == index) /* and do not need to set SSR, return. */
-#endif
return;
}
p_dev->pm_mode_failed = 0;
}
-#if (BTM_SSR_INCLUDED == TRUE)
if (p_bta_dm_ssr_spec[index].max_lat
#if (BTA_HH_INCLUDED == TRUE)
|| index == BTA_DM_PM_SSR_HH
}
}
}
-#endif
bta_dm_pm_set_mode(peer_addr, BTA_DM_PM_NO_ACTION, pm_req);
tBTM_STATUS status;
BTM_ReadPowerMode(p_peer_dev->peer_bdaddr, &mode);
-#if (BTM_SSR_INCLUDED == TRUE)
uint8_t* p_rem_feat = BTM_ReadRemoteFeatures(p_peer_dev->peer_bdaddr);
APPL_TRACE_DEBUG("bta_dm_pm_sniff cur:%d, idx:%d, info:x%x", mode, index,
p_peer_dev->info);
return;
}
}
-#else
- APPL_TRACE_DEBUG("bta_dm_pm_sniff cur:%d, idx:%d", mode, index);
- if (mode == BTM_PM_MD_SNIFF) {
- return;
- }
-#endif
/* if the current mode is not sniff, issue the sniff command.
* If sniff, but SSR is not used in this link, still issue the command */
memcpy(&pwr_md, &p_bta_dm_pm_md[index], sizeof(tBTM_PM_PWR_MD));
* Returns void
*
******************************************************************************/
-#if (BTM_SSR_INCLUDED == TRUE)
static void bta_dm_pm_ssr(const RawAddress& peer_addr, int ssr) {
int current_ssr_index;
int ssr_index = ssr;
p_spec->min_loc_to);
}
}
-#endif
/*******************************************************************************
*
* Function bta_dm_pm_active
bta_dm_pm_set_mode(bd_addr, BTA_DM_PM_NO_ACTION, BTA_DM_PM_RESTART);
}
} else {
-#if (BTM_SSR_INCLUDED == TRUE)
if (p_dev->prev_low) {
/* need to send the SSR paramaters to controller again */
bta_dm_pm_ssr(p_dev->peer_bdaddr, BTA_DM_PM_SSR0);
}
p_dev->prev_low = BTM_PM_STS_ACTIVE;
-#endif
/* link to active mode, need to restart the timer for next low power
* mode if needed */
bta_dm_pm_stop_timer(bd_addr);
}
break;
-#if (BTM_SSR_INCLUDED == TRUE)
case BTM_PM_STS_PARK:
case BTM_PM_STS_HOLD:
/* save the previous low power mode - for SSR.
else
p_dev->info &= ~BTA_DM_DI_USE_SSR;
break;
-#endif
case BTM_PM_STS_SNIFF:
if (hci_status == 0) {
/* Stop PM timer now if already active for
return bScoActive;
}
-#if (BTM_SSR_INCLUDED == TRUE)
/*******************************************************************************
*
* Function bta_dm_get_sco_index
}
return -1;
}
-#endif
/*******************************************************************************
*