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

Commit dd1d8bd6 authored by Zach Johnson's avatar Zach Johnson
Browse files

We never set the inquiry filter

skip going to HCI, and merge the callback function into the call

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I1a1995c50dd7bab5b70f7f55ff82376f231ae2af
parent 4e54c620
Loading
Loading
Loading
Loading
+1 −23
Original line number Diff line number Diff line
@@ -1194,30 +1194,8 @@ tINQ_DB_ENT* btm_inq_db_new(const RawAddress& p_bda) {
 *
 ******************************************************************************/
static void btm_set_inq_event_filter() {
  uint8_t condition_length = 0;
  uint8_t condition_buf[DEV_CLASS_LEN * 2];
  uint8_t* p_cond = condition_buf; /* points to the condition to pass to HCI */

  btm_cb.btm_inq_vars.inqfilt_active = true;

  /* Filter the inquiry results for the specified condition type and value */
  btsnd_hcic_set_event_filter(HCI_FILTER_INQUIRY_RESULT, BTM_CLR_INQUIRY_FILTER,
                              p_cond, condition_length);
}

/*******************************************************************************
 *
 * Function         btm_event_filter_complete
 *
 * Description      This function is called when a set event filter has
 *                  completed.
 *                  Note: This routine currently only handles inquiry filters.
 *                      Connection filters are ignored for now.
 *
 * Returns          void
 *
 ******************************************************************************/
void btm_event_filter_complete(uint8_t* p) {
  uint8_t hci_status;
  tBTM_STATUS status;
  tBTM_INQUIRY_VAR_ST* p_inq = &btm_cb.btm_inq_vars;
@@ -1240,7 +1218,7 @@ void btm_event_filter_complete(uint8_t* p) {
     is used by the upper layers */
  if (p_inq->inqfilt_active) {
    /* Extract the returned status from the buffer */
    STREAM_TO_UINT8(hci_status, p);
    hci_status = HCI_SUCCESS;
    if (hci_status != HCI_SUCCESS) {
      /* If standalone operation, return the error status; if embedded in the
       * inquiry, continue the inquiry */
+0 −1
Original line number Diff line number Diff line
@@ -69,7 +69,6 @@ extern void btm_process_inq_results(uint8_t* p, uint8_t hci_evt_len,
                                    uint8_t inq_res_mode);
extern void btm_process_inq_complete(uint8_t status, uint8_t mode);
extern void btm_process_cancel_complete(uint8_t status, uint8_t mode);
extern void btm_event_filter_complete(uint8_t* p);
extern void btm_inq_stop_on_ssp(void);
extern void btm_inq_clear_ssp(void);
extern tINQ_DB_ENT* btm_inq_db_find(const RawAddress& p_bda);
+0 −1
Original line number Diff line number Diff line
@@ -1237,7 +1237,6 @@ static void btu_hcif_hdl_command_complete(uint16_t opcode, uint8_t* p,
      btm_process_cancel_complete(HCI_SUCCESS, BTM_BR_INQUIRY_MASK);
      break;
    case HCI_SET_EVENT_FILTER:
      btm_event_filter_complete(p);
      break;

    case HCI_DELETE_STORED_LINK_KEY: