Re: [web-bluetooth] Spec vs Chromium implementation. (#620)

> I understand that you are saying that you can't specify options to query and get back permitted devices. It sounds like instead users would check the permitted existing devices using `getDevices()`?

Correct.

> 1. Is the intent that you might be able to filter devices using `getDevices()`?

Filtering devices isn't supported by `getDevices()`. It's unclear how useful this would be to developers. 

> 2. Is the plan ever to match the spec w.r.t. returning device, or is the intent to get the spec to match Chrome?

Supporting querying Web Bluetooth device permissions with `navigator.permissions.query()` would be nice, but when I looked into supporting it for WebUSB there were some technical limitations in the Chromium implementation which meant it was difficult to implement and so I decided it wasn't worth the effort given that the functionality is duplicated by the `getDevices()` method. 

> 1. are the spec event handlers all implemented, such as [advertisementreceived](https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothdeviceeventhandlers-onadvertisementreceived) (these aren't documented on MDN). Do we know the version they appeared in?

The `advertisementreceived` event handler is used by two related features `BluetoothDevice.watchAdvertisements()` and `navigator.bluetooth.requestLeScan()`. Both of these are currently prototyped in Chromium but are not yet enabled by default.

> 2. What form does `optionalManufacturerData` actually take? It looks like an array of numbers, but what do those numbers map to? How are they used? It reads as though this is not used for filtering, but is data you want to make available to the origin after filtering.

It operates similarly to `optionalServices`. It doesn't filter the devices displayed to the user in the permission prompt but controls which manufacturer data fields provided in `advertisementreceived` events. Bluetooth manufacturer IDs are integers. The "optional" versions of these parameters are useful because it allows the developer to declare the data they are interested in receiving from the devices without overly constraining the filter controlling which devices are presented to the user in the permission prompt. 

> 3. The spec seems to indicate that `options` is optional, but not clear what gets fetched in this case. Thoughts?

You're right that `options` is not truly optional because one of `filters` or `acceptAllDevices` is required.

-- 
GitHub Notification of comment by reillyeon
Please view or discuss this issue at https://github.com/WebBluetoothCG/web-bluetooth/issues/620#issuecomment-1989464724 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 11 March 2024 21:20:06 UTC