BluetoothDevice
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental:This is anexperimental technology
Check theBrowser compatibility table carefully before using this in production.
Secure context: This feature is available only insecure contexts (HTTPS), in some or allsupporting browsers.
The BluetoothDevice interface of theWeb Bluetooth API represents a Bluetooth device inside a particular script executionenvironment.
In this article
Instance properties
BluetoothDevice.idExperimentalRead onlyA string that uniquely identifies a device.
BluetoothDevice.nameExperimentalRead onlyA string that provides a human-readable name for the device.
BluetoothDevice.gattExperimentalRead onlyA reference to the device's
BluetoothRemoteGATTServer.
Instance methods
BluetoothDevice.watchAdvertisements()ExperimentalA
Promisethat resolves toundefinedor is rejected withan error if advertisements can't be shown for any reason.BluetoothDevice.forget()ExperimentalProvides a way for the page to revoke access to a device the user has granted access to.
Events
Listen to these events usingaddEventListener() or by assigning an event listener to theoneventname property of this interface.
gattserverdisconnectedExperimentalFired on a device when an active GATT connection is lost.
Specifications
| Specification |
|---|
| Web Bluetooth> # bluetoothdevice-interface> |