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

Commit 2bf0e0c8 authored by Myles Watson's avatar Myles Watson
Browse files

Double check if extended scanning is supported

Some controllers report support for Set Extended Scanning Enable
although they don't support extended advertising or scanning.

Bug: 229234090
Tag: #compatibility
Test: start Bluetooth on an affected controller
Change-Id: Ia2de7dbc998fe4b770a65ba5cc2329a12c991222
parent 64f59bab
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -221,7 +221,9 @@ struct LeScanningManager::impl : public bluetooth::hci::LeAddressManagerCallback
    le_address_manager_ = acl_manager->GetLeAddressManager();
    le_scanning_interface_ = hci_layer_->GetLeScanningInterface(
        module_handler_->BindOn(this, &LeScanningManager::impl::handle_scan_results));
    if (controller_->IsSupported(OpCode::LE_SET_EXTENDED_SCAN_PARAMETERS)) {
    /* Check to see if the opcode is supported and C19 (support for extended advertising). */
    if (controller_->IsSupported(OpCode::LE_SET_EXTENDED_SCAN_PARAMETERS) &&
        controller->SupportsBleExtendedAdvertising()) {
      api_type_ = ScanApiType::EXTENDED;
      interval_ms_ = kDefaultLeExtendedScanInterval;
      window_ms_ = kDefaultLeExtendedScanWindow;