BluetoothAdapter interface of the Web Bluetooth API is used to handle all the operations requested by Bluetooth networks. A Bluetooth adapter is the physical interface which is used to interact with local Bluetooth device.
read-onlyA boolean indicating if the device is discoverable (
true) or not (
false) by other Bluetooth devices.
read-onlyA boolean indicating if the device's adapter is in the process of discovering (
true) or not (
false) surrounding Bluetooth devices.
read-onlyA string indicating the human readable name of the device's adapter.
no-linkReturns the state of the local bluetooth adapter.
BluetoothAdapter.onattributechangedA handler for the
attributechangedevent; it is triggered when one of the local bluetooth adapter's properties has changed
BluetoothAdapter.ondevicepairedA handler for the
devicepairedevent; it is triggered when a remote device gets paired with the local bluetooth adapter.
BluetoothAdapter.ondeviceunpairedA handler for the
deviceunpairedevent; it is triggered when a remote device gets unpaired from the local bluetooth adapter.
BluetoothAdapter.onpairingabortedA handler for the
pairingabortedevent; it is triggered when pairing fails due to authentication failure, the remote device being down (bluetooth ACL becomes disconnected), or some kind of internal error.
BluetoothAdapter.onhfpstatuschangedA handler for the
hfpstatuschangedevent; it is triggered when an HFP connection status changes.
BluetoothAdapter.onrequestmediaplaystatusA handler for the
requestmediaplaystatusevent; it is triggered when a remote Bluetooth device queries the current media play status.
Note: Because the
BluetoothAdapterinterface inherits from the
EventTargetinterface, all these events can be listened by using the
BluetoothAdapter.getPairedDevices()Allows retrieving a full list of all devices paired with the device's adapter.
BluetoothAdapter.pair()Allows to start pairing a remote device with the device's adapter.
BluetoothAdapter.startDiscovery()Allows the device's adapter to start seeking for remote devices.
BluetoothAdapter.startLeScan()Instructs the device's adapter to start seeking for remote LE devices advertising given services.
BluetoothAdapter.stopDiscovery()Allows the device's adapter to stop seeking for remote devices.
BluetoothAdapter.stopLeScan()Instructs the device's adapter to stop scanning for remote LE devices.
BluetoothAdapter.unpair()Allows to unpair a remote device from the device's adapter.