Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5b811ed3 authored by Chris Manton's avatar Chris Manton Committed by Automerger Merge Worker
Browse files

Rework API btm_ble_select_adv_interval am: 1e88d762 am: 7f4aa54c am: e4a93ddb

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1431922

Change-Id: Idd9b560ded6903cf9a705f63d18ddedb1d3daf66
parents 6f9cf155 e4a93ddb
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -830,9 +830,10 @@ uint16_t BTM_BleReadConnectability() {
 * Returns          void
 *
 ******************************************************************************/
void btm_ble_select_adv_interval(tBTM_BLE_INQ_CB* p_cb, uint8_t evt_type,
static void btm_ble_select_adv_interval(uint8_t evt_type,
                                        uint16_t* p_adv_int_min,
                                        uint16_t* p_adv_int_max) {
  tBTM_BLE_INQ_CB* p_cb = &btm_cb.ble_ctr_cb.inq_var;
  if (p_cb->adv_interval_min && p_cb->adv_interval_max) {
    *p_adv_int_min = p_cb->adv_interval_min;
    *p_adv_int_max = p_cb->adv_interval_max;
@@ -971,7 +972,7 @@ tBTM_STATUS btm_ble_set_discoverability(uint16_t combined_mode) {
      mode == BTM_BLE_NON_DISCOVERABLE)
    new_mode = BTM_BLE_ADV_DISABLE;

  btm_ble_select_adv_interval(p_cb, evt_type, &adv_int_min, &adv_int_max);
  btm_ble_select_adv_interval(evt_type, &adv_int_min, &adv_int_max);

  alarm_cancel(p_cb->fast_adv_timer);

@@ -1061,7 +1062,7 @@ tBTM_STATUS btm_ble_set_connectability(uint16_t combined_mode) {
      p_cb->discoverable_mode == BTM_BLE_NON_DISCOVERABLE)
    new_mode = BTM_BLE_ADV_DISABLE;

  btm_ble_select_adv_interval(p_cb, evt_type, &adv_int_min, &adv_int_max);
  btm_ble_select_adv_interval(evt_type, &adv_int_min, &adv_int_max);

  alarm_cancel(p_cb->fast_adv_timer);
  /* update adv params if needed */