BluetoothDeviceEvent

Tags: 2.5 Privileged

Description

The BluetoothDeviceEvent interface of the Web Bluetooth API provides access to a found/paired device (BluetoothDevice) object or the address or an unpaired device as the parameter of a devicefound, devicepaired or deviceunpaired event handler (see BluetoothDiscoveryHandle.ondevicefound, BluetoothAdapter.ondevicepaired, and BluetoothAdapter.ondeviceunpaired), when fired.

Interface overview

[CheckAnyPermissions="bluetooth"]
interface BluetoothDeviceEvent : Event
{
  readonly attribute BluetoothDevice? device;
  readonly attribute DOMString? address;
};

Properties

  • BluetoothDeviceEvent.device Returns a BluetoothDevice object representing the paired remote device. Returns null for the BluetoothAdapter.ondeviceunpaired event handler since the that only requires the address of the unpaired device.

  • BluetoothDeviceEvent.address Returns a DOMString representing the address of the unpaired remote device. Returns null for the BluetoothDiscoveryHandle.ondevicefound and BluetoothAdapter.ondevicepaired event handlers since a found/paired remote device already has an BluetoothDevice.address property.