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

Commit c2d73d69 authored by Henri Chataing's avatar Henri Chataing Committed by Automerger Merge Worker
Browse files

Merge "RootCanal: return the correct mode in Read Scan Enable" am: e8e7f2e0

parents 0f12a0e8 e8e7f2e0
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -1807,8 +1807,19 @@ void DualModeController::ReadScanEnable(CommandView command) {
  auto command_view = gd_hci::ReadScanEnableView::Create(
      gd_hci::DiscoveryCommandView::Create(command));
  ASSERT(command_view.IsValid());

  bool inquiry_scan = link_layer_controller_.GetInquiryScanEnable();
  bool page_scan = link_layer_controller_.GetPageScanEnable();

  bluetooth::hci::ScanEnable scan_enable =
      inquiry_scan && page_scan
          ? bluetooth::hci::ScanEnable::INQUIRY_AND_PAGE_SCAN
      : inquiry_scan ? bluetooth::hci::ScanEnable::INQUIRY_SCAN_ONLY
      : page_scan    ? bluetooth::hci::ScanEnable::PAGE_SCAN_ONLY
                     : bluetooth::hci::ScanEnable::NO_SCANS;

  send_event_(bluetooth::hci::ReadScanEnableCompleteBuilder::Create(
      kNumCommandPackets, ErrorCode::SUCCESS, gd_hci::ScanEnable::NO_SCANS));
      kNumCommandPackets, ErrorCode::SUCCESS, scan_enable));
}

void DualModeController::WriteScanEnable(CommandView command) {
+4 −0
Original line number Diff line number Diff line
@@ -352,8 +352,12 @@ class LinkLayerController {
  void SetInquiryMaxResponses(uint8_t max);
  void Inquiry();

  bool GetInquiryScanEnable() { return inquiry_scan_enable_; }
  void SetInquiryScanEnable(bool enable);

  bool GetPageScanEnable() { return page_scan_enable_; }
  void SetPageScanEnable(bool enable);

  uint16_t GetPageTimeout();
  void SetPageTimeout(uint16_t page_timeout);