Loading system/bta/dm/bta_dm_cfg.cc +271 −140 File changed.Preview size limit exceeded, changes collapsed. Show changes system/bta/dm/bta_dm_int.h +1 −1 Original line number Diff line number Diff line Loading @@ -452,7 +452,7 @@ typedef struct { typedef struct { uint8_t allow_mask; /* mask of sniff/hold/park modes to allow */ uint8_t ssr; /* set SSR on conn open/unpark */ tBTA_DM_PM_ACTN actn_tbl[BTA_DM_PM_NUM_EVTS]; tBTA_DM_PM_ACTN actn_tbl[BTA_DM_PM_NUM_EVTS][2]; } tBTA_DM_PM_SPEC; Loading system/bta/dm/bta_dm_pm.cc +14 −3 Original line number Diff line number Diff line Loading @@ -393,7 +393,7 @@ static void bta_dm_pm_cback(tBTA_SYS_CONN_STATUS status, uint8_t id, /* if no action for the event */ if (get_bta_dm_pm_spec()[p_bta_dm_pm_cfg[i].spec_idx] .actn_tbl[status] .actn_tbl[status][0] .power_mode == BTA_DM_PM_NO_ACTION) { if (BTA_DM_PM_SSR0 == index) /* and do not need to set SSR, return. */ return; Loading @@ -412,7 +412,7 @@ static void bta_dm_pm_cback(tBTA_SYS_CONN_STATUS status, uint8_t id, /* if subsystem has no more preference on the power mode remove the cb */ if (get_bta_dm_pm_spec()[p_bta_dm_pm_cfg[i].spec_idx] .actn_tbl[status] .actn_tbl[status][0] .power_mode == BTA_DM_PM_NO_PREF) { if (j != bta_dm_conn_srvcs.count) { bta_dm_conn_srvcs.count--; Loading Loading @@ -515,6 +515,7 @@ static void bta_dm_pm_set_mode(const RawAddress& peer_addr, const tBTA_DM_PM_CFG* p_pm_cfg; const tBTA_DM_PM_SPEC* p_pm_spec; const tBTA_DM_PM_ACTN* p_act0; const tBTA_DM_PM_ACTN* p_act1; tBTA_DM_SRVCS* p_srvcs = NULL; bool timer_started = false; uint8_t timer_idx, available_timer = BTA_DM_PM_MODE_TIMER_MAX; Loading Loading @@ -548,7 +549,8 @@ static void bta_dm_pm_set_mode(const RawAddress& peer_addr, p_pm_cfg = &p_bta_dm_pm_cfg[j]; p_pm_spec = &get_bta_dm_pm_spec()[p_pm_cfg->spec_idx]; p_act0 = &p_pm_spec->actn_tbl[p_srvcs->state]; p_act0 = &p_pm_spec->actn_tbl[p_srvcs->state][0]; p_act1 = &p_pm_spec->actn_tbl[p_srvcs->state][1]; allowed_modes |= p_pm_spec->allow_mask; LOG_DEBUG( Loading @@ -573,6 +575,15 @@ static void bta_dm_pm_set_mode(const RawAddress& peer_addr, } } } /* if first preference has already failed, try second preference */ else if (!(failed_pm & p_act1->power_mode)) { pref_modes |= p_act1->power_mode; if (p_act1->power_mode > pm_action) { pm_action = p_act1->power_mode; timeout_ms = p_act1->timeout; } } } } Loading Loading
system/bta/dm/bta_dm_cfg.cc +271 −140 File changed.Preview size limit exceeded, changes collapsed. Show changes
system/bta/dm/bta_dm_int.h +1 −1 Original line number Diff line number Diff line Loading @@ -452,7 +452,7 @@ typedef struct { typedef struct { uint8_t allow_mask; /* mask of sniff/hold/park modes to allow */ uint8_t ssr; /* set SSR on conn open/unpark */ tBTA_DM_PM_ACTN actn_tbl[BTA_DM_PM_NUM_EVTS]; tBTA_DM_PM_ACTN actn_tbl[BTA_DM_PM_NUM_EVTS][2]; } tBTA_DM_PM_SPEC; Loading
system/bta/dm/bta_dm_pm.cc +14 −3 Original line number Diff line number Diff line Loading @@ -393,7 +393,7 @@ static void bta_dm_pm_cback(tBTA_SYS_CONN_STATUS status, uint8_t id, /* if no action for the event */ if (get_bta_dm_pm_spec()[p_bta_dm_pm_cfg[i].spec_idx] .actn_tbl[status] .actn_tbl[status][0] .power_mode == BTA_DM_PM_NO_ACTION) { if (BTA_DM_PM_SSR0 == index) /* and do not need to set SSR, return. */ return; Loading @@ -412,7 +412,7 @@ static void bta_dm_pm_cback(tBTA_SYS_CONN_STATUS status, uint8_t id, /* if subsystem has no more preference on the power mode remove the cb */ if (get_bta_dm_pm_spec()[p_bta_dm_pm_cfg[i].spec_idx] .actn_tbl[status] .actn_tbl[status][0] .power_mode == BTA_DM_PM_NO_PREF) { if (j != bta_dm_conn_srvcs.count) { bta_dm_conn_srvcs.count--; Loading Loading @@ -515,6 +515,7 @@ static void bta_dm_pm_set_mode(const RawAddress& peer_addr, const tBTA_DM_PM_CFG* p_pm_cfg; const tBTA_DM_PM_SPEC* p_pm_spec; const tBTA_DM_PM_ACTN* p_act0; const tBTA_DM_PM_ACTN* p_act1; tBTA_DM_SRVCS* p_srvcs = NULL; bool timer_started = false; uint8_t timer_idx, available_timer = BTA_DM_PM_MODE_TIMER_MAX; Loading Loading @@ -548,7 +549,8 @@ static void bta_dm_pm_set_mode(const RawAddress& peer_addr, p_pm_cfg = &p_bta_dm_pm_cfg[j]; p_pm_spec = &get_bta_dm_pm_spec()[p_pm_cfg->spec_idx]; p_act0 = &p_pm_spec->actn_tbl[p_srvcs->state]; p_act0 = &p_pm_spec->actn_tbl[p_srvcs->state][0]; p_act1 = &p_pm_spec->actn_tbl[p_srvcs->state][1]; allowed_modes |= p_pm_spec->allow_mask; LOG_DEBUG( Loading @@ -573,6 +575,15 @@ static void bta_dm_pm_set_mode(const RawAddress& peer_addr, } } } /* if first preference has already failed, try second preference */ else if (!(failed_pm & p_act1->power_mode)) { pref_modes |= p_act1->power_mode; if (p_act1->power_mode > pm_action) { pm_action = p_act1->power_mode; timeout_ms = p_act1->timeout; } } } } Loading