Commit 447f5359 authored by ortuno's avatar ortuno Committed by Commit bot

bluetooth: Perform an LE scan only

There isn't much support from platforms and devices for GATT over BR/EDR so
to avoid confusing users and wasting power, perform a LE scan only.

BUG=643625

Review-Url: https://codereview.chromium.org/2339033003
Cr-Commit-Position: refs/heads/master@{#418792}
parent e8100379
...@@ -148,8 +148,12 @@ std::unique_ptr<device::BluetoothDiscoveryFilter> ComputeScanFilter( ...@@ -148,8 +148,12 @@ std::unique_ptr<device::BluetoothDiscoveryFilter> ComputeScanFilter(
services.insert(service.value()); services.insert(service.value());
} }
} }
// There isn't much support for GATT over BR/EDR from neither platforms nor
// devices so performing a Dual scan will find devices that the API is not
// able to interact with. To avoid wasting power and confusing users with
// devices they are not able to interact with, we only perform an LE Scan.
auto discovery_filter = base::MakeUnique<device::BluetoothDiscoveryFilter>( auto discovery_filter = base::MakeUnique<device::BluetoothDiscoveryFilter>(
device::BLUETOOTH_TRANSPORT_DUAL); device::BLUETOOTH_TRANSPORT_LE);
for (const BluetoothUUID& service : services) { for (const BluetoothUUID& service : services) {
discovery_filter->AddUUID(service); discovery_filter->AddUUID(service);
} }
......
...@@ -5,6 +5,14 @@ Web Bluetooth ...@@ -5,6 +5,14 @@ Web Bluetooth
[WB]: https://webbluetoothcg.github.io/web-bluetooth/ [WB]: https://webbluetoothcg.github.io/web-bluetooth/
Scanning
--------------------------------------------------------------------------------
There isn't much support for GATT over BR/EDR from neither platforms nor
devices so performing a Dual scan will find devices that the API is not
able to interact with. To avoid wasting power and confusing users with
devices they are not able to interact with, navigator.bluetooth.requestDevice
performs an LE-only Scan.
Testing Testing
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment