[web-bluetooth] Scanning algorithm misses devices if there is a filter with no services.

g-ortuno has just created a new issue for 
https://github.com/WebBluetoothCG/web-bluetooth:

== Scanning algorithm misses devices if there is a filter with no 
services. ==
Consider the following devices:

| Device Name | Advertised Services |
|--------|---------------------|
| D1     | A, B                |
| D2     | C                   |

And the following request:
```js
navigator.bluetooth.requestDevice({filters: [{services: 'A'}, 
{namePrefix: 'D2'}]});
```

For this request, Step 2 of [request Bluetooth 
devices](https://webbluetoothcg.github.io/web-bluetooth/#scan-for-devices)
 would result in `requiredServiceUUIDs` being `{'A'}` which is then 
used in step 7 as an argument for [scan for 
devices](https://webbluetoothcg.github.io/web-bluetooth/#scan-for-devices).
 In Step 6.2 of 
[scan for 
devices](https://webbluetoothcg.github.io/web-bluetooth/#scan-for-devices)
 a device is added if the intersection between the device's advertised
 services and the services passed to the algorithm is not empty. 
Because this intersection is empty for `D2` the device would not be 
added to the result.

We need to change the algorithm so that we don't pass 
`requiredServiceUUIDs` to [scan for 
devices](https://webbluetoothcg.github.io/web-bluetooth/#scan-for-devices)
 if there is a filter with no services.

Please view or discuss this issue at 
https://github.com/WebBluetoothCG/web-bluetooth/issues/334 using your 
GitHub account

Received on Thursday, 10 November 2016 06:06:44 UTC