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

Commit 128163b1 authored by Zach Johnson's avatar Zach Johnson
Browse files

who doesn't like chicken parm?

They're always the same, no need to pass them around.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ied6c7493dfd25dc8dbec7ebe5ad7293310d9bb70
parent ffb11725
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -799,8 +799,7 @@ void bta_dm_search_start(tBTA_DM_MSG* p_data) {
  bta_dm_search_cb.p_search_cback = p_data->search.p_cback;
  bta_dm_search_cb.services = p_data->search.services;

  result.status = BTM_StartInquiry((tBTM_INQ_PARMS*)&p_data->search.inq_params,
                                   bta_dm_inq_results_cb, bta_dm_inq_cmpl_cb);
  result.status = BTM_StartInquiry(bta_dm_inq_results_cb, bta_dm_inq_cmpl_cb);

  APPL_TRACE_EVENT("%s status=%d", __func__, result.status);
  if (result.status != BTM_CMD_STARTED) {
+1 −2
Original line number Diff line number Diff line
@@ -84,12 +84,11 @@ void BTA_DmSetVisibility(tBTA_DM_DISC disc_mode, tBTA_DM_CONN conn_mode) {
 * Returns          void
 *
 ******************************************************************************/
void BTA_DmSearch(tBTM_INQ_PARMS* p_dm_inq, tBTA_DM_SEARCH_CBACK* p_cback) {
void BTA_DmSearch(tBTA_DM_SEARCH_CBACK* p_cback) {
  tBTA_DM_API_SEARCH* p_msg =
      (tBTA_DM_API_SEARCH*)osi_calloc(sizeof(tBTA_DM_API_SEARCH));

  p_msg->hdr.event = BTA_DM_API_SEARCH_EVT;
  memcpy(&p_msg->inq_params, p_dm_inq, sizeof(tBTM_INQ_PARMS));
  p_msg->p_cback = p_cback;

  bta_sys_sendmsg(p_msg);
+0 −1
Original line number Diff line number Diff line
@@ -61,7 +61,6 @@ enum {
/* data type for BTA_DM_API_SEARCH_EVT */
typedef struct {
  BT_HDR hdr;
  tBTM_INQ_PARMS inq_params;
  tBTA_SERVICE_MASK services;
  tBTA_DM_SEARCH_CBACK* p_cback;
} tBTA_DM_API_SEARCH;
+1 −2
Original line number Diff line number Diff line
@@ -878,8 +878,7 @@ extern void BTA_DmSetVisibility(tBTA_DM_DISC disc_mode, tBTA_DM_CONN conn_mode);
 * Returns          void
 *
 ******************************************************************************/
extern void BTA_DmSearch(tBTM_INQ_PARMS* p_dm_inq,
                         tBTA_DM_SEARCH_CBACK* p_cback);
extern void BTA_DmSearch(tBTA_DM_SEARCH_CBACK* p_cback);

/*******************************************************************************
 *
+1 −17
Original line number Diff line number Diff line
@@ -99,8 +99,6 @@ const Uuid UUID_HEARING_AID = Uuid::FromString("FDF0");
#define COD_AV_PORTABLE_AUDIO 0x041C
#define COD_AV_HIFI_AUDIO 0x0428

#define BTIF_DM_DEFAULT_INQ_MAX_RESULTS 0
#define BTIF_DM_DEFAULT_INQ_MAX_DURATION 10
#define BTIF_DM_MAX_SDP_ATTEMPTS_AFTER_PAIRING 2

#define NUM_TIMEOUT_RETRIES 5
@@ -1832,8 +1830,6 @@ static void bte_scan_filt_param_cfg_evt(uint8_t ref_value, uint8_t avbl_space,
 *
 ******************************************************************************/
void btif_dm_start_discovery(void) {
  tBTM_INQ_PARMS inq_params;

  BTIF_TRACE_EVENT("%s", __func__);

  /* Cleanup anything remaining on index 0 */
@@ -1852,22 +1848,10 @@ void btif_dm_start_discovery(void) {
                             std::move(adv_filt_param),
                             base::Bind(&bte_scan_filt_param_cfg_evt, 0));

  /* TODO: Do we need to handle multiple inquiries at the same time? */

  /* Set inquiry params and call API */
  inq_params.mode = BTM_GENERAL_INQUIRY | BTM_BLE_GENERAL_INQUIRY;
  inq_params.duration = BTIF_DM_DEFAULT_INQ_MAX_DURATION;

  inq_params.max_resps = BTIF_DM_DEFAULT_INQ_MAX_RESULTS;
  inq_params.report_dup = true;

  inq_params.filter_cond_type = BTM_CLR_INQUIRY_FILTER;
  /* TODO: Filter device by BDA needs to be implemented here */

  /* Will be enabled to true once inquiry busy level has been received */
  btif_dm_inquiry_in_progress = false;
  /* find nearby devices */
  BTA_DmSearch(&inq_params, btif_dm_search_devices_evt);
  BTA_DmSearch(btif_dm_search_devices_evt);
}

/*******************************************************************************
Loading