Web Bluetooth BluetoothDevice.watchAdvertisements()

The BluetoothDevice.watchAdvertisements() method will enable web apps to receive events when the system receives an advertisement packet from a watched device.

Motivation

This API will allow web apps to detect whether a device is unresponsive because it has gone out of range by listening for advertisement packets from the device. Without this API, operations on the Bluetooth device would hang until the device was timed out on the system, causing a 'gattserverdisconnected' event to be fired. With persistent permissions for Web Bluetooth, watchAdvertisements() will enable web apps to check if a permitted device is in range of the system before attempting to connect to the device.

Demos

Documentation

Specification

Editor's draft

Status in Chromium

Blink>Bluetooth


In developer trial (Behind a flag) (tracking bug) in:

  • Chrome for desktop release 85
  • Chrome for Android release 85

Consensus & Standardization

After a feature ships in Chrome, the values listed here are not guaranteed to be up to date.

Owner

Intent to Prototype url

Intent to Prototype thread

Comments

Note: watchAdvertisements() is not supported in Linux due to limitations of BlueZ. Developer Guide: https://docs.google.com/document/d/1RF4D-60cQJWR1LoQeLBxxigrxJwYS8nLOE0qWmBF1eo

Search tags

Web Bluetooth, watchAdvertisements, BluetoothDevice,

Last updated on 2020-10-25