BluetoothDevice
Limited availability
The BluetoothDevice interface of the Web Bluetooth API represents a Bluetooth device inside a particular script execution environment.
Instance properties
-
BluetoothDevice.id
Experimental Read only
-
A string that uniquely identifies a device.
-
BluetoothDevice.name
Experimental Read only
-
A string that provides a human-readable name for the device.
-
BluetoothDevice.gatt
Experimental Read only
-
A reference to the device's BluetoothRemoteGATTServer
.
Instance methods
-
BluetoothDevice.watchAdvertisements()
Experimental
-
A Promise
that resolves to undefined
or is rejected with an error if advertisements can't be shown for any reason.
-
BluetoothDevice.forget()
Experimental
-
Provides a way for the page to revoke access to a device the user has granted access to.
Events
Listen to these events using addEventListener()
or by assigning an event listener to the oneventname
property of this interface.
-
gattserverdisconnected
Experimental
-
Fired on a device when an active GATT connection is lost.
Specifications
Browser compatibility
|
Desktop |
Mobile |
|
Chrome |
Edge |
Firefox |
Opera |
Safari |
Chrome Android |
Firefox for Android |
Opera Android |
Safari on IOS |
Samsung Internet |
WebView Android |
BluetoothDevice |
70Linux support is not enabled by default.56–70Only supported on macOS.
|
79Linux support is not enabled by default. |
No |
57Linux support is not enabled by default.43–57Only supported on macOS.
|
No |
56 |
No |
43 |
No |
6.0 |
No |
gatt |
56 |
79 |
No |
43 |
No |
56 |
No |
43 |
No |
6.0 |
No |
gattserverdisconnected_event |
56 |
79 |
No |
43 |
No |
56 |
No |
43 |
No |
6.0 |
No |
id |
56 |
79 |
No |
43 |
No |
56 |
No |
43 |
No |
6.0 |
No |
name |
56 |
79 |
No |
43 |
No |
56 |
No |
43 |
No |
6.0 |
No |