Skip to content

Commit

Permalink
Update requestLEScan-for-granted-devices-explainer.md
Browse files Browse the repository at this point in the history
Co-authored-by: Reilly Grant <reillyeon@users.noreply.github.com>
  • Loading branch information
chengweih001 and reillyeon committed Oct 2, 2023
1 parent 0dd2e41 commit 89ca300
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion requestLEScan-for-granted-devices-explainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

The Bluetooth [requestLEScan](https://webbluetoothcg.github.io/web-bluetooth/scanning.html#dom-bluetooth-requestlescan) API to allows web apps to listen for advertisements from any Bluetooth device. We propose an extension to this API that limits scanning to only devices that the web app has been granted permission to connect to. This is motivated by the following:

* Using watchAdvertisements API to listen to advertisements from multiple granted devices requires writing redundant code, the API is using [AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) for stopping the scanning activity, which is not recommended, and the API is still in development trials, not yet available to all users.
* Using the watchAdvertisements API to listen to advertisements from multiple granted devices, which we believe to be the most common scenario, requires complex code to start and manage multiple scanning sessions.
* The new requestLEScan API for granted devices would allow developers to write clear and concise code for listening to advertisements from granted devices, and it would avoid the confusion of what API to use for listening advertisements from bluetooth devices when requestLEScan for surrounding devices is officially launched in the future.

## Interface
Expand Down

0 comments on commit 89ca300

Please sign in to comment.