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

Commit 0a4aa766 authored by Jakub Pawłowski's avatar Jakub Pawłowski Committed by Automerger Merge Worker
Browse files

Merge "Remove dead code - bta_dm_ble_observe" into main am: d965f000

parents 12c96324 d965f000
Loading
Loading
Loading
Loading
+0 −25
Original line number Diff line number Diff line
@@ -1726,9 +1726,6 @@ static void bta_dm_observe_results_cb(tBTM_INQ_RESULTS* p_inq,
    result.inq_res.remt_name_not_required = false;
  }

  if (bta_dm_search_cb.p_scan_cback)
    bta_dm_search_cb.p_scan_cback(BTA_DM_INQ_RES_EVT, &result);

  if (p_inq_info) {
    /* application indicates if it knows the remote name, inside the callback
     copy that to the inquiry data base*/
@@ -1805,9 +1802,6 @@ static void bta_dm_observe_cmpl_cb(void* p_result) {
  log::verbose("bta_dm_observe_cmpl_cb");

  data.inq_cmpl.num_resps = ((tBTM_INQUIRY_CMPL*)p_result)->num_resp;
  if (bta_dm_search_cb.p_scan_cback) {
    bta_dm_search_cb.p_scan_cback(BTA_DM_INQ_CMPL_EVT, &data);
  }
  if (bta_dm_search_cb.p_csis_scan_cback) {
    bta_dm_search_cb.p_csis_scan_cback(BTA_DM_INQ_CMPL_EVT, &data);
  }
@@ -1827,33 +1821,14 @@ static void bta_dm_start_scan(uint8_t duration_sec,
            },
    };
    log::warn("BTM_BleObserve  failed. status {}", status);
    if (bta_dm_search_cb.p_scan_cback) {
      bta_dm_search_cb.p_scan_cback(BTA_DM_INQ_CMPL_EVT, &data);
    }
    if (bta_dm_search_cb.p_csis_scan_cback) {
      bta_dm_search_cb.p_csis_scan_cback(BTA_DM_INQ_CMPL_EVT, &data);
    }
  }
}

void bta_dm_ble_observe(bool start, uint8_t duration,
                        tBTA_DM_SEARCH_CBACK* p_cback) {
  if (!start) {
    bta_dm_search_cb.p_scan_cback = NULL;
    get_btm_client_interface().ble.BTM_BleObserve(false, 0, NULL, NULL, false);
    return;
  }

  /*Save the  callback to be called when a scan results are available */
  bta_dm_search_cb.p_scan_cback = p_cback;
  bta_dm_start_scan(duration);
}

void bta_dm_ble_scan(bool start, uint8_t duration_sec,
                     bool low_latency_scan = false) {
  /* Start or stop only if there is no active main scanner */
  if (bta_dm_search_cb.p_scan_cback != NULL) return;

  if (!start) {
    get_btm_client_interface().ble.BTM_BleObserve(false, 0, NULL, NULL, false);
    return;
+0 −2
Original line number Diff line number Diff line
@@ -48,8 +48,6 @@ void bta_dm_disc_acl_down(const RawAddress& bd_addr, tBT_TRANSPORT transport);
const char* bta_dm_get_remname(void);

// LE observe and scan interface
void bta_dm_ble_observe(bool start, uint8_t duration,
                        tBTA_DM_SEARCH_CBACK* p_cback);
void bta_dm_ble_scan(bool start, uint8_t duration_sec, bool low_latency_scan);
void bta_dm_ble_csis_observe(bool observe, tBTA_DM_SEARCH_CBACK* p_cback);

+0 −1
Original line number Diff line number Diff line
@@ -173,7 +173,6 @@ typedef struct {
  bluetooth::Uuid uuid;
  uint8_t peer_scn;
  tBT_TRANSPORT transport;
  tBTA_DM_SEARCH_CBACK* p_scan_cback;
  tBTA_DM_SEARCH_CBACK* p_csis_scan_cback;
  tGATT_IF client_if;
  uint8_t uuid_to_search;
+0 −6
Original line number Diff line number Diff line
@@ -52,7 +52,6 @@ struct bta_dm_ble_config_local_privacy bta_dm_ble_config_local_privacy;
struct bta_dm_ble_confirm_reply bta_dm_ble_confirm_reply;
struct bta_dm_ble_csis_observe bta_dm_ble_csis_observe;
struct bta_dm_ble_get_energy_info bta_dm_ble_get_energy_info;
struct bta_dm_ble_observe bta_dm_ble_observe;
struct bta_dm_ble_passkey_reply bta_dm_ble_passkey_reply;
struct bta_dm_ble_scan bta_dm_ble_scan;
struct bta_dm_ble_set_conn_params bta_dm_ble_set_conn_params;
@@ -153,11 +152,6 @@ void bta_dm_ble_get_energy_info(
  inc_func_call_count(__func__);
  test::mock::bta_dm_act::bta_dm_ble_get_energy_info(p_energy_info_cback);
}
void bta_dm_ble_observe(bool start, uint8_t duration,
                        tBTA_DM_SEARCH_CBACK* p_cback) {
  inc_func_call_count(__func__);
  test::mock::bta_dm_act::bta_dm_ble_observe(start, duration, p_cback);
}
void bta_dm_ble_passkey_reply(const RawAddress& bd_addr, bool accept,
                              uint32_t passkey) {
  inc_func_call_count(__func__);
+0 −14
Original line number Diff line number Diff line
@@ -226,20 +226,6 @@ struct bta_dm_ble_get_energy_info {
};
extern struct bta_dm_ble_get_energy_info bta_dm_ble_get_energy_info;

// Name: bta_dm_ble_observe
// Params: bool start, uint8_t duration, tBTA_DM_SEARCH_CBACK* p_cback
// Return: void
struct bta_dm_ble_observe {
  std::function<void(bool start, uint8_t duration,
                     tBTA_DM_SEARCH_CBACK* p_cback)>
      body{[](bool /* start */, uint8_t /* duration */,
              tBTA_DM_SEARCH_CBACK* /* p_cback */) {}};
  void operator()(bool start, uint8_t duration, tBTA_DM_SEARCH_CBACK* p_cback) {
    body(start, duration, p_cback);
  };
};
extern struct bta_dm_ble_observe bta_dm_ble_observe;

// Name: bta_dm_clear_event_filter
// Params: None
// Return: void