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

Commit 4aabe10a authored by Chris Manton's avatar Chris Manton
Browse files

Decouple inquiry result parsing

Bug: 146086425
Test: bluetooth_legacy_test
Change-Id: I37aa3ed34fb772c1da2a8da624ea33677ee74f71
parent f07fd80e
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -32,10 +32,6 @@ extern tBTM_CB btm_cb;
static constexpr size_t kMaxInquiryResultSize = 4096;
static uint8_t inquiry_result_buf[kMaxInquiryResultSize];

static constexpr uint8_t kInquiryResultMode = 0;
static constexpr uint8_t kInquiryResultWithRssiMode = 1;
static constexpr uint8_t kExtendedInquiryResultMode = 2;

static constexpr size_t kRemoteDeviceNameLength = 248;

static constexpr uint8_t kAdvDataInfoNotPresent = 0xff;
@@ -47,8 +43,6 @@ static constexpr bool kPassiveScanning = false;

extern void btm_process_cancel_complete(uint8_t status, uint8_t mode);
extern void btm_process_inq_complete(uint8_t status, uint8_t result_type);
extern void btm_process_inq_results(uint8_t* p, uint8_t hci_evt_len,
                                    uint8_t result_mode);
extern void btm_ble_process_adv_addr(RawAddress& raw_address,
                                     uint8_t* address_type);
extern void btm_ble_process_adv_pkt_cont(
@@ -66,8 +60,6 @@ void bluetooth::shim::Btm::OnInquiryResult(std::vector<const uint8_t> result) {
  CHECK(result.size() < kMaxInquiryResultSize);

  std::copy(result.begin(), result.end(), inquiry_result_buf);
  btm_process_inq_results(inquiry_result_buf, result.size(),
                          kInquiryResultMode);
}

void bluetooth::shim::Btm::OnInquiryResultWithRssi(
@@ -75,8 +67,6 @@ void bluetooth::shim::Btm::OnInquiryResultWithRssi(
  CHECK(result.size() < kMaxInquiryResultSize);

  std::copy(result.begin(), result.end(), inquiry_result_buf);
  btm_process_inq_results(inquiry_result_buf, result.size(),
                          kInquiryResultWithRssiMode);
}

void bluetooth::shim::Btm::OnExtendedInquiryResult(
@@ -84,8 +74,6 @@ void bluetooth::shim::Btm::OnExtendedInquiryResult(
  CHECK(result.size() < kMaxInquiryResultSize);

  std::copy(result.begin(), result.end(), inquiry_result_buf);
  btm_process_inq_results(inquiry_result_buf, result.size(),
                          kExtendedInquiryResultMode);
}

void bluetooth::shim::Btm::OnInquiryComplete(uint16_t status) {