[web-bluetooth] watchAdvertisements() should return a "sentinel" object (#591)

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

== watchAdvertisements() should return a "sentinel" object ==
The `requestLeScan()` object returns a "sentinel" object that allows the developer to observe the status of the scan operation and stop it. This is important because some platform Bluetooth stacks enforce a limitation on how long a scanning session can be active and so it is important for a site to know whether to expect to receive more `advertisementreceived` events or not so it can keep its UI up to date.

Right now `watchAdvertisements()` just takes an `AbortSignal` which can be used to stop the scan but this was based on a pattern copied from the Screen Wake Lock API which we eventually decided against, instead adding the `WakeLockSentinel` interface. We should make this change to the Web Bluetooth API as well.

Right now `BluetoothLEScan` doesn't provide an event when the scanning session is stopped (only an attribute) but it could be updated to fire a `stop` event.

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


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

Received on Tuesday, 19 July 2022 21:09:44 UTC